/* ==========================================================================
   css/iba-ui-tables.css  —  14.0.0 patch 7 : one table look everywhere
   (patch 9: frozen column headers in every list - 23.4)
   --------------------------------------------------------------------------
   Every list on the desktop pages now looks like the Invoice Records list
   (patch 6): one solid panel, a header row that stays on top while
   scrolling, a line under every row, light shading on every second row,
   money on the right, gold edge on the row under the mouse.

   Covers: Dashboard With Accounts and Paid History (with their filter row
   and month tabs), Active Task, Job Records, Active Job, Work History,
   Material Stock, Invoice Entry "Existing Invoices", Payments.

   Same cascade layer as css/iba-ui.css ("iba-ui"). Desktop only; the phone
   workspace has its own cards. No logic. Removing this file (and its
   <link>) brings back the patch 6 tables.
   ========================================================================== */

@media screen and (min-width: 901px) {
@layer iba-ui {

  /* ---------------------------------------------------------------------
     23.1 The panel that holds a list (same as the Invoice Records sheet)
     --------------------------------------------------------------------- */
  html body.iba-shell-on :is(
      #wd-reporting #reporting-printable-area > .table-wrapper,
      #wd-activetask > .table-wrapper,
      #inv-active-job > .table-wrapper,
      #wd-material-stock .ms-premium-tablewrap,
      #im-existing-invoices-container > .table-wrapper,
      #im-payments .im-payment-cart-table-wrap,
      #wd-dashboard .wd-payment-pocket-table-wrap,
      #wd-dashboard .wd-paid-po-history-table-wrap) {
    border: 1px solid var(--ui-line) !important;
    border-radius: var(--ui-radius-l) !important;
    background: var(--ui-panel-strong) !important;
    background-color: var(--ui-panel-strong) !important;
    background-image: none !important;
    box-shadow: 0 18px 40px rgba(3, 10, 18, 0.28) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* ---------------------------------------------------------------------
     23.2 Rows: a clear line under each one, light shading on every second
     one (only the main rows; opened detail rows keep their own look).
     The line rule is made strong on purpose (":not(#iba-t7)") so older
     per-page rules cannot remove it; the shading stays weaker than the
     row-under-the-mouse colour.
     --------------------------------------------------------------------- */
  html body.iba-shell-on:not(#iba-t7) :is(
      #job-records-table,
      #wd-activetask table.wd-active-modern-table,
      #inv-active-job table.wd-inventory-modern-table,
      #wd-material-stock #ms-table,
      #im-existing-invoices-container table,
      #im-payments #im-payments-table,
      #wd-dashboard .wd-payment-pocket-table,
      #wd-dashboard .wd-paid-po-history-table) > tbody > tr > td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.075) !important;
  }
  html body.iba-shell-on:not(#iba-t7) :is(
      #job-records-table,
      #wd-activetask table.wd-active-modern-table,
      #inv-active-job table.wd-inventory-modern-table,
      #wd-material-stock #ms-table,
      #im-existing-invoices-container table,
      #im-payments #im-payments-table,
      #wd-dashboard .wd-payment-pocket-table,
      #wd-dashboard .wd-paid-po-history-table) > tbody > tr:last-child > td {
    border-bottom: 0 !important;
  }
  html body.iba-shell-on :is(
      #job-records-table,
      #wd-activetask table.wd-active-modern-table,
      #inv-active-job table.wd-inventory-modern-table,
      #wd-material-stock #ms-table,
      #im-existing-invoices-container table,
      #im-payments #im-payments-table,
      #wd-dashboard .wd-payment-pocket-table,
      #wd-dashboard .wd-paid-po-history-table) > tbody > tr:not(.controlid-group-child):not(.inventory-child-row):not(.stock-child-row):not(.ms-bd-gap-row):nth-child(even of :not(.controlid-group-child):not(.inventory-child-row):not(.stock-child-row):not(.ms-bd-gap-row)) > td:not(td[colspan]) {
    background: rgba(255, 255, 255, 0.03) !important;
    background-color: rgba(255, 255, 255, 0.03) !important;
  }

  /* tab bars above a list (Active Job, PO Close Out): the same solid panel
     as the Active Task tabs, no longer see-through */
  html body.iba-shell-on :is(#inv-active-job #iba-aj-folder, #im-po-closeout #im-po-closeout-tabs) {
    box-sizing: border-box !important;
    max-width: 100% !important;
    border: 1px solid var(--ui-line) !important;
    border-radius: 14px !important;
    background: var(--ui-panel-strong) !important;
    background-color: var(--ui-panel-strong) !important;
    background-image: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  html body.iba-shell-on #inv-active-job #iba-aj-folder { width: 100% !important; margin-bottom: 14px !important; }

  /* ---------------------------------------------------------------------
     23.3 Dashboard > With Accounts and Paid History
     --------------------------------------------------------------------- */
  /* filter row (Site, Year, search, Clear, Refresh): one solid bar, like
     the Invoice Records search panel */
  body.iba-shell-on #wd-dashboard#wd-dashboard .wd-payment-pocket-tools {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 10px 14px !important;
    margin: 0 0 12px !important;
    padding: 12px 14px !important;
    border: 1px solid var(--ui-line) !important;
    border-radius: var(--ui-radius-l) !important;
    background: var(--ui-panel-strong) !important;
    background-color: var(--ui-panel-strong) !important;
    background-image: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  body.iba-shell-on #wd-dashboard#wd-dashboard .wd-payment-pocket-tools .wd-dash-search-slot { margin-left: auto !important; }
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(.wd-payment-pocket-filter-group, .wd-paid-history-year-control, .wd-paid-history-site-control) {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(.wd-payment-pocket-filter-group > label, .wd-paid-history-year-control > span, .wd-paid-history-site-control > span) {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
    color: var(--ui-text-2) !important;
    -webkit-text-fill-color: var(--ui-text-2) !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    text-shadow: none !important;
    white-space: nowrap !important;
  }
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(.wd-payment-pocket-filter-group > label, .wd-paid-history-year-control > span, .wd-paid-history-site-control > span) i { color: var(--ui-gold) !important; -webkit-text-fill-color: var(--ui-gold) !important; }
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(#wd-payment-pocket-site-filter, #wd-payment-pocket-year-filter, #wd-paid-history-year-filter, #wd-paid-history-site-filter) {
    appearance: none !important;
    -webkit-appearance: none !important;
    height: 38px !important;
    min-height: 0 !important;
    min-width: 150px !important;
    margin: 0 !important;
    padding: 0 34px 0 12px !important;
    border: 1px solid var(--ui-line) !important;
    border-radius: 10px !important;
    background-color: var(--ui-field) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A7B6C6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 11px center !important;
    background-size: 15px !important;
    color: var(--ui-text) !important;
    -webkit-text-fill-color: var(--ui-text) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    box-shadow: none !important;
    cursor: pointer !important;
  }
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(#wd-payment-pocket-site-filter, #wd-payment-pocket-year-filter, #wd-paid-history-year-filter, #wd-paid-history-site-filter):focus {
    border-color: var(--ui-gold) !important;
    box-shadow: 0 0 0 3px rgba(227, 201, 138, 0.22) !important;
    outline: none !important;
  }
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(#wd-payment-pocket-site-filter, #wd-payment-pocket-year-filter, #wd-paid-history-year-filter, #wd-paid-history-site-filter) option { background: #13293F !important; color: var(--ui-text) !important; }

  /* month tabs: quiet pills with the count; the open month in gold */
  body.iba-shell-on #wd-dashboard#wd-dashboard .wd-payment-pocket-month-tabs {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin: 0 0 12px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  body.iba-shell-on #wd-dashboard#wd-dashboard .wd-payment-pocket-month-tab {
    height: 34px !important;
    min-height: 0 !important;
    padding: 0 14px !important;
    margin: 0 !important;
    border: 1px solid var(--ui-line) !important;
    border-radius: 999px !important;
    background: rgba(13, 25, 39, 0.9) !important;
    background-color: rgba(13, 25, 39, 0.9) !important;
    background-image: none !important;
    color: var(--ui-text-2) !important;
    -webkit-text-fill-color: var(--ui-text-2) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 1 !important;
    cursor: pointer !important;
  }
  body.iba-shell-on #wd-dashboard#wd-dashboard .wd-payment-pocket-month-tab:hover { border-color: rgba(255, 255, 255, 0.28) !important; color: var(--ui-text) !important; -webkit-text-fill-color: var(--ui-text) !important; }
  body.iba-shell-on #wd-dashboard#wd-dashboard .wd-payment-pocket-month-tab.active {
    border-color: var(--ui-gold) !important;
    background: rgba(48, 41, 24, 0.95) !important;
    background-color: rgba(48, 41, 24, 0.95) !important;
    color: var(--ui-gold) !important;
    -webkit-text-fill-color: var(--ui-gold) !important;
  }
  body.iba-shell-on #wd-dashboard#wd-dashboard .wd-payment-pocket-month-tab.wd-payment-month-search-match { border-color: var(--ui-teal-hover) !important; color: var(--ui-text) !important; -webkit-text-fill-color: var(--ui-text) !important; }
  body.iba-shell-on #wd-dashboard#wd-dashboard .wd-payment-pocket-month-tab.wd-payment-month-search-muted { opacity: 0.45 !important; }

  /* the table itself */
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(.wd-payment-pocket-table-wrap, .wd-paid-po-history-table-wrap) {
    box-sizing: border-box !important;
    flex: 0 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100vh - 300px) !important;
    overflow: auto !important;
  }
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(.wd-payment-pocket-table, .wd-paid-po-history-table) {
    width: 100% !important;
    margin: 0 !important;
    table-layout: auto !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(.wd-payment-pocket-table, .wd-paid-po-history-table) thead tr { background: transparent !important; box-shadow: none !important; }
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(.wd-payment-pocket-table, .wd-paid-po-history-table) thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 3 !important;
    height: auto !important;
    padding: 12px 14px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--ui-line) !important;
    border-radius: 0 !important;
    background: var(--ui-head) !important;
    background-color: var(--ui-head) !important;
    background-image: none !important;
    color: var(--ui-text-2) !important;
    -webkit-text-fill-color: var(--ui-text-2) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    text-transform: none !important;
    text-align: left !important;
    text-shadow: none !important;
    white-space: nowrap !important;
    box-shadow: none !important;
  }
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(.wd-payment-pocket-table, .wd-paid-po-history-table) tbody tr {
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(.wd-payment-pocket-table, .wd-paid-po-history-table) tbody td {
    height: auto !important;
    padding: 11px 14px !important;
    border-top: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    color: var(--ui-text) !important;
    -webkit-text-fill-color: var(--ui-text) !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
    text-shadow: none !important;
    vertical-align: middle !important;
    box-shadow: none !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(.wd-payment-pocket-table, .wd-paid-po-history-table) tbody td :is(strong, b) { color: #ffffff !important; -webkit-text-fill-color: #ffffff !important; font-weight: 700 !important; }
  /* With Accounts columns: Site quieter, Invoice Value on the right */
  body.iba-shell-on #wd-dashboard#wd-dashboard .wd-payment-pocket-table tbody td:nth-child(4) { color: var(--ui-text-2) !important; -webkit-text-fill-color: var(--ui-text-2) !important; white-space: nowrap !important; }
  body.iba-shell-on #wd-dashboard#wd-dashboard .wd-payment-pocket-table :is(thead th:nth-child(5), tbody td:nth-child(5)) {
    text-align: right !important;
    font-variant-numeric: tabular-nums !important;
    white-space: nowrap !important;
  }
  body.iba-shell-on #wd-dashboard#wd-dashboard .wd-payment-pocket-table tbody td:nth-child(5) { font-weight: 700 !important; }
  body.iba-shell-on #wd-dashboard#wd-dashboard .wd-payment-pocket-table tbody td:is(:nth-child(1), :nth-child(6)) { white-space: nowrap !important; }
  body.iba-shell-on #wd-dashboard#wd-dashboard .wd-payment-pocket-table .wd-payment-pocket-po-text { color: var(--ui-text) !important; -webkit-text-fill-color: var(--ui-text) !important; font-weight: 600 !important; }
  body.iba-shell-on #wd-dashboard#wd-dashboard .wd-payment-pocket-table td.wd-payment-pocket-no-match {
    padding: 34px 20px !important;
    text-align: center !important;
    color: var(--ui-text-2) !important;
    -webkit-text-fill-color: var(--ui-text-2) !important;
    font-size: 14px !important;
  }
  /* status: soft teal badge like the other lists */
  body.iba-shell-on #wd-dashboard#wd-dashboard .wd-payment-pocket-status {
    display: inline-flex !important;
    align-items: center !important;
    height: 24px !important;
    padding: 0 10px !important;
    border: 1px solid rgba(23, 160, 174, 0.45) !important;
    border-radius: 999px !important;
    background: var(--ui-teal-soft) !important;
    color: #8FDCE4 !important;
    -webkit-text-fill-color: #8FDCE4 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    text-shadow: none !important;
    box-shadow: none !important;
  }
  /* SRV PDF: small red-outline button instead of the big red block */
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(.wd-payment-pocket-table, .wd-paid-po-history-table) .wd-dashboard-pdf-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    height: 30px !important;
    min-height: 0 !important;
    padding: 0 12px !important;
    border: 1px solid rgba(239, 138, 122, 0.55) !important;
    border-radius: 8px !important;
    background: var(--ui-red-soft) !important;
    background-color: var(--ui-red-soft) !important;
    background-image: none !important;
    color: var(--ui-red) !important;
    -webkit-text-fill-color: var(--ui-red) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
    transform: none !important;
    white-space: nowrap !important;
  }
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(.wd-payment-pocket-table, .wd-paid-po-history-table) .wd-dashboard-pdf-btn:hover { background: rgba(239, 138, 122, 0.24) !important; background-color: rgba(239, 138, 122, 0.24) !important; }
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(.wd-payment-pocket-table, .wd-paid-po-history-table) .wd-dashboard-pdf-btn i { color: inherit !important; -webkit-text-fill-color: inherit !important; }
  body.iba-shell-on #wd-dashboard#wd-dashboard .wd-payment-pocket-table .wd-pdf-empty { color: var(--ui-text-3) !important; -webkit-text-fill-color: var(--ui-text-3) !important; }
  /* Mark Paid / View Latest 3: one small teal button */
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(.wd-payment-pocket-mark-paid, .wd-paid-po-view-btn) {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    height: 30px !important;
    min-height: 0 !important;
    padding: 0 12px !important;
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    background: var(--ui-teal) !important;
    background-color: var(--ui-teal) !important;
    background-image: none !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
    transform: none !important;
    white-space: nowrap !important;
    cursor: pointer !important;
  }
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(.wd-payment-pocket-mark-paid, .wd-paid-po-view-btn):hover { background: var(--ui-teal-hover) !important; background-color: var(--ui-teal-hover) !important; }
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(.wd-payment-pocket-mark-paid, .wd-paid-po-view-btn) i { color: inherit !important; -webkit-text-fill-color: inherit !important; }
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(.wd-payment-pocket-table th:last-child, .wd-payment-pocket-table td.wd-payment-pocket-action-cell) { text-align: right !important; }
  /* Paid History columns: PO as a link, count and date tidy */
  body.iba-shell-on #wd-dashboard#wd-dashboard .wd-paid-po-history-table .wd-paid-po-link {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    border-bottom: 1px dashed rgba(227, 201, 138, 0.55) !important;
    cursor: pointer !important;
  }
  body.iba-shell-on #wd-dashboard#wd-dashboard .wd-paid-po-history-table .wd-paid-po-link:hover { color: var(--ui-gold) !important; -webkit-text-fill-color: var(--ui-gold) !important; }
  body.iba-shell-on #wd-dashboard#wd-dashboard .wd-paid-po-history-table tbody td:nth-child(3) { color: var(--ui-text-2) !important; -webkit-text-fill-color: var(--ui-text-2) !important; }
  body.iba-shell-on #wd-dashboard#wd-dashboard .wd-paid-po-history-table :is(thead th:nth-child(4), tbody td:nth-child(4)) { text-align: center !important; font-variant-numeric: tabular-nums !important; }
  body.iba-shell-on #wd-dashboard#wd-dashboard .wd-paid-po-history-table :is(thead th:last-child, tbody td:last-child) { text-align: right !important; }
  body.iba-shell-on #wd-dashboard#wd-dashboard .wd-paid-po-history-table tbody td { font-size: 13.5px !important; }
  /* Paid History panel and its messages (search first / loading / none) */
  body.iba-shell-on #wd-dashboard#wd-dashboard .wd-paid-po-history-panel {
    flex: 0 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(.wd-paid-po-history-empty, .wd-paid-po-history-loading) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 14px !important;
    margin: 0 !important;
    padding: 30px 20px !important;
    border: 1px solid var(--ui-line) !important;
    border-radius: var(--ui-radius-l) !important;
    background: var(--ui-panel-strong) !important;
    background-color: var(--ui-panel-strong) !important;
    box-shadow: none !important;
    text-align: left !important;
  }
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(.wd-paid-po-history-empty, .wd-paid-po-history-loading) > i { color: var(--ui-gold) !important; -webkit-text-fill-color: var(--ui-gold) !important; font-size: 20px !important; }
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(.wd-paid-po-history-empty, .wd-paid-po-history-loading) strong { display: block !important; color: var(--ui-text) !important; -webkit-text-fill-color: var(--ui-text) !important; font-size: 14px !important; }
  body.iba-shell-on #wd-dashboard#wd-dashboard :is(.wd-paid-po-history-empty, .wd-paid-po-history-loading) span { display: block !important; color: var(--ui-text-2) !important; -webkit-text-fill-color: var(--ui-text-2) !important; font-size: 13px !important; }

  /* ---------------------------------------------------------------------
     23.4 Frozen column headers in every list (patch 9)
     While a list scrolls, its header row stays at the top of the list.
     Why some did not: the table itself was set to cut off its overflow,
     which made the table (not the scrolling list) the frame the header
     stuck to - so the header left with the rows. Also a few lists had no
     height limit, so the whole page scrolled instead of the list.
     --------------------------------------------------------------------- */
  /* a) a table never cuts off its own content (the rounded panel around it
        still trims the corners) */
  html body.iba-shell-on:not(#iba-t9a):not(#iba-t9b):not(#iba-t9c) :is(#workdesk-view, #invoice-management-view, #inventory-view, .modal-overlay, #ms-stock-check-modal) table {
    overflow: visible !important;
  }
  /* b) every header cell of a list stays on top, on a solid background so
        the rows slide underneath it (tables inside a row are left alone) */
  html body.iba-shell-on:not(#iba-t9a):not(#iba-t9b):not(#iba-t9c) :is(#workdesk-view, #invoice-management-view, #inventory-view, .modal-overlay, #ms-stock-check-modal) table:not(td table) > thead > tr > th {
    position: sticky !important;
    top: var(--iba-sticky-top, 0px) !important;
    z-index: 4 !important;
    background-color: var(--ui-head) !important;
    background-image: none !important;
    background-clip: padding-box !important;
    box-shadow: inset 0 -1px 0 var(--ui-line) !important;
  }
  html body.iba-shell-on:not(#iba-t9a):not(#iba-t9b):not(#iba-t9c) :is(#workdesk-view, #invoice-management-view, #inventory-view, .modal-overlay, #ms-stock-check-modal) table:not(td table) > thead,
  html body.iba-shell-on:not(#iba-t9a):not(#iba-t9b):not(#iba-t9c) :is(#workdesk-view, #invoice-management-view, #inventory-view, .modal-overlay, #ms-stock-check-modal) table:not(td table) > thead > tr {
    position: static !important;
  }
  /* c) Invoice Records: the invoices of an open PO keep their own header,
        just under the PO header (both stay while scrolling) */
  html body.iba-shell-on:not(#iba-t9a):not(#iba-t9b):not(#iba-t9c) #im-reporting .iba-records-sheet table:not(td table) > thead > tr > th {
    top: calc(var(--iba-sticky-top, 0px) + var(--iba-records-head-h, 45px)) !important;
    z-index: 2 !important;
  }
  html body.iba-shell-on:not(#iba-t9a):not(#iba-t9b):not(#iba-t9c) #im-reporting .iba-records-sheet .grid-header { top: var(--iba-sticky-top, 0px) !important; }
  /* d) lists that had no height limit now scroll inside their panel */
  html body.iba-shell-on #im-invoice-entry #im-existing-invoices-container > .table-wrapper {
    max-height: calc(100vh - 300px) !important;
    overflow: auto !important;
  }
  .modal-overlay:not(#standard-job-modal) > .modal-container .table-wrapper {
    max-height: min(62vh, 620px);
  }
}
}

/* 15.0.0 patch 1: Job Records shows its rows in steps (js/app-workdesk-reporting.js) */
@layer iba-ui {
  #reporting-table-body > tr.wd-jr-later { display: none !important; }
  .wd-jr-more {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    padding: 14px 12px 18px !important;
    color: var(--ui-text-2, #A7B6C6) !important;
    -webkit-text-fill-color: var(--ui-text-2, #A7B6C6) !important;
    font-size: 13px !important;
  }
  .wd-jr-more[hidden] { display: none !important; }
  .wd-jr-more button { height: 32px !important; padding: 0 14px !important; }
}

/* 15.0.0 patch 9: Active Task - Urgent | Normal and the queue dates as tabs */
@layer iba-ui {
  body.iba-shell-on #wd-activetask#wd-activetask .wd-at-queue-tabs { display: flex !important; flex-direction: column !important; align-items: stretch !important; gap: 10px !important; }
  body.iba-shell-on #wd-activetask .wd-at-urg { display: flex !important; gap: 8px !important; flex-wrap: wrap !important; }
  body.iba-shell-on #wd-activetask .wd-at-urg button {
    display: inline-flex !important; align-items: center !important; gap: 8px !important;
    height: 36px !important; padding: 0 16px !important; margin: 0 !important; cursor: pointer !important;
    border: 1px solid var(--ui-line) !important; border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.04) !important; color: var(--ui-text-2) !important; -webkit-text-fill-color: var(--ui-text-2) !important;
    font-size: 13.5px !important; font-weight: 700 !important; box-shadow: none !important;
  }
  body.iba-shell-on #wd-activetask .wd-at-urg button b { min-width: 22px !important; padding: 1px 7px !important; border-radius: 999px !important; background: rgba(255, 255, 255, 0.10) !important; font-size: 12px !important; text-align: center !important; }
  body.iba-shell-on #wd-activetask .wd-at-urg button.is-on { border-color: rgba(94, 214, 196, 0.8) !important; background: rgba(94, 214, 196, 0.16) !important; color: #EAF8F5 !important; -webkit-text-fill-color: #EAF8F5 !important; }
  body.iba-shell-on #wd-activetask .wd-at-urg button.is-urgent { color: #FFB4A8 !important; -webkit-text-fill-color: #FFB4A8 !important; }
  body.iba-shell-on #wd-activetask .wd-at-urg button.is-urgent.is-on { border-color: #F07A68 !important; background: rgba(240, 122, 104, 0.18) !important; color: #FFE3DE !important; -webkit-text-fill-color: #FFE3DE !important; }
  body.iba-shell-on #wd-activetask .wd-at-date-tabs { display: flex !important; flex-wrap: wrap !important; gap: 6px !important; }
  body.iba-shell-on #wd-activetask .wd-at-date-tab {
    display: inline-flex !important; align-items: center !important; gap: 7px !important;
    height: 32px !important; padding: 0 12px !important; margin: 0 !important; cursor: pointer !important;
    border: 1px solid var(--ui-line) !important; border-radius: 9px !important;
    background: rgba(255, 255, 255, 0.04) !important; color: var(--ui-text-2) !important; -webkit-text-fill-color: var(--ui-text-2) !important;
    font-size: 13px !important; font-weight: 600 !important; box-shadow: none !important; white-space: nowrap !important;
  }
  body.iba-shell-on #wd-activetask .wd-at-date-tab b { font-size: 11.5px !important; padding: 0 6px !important; border-radius: 999px !important; background: rgba(255, 255, 255, 0.10) !important; }
  body.iba-shell-on #wd-activetask .wd-at-date-tab:hover { border-color: rgba(255, 255, 255, 0.3) !important; }
  body.iba-shell-on #wd-activetask .wd-at-date-tab.is-on { border-color: var(--ui-gold, #E3C98A) !important; background: rgba(227, 201, 138, 0.16) !important; color: #FFF3D6 !important; -webkit-text-fill-color: #FFF3D6 !important; }
}

/* 15.0.0 patch 9: Invoice Records - a big search line, compact filters */
@layer iba-ui {
  html body.iba-shell-on #im-reporting#im-reporting .iba-records-row:first-child { flex-wrap: nowrap !important; gap: 8px !important; }
  html body.iba-shell-on #im-reporting#im-reporting .iba-narrow-search { flex: 1 1 380px !important; max-width: none !important; min-width: 220px !important; height: 46px !important; border-radius: 13px !important; }
  html body.iba-shell-on #im-reporting#im-reporting .iba-narrow-search input { height: 44px !important; font-size: 15px !important; }
  html body.iba-shell-on #im-reporting#im-reporting #im-reporting-search-btn { height: 46px !important; padding: 0 24px !important; font-size: 14.5px !important; font-weight: 700 !important; border-radius: 13px !important; flex: 0 0 auto !important; }
  html body.iba-shell-on #im-reporting#im-reporting #im-reporting-clear-button { height: 46px !important; flex: 0 0 auto !important; border-radius: 13px !important; }
  html body.iba-shell-on #im-reporting#im-reporting .iba-records-filters { flex: 0 1 auto !important; gap: 6px !important; }
  html body.iba-shell-on #im-reporting#im-reporting .iba-records-filters select { min-width: 0 !important; width: 104px !important; height: 46px !important; padding: 0 26px 0 12px !important; border-radius: 13px !important; font-size: 13.5px !important; text-overflow: ellipsis !important; }
  html body.iba-shell-on #im-reporting#im-reporting .iba-records-filters select#im-reporting-site-filter { width: 128px !important; }
  html body.iba-shell-on #im-reporting#im-reporting .iba-records-filters select#im-reporting-status-filter { width: 128px !important; }
  @media (max-width: 1180px) {
    html body.iba-shell-on #im-reporting#im-reporting .iba-records-row:first-child { flex-wrap: wrap !important; }
  }
}

/* 15.0.0 patch 11: Active Job "Multi" heading - one row on the table's own
   columns (control no. + Multi badge, item, details, route, total qty,
   contact, status with progress, show items). Children indented beneath. */
@layer iba-ui {
  html body.iba-shell-on #inv-active-job table tbody tr.wd-mj-row { cursor: pointer !important; }
  html body.iba-shell-on #inv-active-job table tbody tr.wd-mj-row > td {
    vertical-align: middle !important; padding: 12px 10px !important;
    background: rgba(94, 214, 196, 0.06) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.10) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  }
  html body.iba-shell-on #inv-active-job table tbody tr.wd-mj-row > td:first-child { box-shadow: inset 3px 0 0 rgba(94, 214, 196, 0.55) !important; white-space: nowrap !important; }
  html body.iba-shell-on #inv-active-job table tbody tr.wd-mj-row.open > td { background: rgba(94, 214, 196, 0.14) !important; }
  html body.iba-shell-on #inv-active-job table tbody tr.wd-mj-row.open > td:first-child { box-shadow: inset 3px 0 0 #5ED6C4 !important; }
  html body.iba-shell-on #inv-active-job tr.wd-mj-row .wd-mj-chev {
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    width: 22px !important; height: 22px !important; margin-right: 8px !important; vertical-align: middle !important;
    border-radius: 50% !important; border: 1px solid rgba(255, 255, 255, 0.28) !important; font-size: 10px !important;
  }
  html body.iba-shell-on #inv-active-job tr.wd-mj-row .wd-mj-chev i { transition: transform .18s ease !important; }
  html body.iba-shell-on #inv-active-job tr.wd-mj-row.open .wd-mj-chev i { transform: rotate(90deg) !important; }
  html body.iba-shell-on #inv-active-job tr.wd-mj-row .wd-mj-idtext { display: inline-flex !important; flex-direction: column !important; gap: 3px !important; vertical-align: middle !important; }
  html body.iba-shell-on #inv-active-job tr.wd-mj-row .wd-inventory-control-id { font-size: 14px !important; letter-spacing: .02em !important; }
  html body.iba-shell-on #inv-active-job tr.wd-mj-row .wd-mj-badge {
    display: inline-block !important; width: max-content !important; padding: 1px 8px !important; border-radius: 999px !important;
    border: 1px solid rgba(94, 214, 196, 0.55) !important; background: rgba(94, 214, 196, 0.14) !important;
    font-size: 10.5px !important; font-weight: 700 !important; letter-spacing: .04em !important;
  }
  html body.iba-shell-on #inv-active-job tr.wd-mj-row .wd-mj-more,
  html body.iba-shell-on #inv-active-job tr.wd-mj-row .wd-mj-progtext,
  html body.iba-shell-on #inv-active-job tr.wd-mj-row .wd-mj-open {
    font-size: 11px !important; font-weight: 600 !important; opacity: .78 !important; white-space: nowrap !important;
  }
  html body.iba-shell-on #inv-active-job tr.wd-mj-row .wd-mj-qty { font-weight: 800 !important; font-size: 14px !important; }
  html body.iba-shell-on #inv-active-job tr.wd-mj-row .wd-mj-status .wd-inventory-status-pill { display: inline-block !important; margin-bottom: 6px !important; }
  html body.iba-shell-on #inv-active-job tr.wd-mj-row .wd-mj-prog {
    display: block !important; width: 110px !important; height: 4px !important; margin: 0 0 3px !important;
    border-radius: 999px !important; background: rgba(255, 255, 255, 0.18) !important; overflow: hidden !important;
  }
  html body.iba-shell-on #inv-active-job tr.wd-mj-row .wd-mj-prog i { display: block !important; height: 100% !important; min-width: 2px !important; background: #5ED6C4 !important; border-radius: 999px !important; }
  html body.iba-shell-on #inv-active-job tr.wd-mj-row .wd-mj-progtext { display: block !important; }
  html body.iba-shell-on #inv-active-job tr.wd-mj-row.open .wd-mj-open i { transform: rotate(180deg) !important; }
  /* the items under an open heading */
  html body.iba-shell-on #inv-active-job table tbody tr.controlid-group-child > td { background: rgba(255, 255, 255, 0.03) !important; }
  html body.iba-shell-on #inv-active-job#inv-active-job table tbody tr.controlid-group-child > td:first-child { padding-left: 40px !important; box-shadow: inset 3px 0 0 rgba(94, 214, 196, 0.25) !important; }
}

/* 15.0.0 patch 18: the task opened from the assistant's brief */
@layer iba-ui {
  html body.iba-shell-on :is(#wd-activetask, #inv-active-job):is(#wd-activetask, #inv-active-job) table tbody tr.wd-row-focus > td {
    background: rgba(250, 204, 21, 0.22) !important; background-color: rgba(250, 204, 21, 0.22) !important;
    box-shadow: inset 0 2px 0 #FACC15, inset 0 -2px 0 #FACC15 !important; animation: ibaRowFocusBg 1.2s ease-in-out 0s 3 !important;
  }
  html body.iba-shell-on :is(#wd-activetask, #inv-active-job):is(#wd-activetask, #inv-active-job) table tbody tr.wd-row-focus > td:first-child { box-shadow: inset 5px 0 0 #FACC15, inset 0 2px 0 #FACC15, inset 0 -2px 0 #FACC15 !important; }
  html body.iba-shell-on :is(#wd-activetask, #inv-active-job):is(#wd-activetask, #inv-active-job) table tbody tr.wd-row-focus > td:last-child :is(button, a) { animation: ibaRowFocusPulse 1s ease-in-out 0s 6 !important; }
}
@keyframes ibaRowFocusBg { 0%, 100% { background-color: rgba(250, 204, 21, 0.22); } 50% { background-color: rgba(250, 204, 21, 0.4); } }
@keyframes ibaRowFocusPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(250, 204, 21, .85); } 50% { box-shadow: 0 0 0 8px rgba(250, 204, 21, 0); } }
