/* ===================================================================
   tables-modern.css
   One shared, modern look for every data table in the project
   (table.mshresponse: acn_* / acc_* / pst_* / prl_* / reports / home lists).
   Loaded after ui-enhance.css - only adds to it, never repeats its rules.
   Pure visual polish: no markup or JS behaviour is assumed to change.
   =================================================================== */

:root{
    --tbl-head-bg:#eef2f8;        /* column-titles row */
    --tbl-filter-bg:#f6f8fc;      /* search / filter row */
    --tbl-border:#e3e8f0;
    --tbl-ink:#3a4558;
    --tbl-ink-soft:#6b7690;
    --tbl-row-alt:#f8fafc;
    --tbl-row-hover:#eef3fb;
}

/* ---------- table shell: one rounded, bordered card ---------- */
#msh-view-table{
    border:1px solid var(--tbl-border);
    border-radius:var(--ui-radius,8px);
    overflow:hidden;
}
table.mshresponse{
    margin-bottom:0 !important;
}

/* ---------- header rows (filter row + column-titles row) ---------- */
/* the two <thead> wrap one <tr> each: first = filter/search, second = titles.
   their background comes from an inline style on the <tr>; the <th> itself
   has no background, so painting the <th> here is enough to replace it. */
table.mshresponse > thead:first-of-type > tr > th{
    background-color:var(--tbl-filter-bg);
    border-bottom:1px solid var(--tbl-border);
    padding:8px 10px;
    vertical-align:middle;
}
table.mshresponse > thead:last-of-type > tr > th{
    background-color:var(--tbl-head-bg);
    border-bottom:2px solid #d7dfec;
    color:var(--tbl-ink);
    font-weight:700;
    font-size:.8rem;
    letter-spacing:.02em;
    vertical-align:middle;
}
table.mshresponse > thead th{
    box-sizing:border-box;
}
/* the two header rows read as one connected block, not two separate bars */
table.mshresponse > thead:first-of-type > tr > th{border-top:none;}

/* filter-row controls: a touch more breathing room, same radius as the rest of the UI */
table.mshresponse > thead:first-of-type .form-control,
table.mshresponse > thead:first-of-type select{
    border-color:var(--tbl-border);
}
/* the ID search box ("1,2,3..") reads as a short code field, not a stray sliver */
table.mshresponse > thead:first-of-type th[tdtile="ID"] .form-control{
    min-width:54px;
}

/* Totals can wrap naturally when space is limited. */
table.mshresponse .sum-head,
table.mshresponse .tot-head{
    white-space:normal;
}
/* Preserve the totals' original appearance while sizing each pill to its content. */
table thead .btn:has(> .sum-head),
table thead .btn:has(> .tot-head),
table.mshresponse > thead > tr > th .btn:has(> .sum-head),
table.mshresponse > thead > tr > th .btn:has(> .tot-head){
    width:auto !important;
    max-width:100%;
    white-space:normal;
    padding:2px 6px !important;
    font-size:.68rem !important;
}
table.mshresponse > thead th:has(.sum-head),
table.mshresponse > thead th:has(.tot-head){
    min-width:0;
}
@media (min-width:992px){
    table.mshresponse > thead > tr > th:has(.sum-head),
    table.mshresponse > thead > tr > th:has(.tot-head){
        width:auto !important;
    }
}
/* the Store column (store logo + name + phone) is given a narrow percentage width by the
   template; under table-layout:fixed that is sometimes too little room for them to share
   without the phone chip spilling out of its card. Set directly on the first <thead> row,
   since fixed layout takes every column's width from it. Desktop/tablet only: on phones this
   table switches to a one-column-per-line card layout (ui-enhance.css) that already gives the
   row the full width, and the fixed px value would fight that instead of helping.
   992px, not 769px: the table only actually switches to that one-column card layout at 991px
   (dashboard.css's own breakpoint, matched in ui-enhance.css) - between 769 and 991px this fixed
   190px still applied on top of the already-stacked mobile row, pinning the Store filter/column
   to a narrow strip instead of letting it take the full row width like every other field. */
@media (min-width:992px){
    table.mshresponse > thead:first-of-type > tr > th[tdtile="Store"]{
        width:190px !important;
    }
}
@media (min-width:992px){
    table.mshresponse > thead:first-of-type th .btn:has(> .sum-head),
    table.mshresponse > thead:first-of-type th .btn:has(> .tot-head){
        overflow:visible;
    }
}

/* ---------- body rows: comfortable, evenly spaced, clearly separated ---------- */
table.mshresponse > tbody > tr > td{
    border-bottom:1px solid var(--tbl-border);
    border-top:none;
}
table.mshresponse.table-striped > tbody > tr:nth-of-type(odd) > td{
    background-color:var(--tbl-row-alt);
}
table.mshresponse.table-hover > tbody > tr:hover > td{
    background-color:var(--tbl-row-hover);
}
table.mshresponse > tbody > tr:last-child > td{border-bottom:none;}

/* checkbox column: centred, same optical weight on every row */
table.mshresponse td.mntbl-chk,
table.mshresponse th.mntbl-chk{
    vertical-align:middle;
}

/* ---------- package / store info cells: one tidy card instead of loose lines ---------- */
table.mshresponse .bg-packages{
    background:#fbfcfe;
    border:1px solid var(--tbl-border);
    border-radius:calc(var(--ui-radius,8px) - 2px);
}
table.mshresponse td[tdtile="Store"] > .widget-content{
    background:#fbfcfe;
    border:1px solid var(--tbl-border);
    border-radius:calc(var(--ui-radius,8px) - 2px);
    padding:8px !important; /* the template marks this block ".p-0" (Bootstrap's !important utility),
                                which was cancelling the padding and leaving the icon/text/chips
                                flush against the card border */
}
table.mshresponse td[tdtile="Store"] .widget-content-wrapper{
    gap:10px;
}
/* acn_packages Store card only: the phone chip used to share a narrow column with the icon
   (squeezed beside it), which is what kept truncating it with an ellipsis. Re-lay the row as a
   small grid instead - icon+name on the first line, the phone chip dropped onto its own full-
   width line below the icon, where it finally has the whole card's width to itself. No markup
   change: the same elements are simply placed into named grid areas. */
table.mshresponse td[tdtile="Store"] > .widget-content > .widget-content-wrapper{
    display:grid;
    grid-template-columns:auto 1fr;
    column-gap:10px;
    row-gap:4px;
    grid-template-areas:
        "icon name"
        "phone phone";
}
table.mshresponse td[tdtile="Store"] > .widget-content > .widget-content-wrapper > .widget-content-left.mr-2{
    grid-area:icon;
}
table.mshresponse td[tdtile="Store"] > .widget-content > .widget-content-wrapper > .flex2{
    display:contents;
}
table.mshresponse td[tdtile="Store"] > .widget-content > .widget-content-wrapper > .flex2 > .widget-heading{
    grid-area:name;
    align-self:center;
}
table.mshresponse td[tdtile="Store"] > .widget-content > .widget-content-wrapper > .flex2 > .widget-subheading{
    grid-area:phone;
    margin-top:0;
}
/* the phone chip in this box only: smaller, now that it has its own full-width line it no
   longer needs to compete with the store name for room. */
table.mshresponse td[tdtile="Store"] .widget-content-wrapper .btn.btn-dashed.btn-icon[href^="tel:"]{
    font-size:.6rem;
}
/* acc_stores/acc_drivers "Pending" table: the heading packs id + name + city + date on one
   line ("(2) Store Name (City) - (date)"), which used to wrap wherever it ran out of room -
   including straight through the date's own parentheses. Give the name real emphasis, mute the
   id/date as secondary detail, and keep the date's "(...)" from splitting across lines. */
table.mshresponse td[tdtile="Store"] .strAccName{
    font-weight:700;
    color:var(--ui-primary,#3f6ad8);
}
table.mshresponse td[tdtile="Store"] .widget-heading{
    line-height:1.5;
}
table.mshresponse td[tdtile="Store"] .widget-heading > span:first-child{
    color:var(--tbl-ink-soft);
    font-weight:400;
}
table.mshresponse td[tdtile="Store"] .widget-heading .cdate{
    white-space:nowrap;
}
table.mshresponse td[tdtile="Store"] .widget-heading > span:last-child{
    display:inline-block;
    white-space:nowrap;
}
/* the two phone chips (tel1/tel2) sit in a ".widget-subheading" nested inside the heading; on
   full desktop width they were wrapping onto their own line each. Force them onto one row,
   sharing the width and truncating their own text (ellipsis) instead of wrapping. */
table.mshresponse td[tdtile="Store"] .widget-heading .widget-subheading{
    display:flex !important; /* the template sets "display:block" inline on this element */
    flex-wrap:nowrap;
    gap:6px;
    align-items:center;
    margin-top:2px;
}
table.mshresponse td[tdtile="Store"] .widget-heading .widget-subheading .btn.btn-dashed.btn-icon{
    flex:1 1 0;
    min-width:0;
}

/* "Added by: <name>" line under the divider: one size down, it was competing with the store
   name above it instead of reading as a secondary note. */
table.mshresponse td[tdtile="Store"] > .widget-content > .widget-subheading{
    font-size:.58rem;
}
/* the name/phone text column (".flex2") is a flex item with no min-width of its own, so by default
   it refuses to shrink below its content's natural size - the phone chip inside it was overflowing
   straight through the card's right edge instead of truncating or wrapping onto its own line. */
table.mshresponse .widget-content-wrapper > .flex2{
    min-width:0;
}
/* several templates set align-items:unset inline on this wrapper (i.e. "stretch"): the logo's
   column stretched to match the text column's height and the logo stayed pinned to its top,
   leaving a dead gap underneath it. Centring it reads right everywhere this pattern is used. */
table.mshresponse .widget-content-wrapper[style*="align-items:unset"]{
    align-items:center !important;
}
/* acc_stores "Pending" table (tbody.tbodyAcc): store name read a touch large next to the rest
   of the row - one size down, same as the Package/Store cards elsewhere. The phone chip itself
   is already unified app-wide in ui-enhance.css, so it needs no extra rule here. */
.tbodyAcc .widget-heading{font-size:.8rem;}
.tbodyAcc .widget-heading .cdate{font-size:.95em;}
/* logo / icon thumbnails (store, company, ...): breathing room between the icon and its frame
   instead of the icon sitting flush against the border (object-fit:contain shrinks to fit the
   padded box, so nothing gets cropped) - round profile photos (driver avatar) are left alone */
table.mshresponse img[height]:not(.rounded-circle){
    border:1px solid var(--tbl-border);
    border-radius:6px;
    padding:5px;
    box-sizing:border-box;
    background:#fff;
}
/* the logo sits two levels deep inside the flex row (wrapper > widget-content-left > img);
   the WRAPPER is the actual flex item, and without a fixed basis it was being squeezed down
   to a sliver whenever the name/phone text next to it ran out of room */
table.mshresponse .widget-content-wrapper > .widget-content-left:first-child:has(img){
    flex:0 0 auto;
}
/* small leading icons (city, store type, ...) inside the card text: legible, not a grey smudge */
table.mshresponse .bg-packages .widget-subheading > i,
table.mshresponse td[tdtile="Store"] .widget-subheading > i{
    color:var(--tbl-ink-soft);
    margin-inline-end:4px;
}
table.mshresponse td[tdtile="Store"] .widget-heading{
    font-weight:700;
    color:var(--tbl-ink);
}

/* acc_stores / acc_drivers "Pending" table (tbody.tbodyAcc): the Store column carries no
   explicit width, and the other columns' fixed pixel widths squeezed it down to almost
   nothing - its header text ("Store") was wrapping one letter per line. table-layout:auto
   fixed that, but then let the Progress column's bar balloon to take the freed space instead
   (auto layout only treats a column's own width as a loose hint, not a hard share of the
   row - the Store/Progress columns ended up the same width regardless of what each asked for).
   table-layout:fixed is more literal: every column gets exactly the width given on the FIRST
   header row, and the table scrolls horizontally inside .table-responsive if that totals more
   than the card - which is exactly what we want here (Store wide, Progress narrow). */
table:has(> tbody.tbodyAcc){table-layout:fixed !important;}
/* desktop only (>=992px, matching the table's own card-layout breakpoint elsewhere): below that the
   table is already stacked into one-column-per-row cards, where each cell is meant to take the full
   row width (ui-enhance.css) - these fixed nth-child pixel widths, same as table-layout:fixed itself
   was written for, otherwise pinned the "Search" header cell (and its data column) to a narrow 260px/
   110px strip regardless of how wide the actual row around it was. */
@media (min-width:992px){
    table:has(> tbody.tbodyAcc) > thead:first-of-type > tr > th:nth-child(2){
        width:260px !important;
    }
    table:has(> tbody.tbodyAcc) > thead:first-of-type > tr > th:nth-child(3){
        width:110px !important;
    }
    table:has(> tbody.tbodyAcc) > tbody.tbodyAcc > tr > td:nth-child(2){
        width:260px;
    }
    table:has(> tbody.tbodyAcc) > tbody.tbodyAcc > tr > td:nth-child(3){
        width:110px;
    }
}

/* ---------- status / qty / amount cells: centred and consistent ---------- */
table.mshresponse td[tdtile="Status"],
table.mshresponse td:is([tdtile="Qtty"],[tdtile="Qty"]),
table.mshresponse td:is([tdtile="D. Date"],[tdtile="Del. date"],[tdtile="Date"]){
    text-align:center;
}
table.mshresponse td[tdtile="Amount"] b{
    font-size:1.02em;
}

/* ---------- footer bar: pager + item count, visually part of the same card ---------- */
.view-pages{
    display:flex !important;
    flex-wrap:wrap;
    align-items:center;
    justify-content:space-between;
    gap:8px 16px;
    padding:10px 12px;
    margin:0 !important;
    border-top:1px solid var(--tbl-border);
    background:#fbfcfe;
    border-bottom-left-radius:var(--ui-radius,8px);
    border-bottom-right-radius:var(--ui-radius,8px);
}
.view-pages .dataTables_info{
    color:var(--tbl-ink-soft);
    font-weight:500;
}
.view-pages .pagination{
    margin:0 !important;
    gap:4px;
}
.view-pages .pagination .page-link{
    border-radius:var(--ui-radius,8px) !important;
    border-color:var(--tbl-border);
    color:var(--tbl-ink);
}
.view-pages .pagination .page-item.active .page-link{
    background-color:var(--ui-primary,#3f6ad8);
    border-color:var(--ui-primary,#3f6ad8);
    color:#fff !important;
    font-weight:700;
}

/* ---------- plain report summary tables (reports/*, e.g. "Posted > Stores / Drivers"):
   a bare <table>, no Bootstrap classes - same header tone and row rhythm as the rest ---------- */
.rp-wrap table{
    width:100%;
    border-collapse:separate;
    border-spacing:0;
    font-size:.78rem;
}
.rp-wrap table thead th{
    background-color:var(--tbl-head-bg);
    border-bottom:2px solid #d7dfec;
    padding:9px 10px;
    color:var(--tbl-ink);
    font-weight:700;
    font-size:.72rem;
    text-align:start;
    white-space:nowrap;
}
.rp-wrap table thead th.n{text-align:center;}
.rp-wrap table tbody td,
.rp-wrap table tfoot td{
    padding:8px 10px;
    border-bottom:1px solid var(--tbl-border);
}
.rp-wrap table tbody td.n,
.rp-wrap table tfoot td.n{text-align:center;}
.rp-wrap table tbody tr:nth-of-type(odd) td{background-color:var(--tbl-row-alt);}
.rp-wrap table tbody tr:hover td{background-color:var(--tbl-row-hover);}
.rp-wrap table tfoot td{
    font-weight:700;
    border-bottom:none;
    background-color:var(--tbl-head-bg);
}
.rp-wrap{
    border:1px solid var(--tbl-border);
    border-radius:var(--ui-radius,8px);
    overflow:hidden;
    box-shadow:var(--ui-shadow);margin-top:4px;
}
/* a little more visual hierarchy: the identity column (Store / Driver - the one column that
   isn't "#" and isn't a number) reads as the row's title, and the right-most figure (the
   running balance) as its headline number, the same way the stat cards above this table do. */
.rp-wrap table thead th:not(.n):not(:first-child){
    color:var(--ui-primary,#3f6ad8);
}
.rp-wrap table tbody td:not(.n):not(:first-child){
    color:var(--tbl-ink);
}
.rp-wrap table tbody td:last-child,
.rp-wrap table tfoot td:last-child{
    font-size:1.05em;
    color:var(--ui-primary,#3f6ad8);
}
.rp-wrap table tfoot td:first-child{
    color:var(--tbl-ink);
}

/* ---------- small / tablet screens: same card, no sideways scroll surprises ---------- */
@media (max-width:991.98px){
    table.mshresponse > tbody > tr > td{padding:10px 8px;}
}
@media (max-width:991.98px){
    /* on phones (and tablets - the table already stacks into cards by 991px, see dashboard.css/
       ui-enhance.css) the header cells switch to a one-control-per-line flex layout; they still get
       the same two-tone background and spacing here */
    table.mshresponse > thead:first-of-type > tr > th{padding:6px 8px;}
    table.mshresponse > thead:last-of-type{display:none;} /* column-title row is redundant once each phone row shows its own tdtile label */
    table.mshresponse > tbody > tr > td{padding:10px;}
    .view-pages{padding:10px;justify-content:center;text-align:center;}
}

/* Package lists: reserve useful space for compact columns and give details the remainder.
   Colgroups keep filters, headings and data aligned independently of the current page's data. */
@media (min-width:992px){
    #msh-view-table:has(> table.package-columns){overflow-x:auto;}
    table.mshresponse.package-columns{table-layout:fixed;width:100%;min-width:0;max-width:100%;}
    table.mshresponse.package-columns > thead > tr > th,
    table.mshresponse.package-columns > tbody > tr > td{
        width:auto !important;min-width:0;vertical-align:middle;padding:8px 6px;
    }
    table.mshresponse.package-columns .form-control{width:100%;min-width:0;max-width:100%;}
    table.mshresponse.package-columns .bg-packages,
    table.mshresponse.package-columns .col-description,
    table.mshresponse.package-columns .flex2{min-width:0;max-width:100%;}
    table.mshresponse.package-columns .widget-heading,
    table.mshresponse.package-columns .widget-subheading{
        white-space:normal;overflow-wrap:anywhere;
    }
    table.mshresponse.package-columns .widget-content-wrapper:has(img){
        display:flex;flex-wrap:wrap;gap:6px;
    }
    table.mshresponse.package-columns .dv-expulsion-status{max-width:100%;white-space:normal;}
    table.mshresponse.package-columns .btnfinish{width:auto !important;max-width:100%;margin:0 !important;}
    table.mshresponse.package-columns td > b{display:block;overflow-wrap:anywhere;}
    table.mshresponse.package-columns hr.small{margin:6px 0;}
    table.mshresponse.package-columns td:has(> b),
    table.mshresponse.package-columns td:has(> .tdqtty){font-variant-numeric:tabular-nums;}
}
@media (max-width:991.98px){
    table.package-columns > .package-colgroup{display:none;}
}
/* Store/driver Pending accounting: consistent numeric columns and bounded detail cards. */
table.pending-account-columns .widget-content,
table.pending-account-columns .widget-content-wrapper,
table.pending-account-columns .flex2{min-width:0;max-width:100%;}
table.pending-account-columns .widget-heading,
table.pending-account-columns .widget-subheading{white-space:normal;overflow-wrap:anywhere;}
table.pending-account-columns td > b{font-variant-numeric:tabular-nums;}
table.pending-account-columns .widget-subheading:has(> a[href^="tel:"]){
    display:flex !important;flex-wrap:wrap;gap:4px;
}
@media (max-width:991.98px){
    #msh-view-table:has(> table.pending-account-columns){overflow:visible;}
    table.pending-account-columns{display:block;width:100%;min-width:0;max-width:100%;}
    table.pending-account-columns > thead:first-of-type,
    table.pending-account-columns > thead:first-of-type > tr{
        display:block !important;width:100% !important;box-sizing:border-box;
    }
    table.pending-account-columns > thead:first-of-type > tr > th{
        width:100% !important;max-width:100%;box-sizing:border-box;
    }
    table.pending-account-columns > tbody{display:block;width:100%;}
    table.pending-account-columns > tbody > tr{
        width:100%;max-width:100%;margin:10px 0;box-sizing:border-box;
        border:1px solid var(--tbl-border);border-radius:8px;overflow:hidden;
    }
    table.pending-account-columns > tbody > tr > td{
        box-sizing:border-box;max-width:100%;overflow-wrap:anywhere;padding:8px 10px;
    }
    table.pending-account-columns > tbody > tr > td[tdtile]:before{
        color:var(--tbl-ink-soft);font-weight:600;
    }
}

/* Posted-order summaries share tbodyStat across every pst_* screen. On mobile the
   fixed-height scroll box and sticky totals must become normal flowing cards together. */
@media (max-width:991.98px){
    .table-responsive:has(table > .tbodyStat){overflow:visible;}
    table.scrlbody.mshresponse:has(> .tbodyStat){
        display:block;width:100%;min-width:0;max-width:100%;
        height:auto !important;max-height:none !important;overflow:visible !important;
    }
    table.scrlbody.mshresponse:has(> .tbodyStat) > thead{display:none !important;}
    table.scrlbody.mshresponse > .tbodyStat{
        display:block;width:100%;max-height:none;overflow:visible;
    }
    table.scrlbody.mshresponse:has(> .tbodyStat) > .tfootStat{
        position:static;top:auto;bottom:auto;z-index:auto;
        width:100%;max-height:none;line-height:1.5;
    }
    table.scrlbody.mshresponse > .tbodyStat > tr,
    table.scrlbody.mshresponse > .tfootStat > tr{
        display:block !important;width:100%;max-width:100%;box-sizing:border-box;
        margin:10px 0;border:1px solid var(--tbl-border);border-radius:8px;
        overflow:hidden;line-height:1.5;table-layout:auto;
    }
    table.scrlbody.mshresponse > .tbodyStat > tr > td,
    table.scrlbody.mshresponse > .tfootStat > tr > th{
        display:block !important;width:100% !important;max-width:100%;box-sizing:border-box;
        padding:8px 10px;line-height:1.5;white-space:normal;overflow-wrap:anywhere;
        text-align:start !important;
    }
    .card-header:has(+ .table-responsive .tbodyStat){
        height:auto;min-height:0;flex-wrap:wrap;gap:8px;
    }
}

/* Admin account cards must stay inside their table width. A block table border and
   full-width rows plus side margins otherwise draw a continuous line through the cards. */
@media (max-width:991.98px){
    .tblMainAcc table.mshresponse{
        display:block;width:100%;max-width:100%;min-width:0;
        border:0 !important;box-sizing:border-box;
    }
    .tblMainAcc table.mshresponse > tbody{display:block;width:100%;}
    .tblMainAcc table.mshresponse > tbody > tr,
    .tblMainAcc table.mshresponse > tfoot > tr{
        display:block !important;width:100%;max-width:100%;box-sizing:border-box;
        margin:10px 0;border:1px solid var(--tbl-border);border-radius:8px;
        overflow:hidden;line-height:1.4;
    }
    .tblMainAcc table.mshresponse > tbody > tr > td,
    .tblMainAcc table.mshresponse > tfoot > tr > th{
        box-sizing:border-box;max-width:100%;border-left:0;border-right:0;
        line-height:1.4;overflow-wrap:anywhere;
    }
    .tblMainAcc table.mshresponse > tfoot{position:static;bottom:auto;z-index:auto;}
}

/* Employee posted packages: explicit balanced shares for every column. Both numeric
   headers override the shared totals auto-width rule so Quantity cannot collapse. */
@media (min-width:992px){
    table.mshresponse.pstEmpDtls > thead > tr > th:nth-child(1){width:6% !important;}
    table.mshresponse.pstEmpDtls > thead > tr > th:nth-child(2){width:36% !important;}
    table.mshresponse.pstEmpDtls > thead > tr > th:nth-child(3){width:15% !important;}
    table.mshresponse.pstEmpDtls > thead > tr > th:nth-child(4){width:17% !important;}
    table.mshresponse.pstEmpDtls > thead > tr > th:nth-child(5){width:10% !important;}
    table.mshresponse.pstEmpDtls > thead > tr > th:nth-child(6){width:16% !important;}
}

/* Only the upper Pending summaries in acc_stores / acc_drivers / acc_employees.
   Search lives outside the table so empty filter columns cannot distort its header. */
.tblMainAcc .admin-pending-search{display:flex;align-items:center;gap:10px;margin-bottom:12px;}
.tblMainAcc .admin-pending-search label{margin:0;font-weight:600;}
.tblMainAcc .admin-pending-search input{flex:1;min-width:0;max-width:420px;height:34px !important;}
.tblMainAcc table.admin-pending-table{width:100%;max-width:100%;min-width:0;table-layout:fixed !important;}
.tblMainAcc table.admin-pending-table > thead > tr > th{
    width:auto !important;min-width:0;padding:10px 6px;line-height:1.35;
    background:var(--tbl-head-bg);border-bottom:2px solid var(--tbl-border);
}
.tblMainAcc table.admin-pending-table > tbody > tr > td{
    width:auto !important;padding:10px 6px;line-height:1.4;vertical-align:middle;
    overflow-wrap:anywhere;font-variant-numeric:tabular-nums;
}
.tblMainAcc table.admin-pending-table .flex2{min-width:0;}
.tblMainAcc table.admin-pending-table .widget-content-wrapper{min-width:0;flex-wrap:wrap;gap:6px;}
.tblMainAcc table.admin-pending-table .widget-heading{white-space:normal;overflow-wrap:anywhere;}
.tblMainAcc table.admin-pending-table .widget-subheading{display:flex !important;flex-wrap:wrap;gap:4px;}
.tblMainAcc table.admin-pending-table .btnQuittance{max-width:100%;white-space:normal;}
@media (max-width:991.98px){
    .tblMainAcc:has(table.admin-pending-table){overflow:visible;}
    .tblMainAcc:has(table.admin-pending-table) > .card-body{padding:8px;min-width:0;}
    .tblMainAcc table.admin-pending-table{display:block;table-layout:auto !important;}
    .tblMainAcc table.admin-pending-table > colgroup,
    .tblMainAcc table.admin-pending-table > thead{display:none !important;}
    .tblMainAcc table.admin-pending-table > tbody{display:block;width:100%;}
    .tblMainAcc table.admin-pending-table > tbody > tr{
        display:block !important;width:100%;margin:10px 0;box-sizing:border-box;
        border:1px solid var(--tbl-border);border-radius:8px;overflow:hidden;
    }
    .tblMainAcc table.admin-pending-table > tbody > tr > td{
        display:block !important;width:100% !important;max-width:100%;box-sizing:border-box;
        padding:8px 10px;text-align:start !important;
    }
    .tblMainAcc table.admin-pending-table > tbody > tr > td[tdtile]:before{
        display:inline-block;content:attr(tdtile) ' :';font-weight:600;margin-inline-end:6px;
    }
}

/* Local search belongs only to the admin store/driver account-statement summary. */
.tblMainAcc .balance-local-filter{margin-bottom:12px;}
.tblMainAcc .balance-filter-row{display:flex;align-items:center;flex-wrap:wrap;gap:10px;}
.tblMainAcc .balance-filter-row .balance-local-search{flex:1 1 220px;min-width:0;width:auto;}
.tblMainAcc .balance-filter-row .balance-type-filter{flex:0 1 210px;min-width:160px;width:210px;}
@media(max-width:575px){.tblMainAcc .balance-filter-row .balance-type-filter{flex:1 1 100%;width:100%;}}
.tblMainAcc .balance-local-search{width:100%;max-width:420px;}
.tblMainAcc table.mshresponse > tbody.tbodyBalance > tr.balance-search-hidden{display:none !important;}

/* ---------- RTL: header borders / radii follow reading direction automatically
   (logical properties above already do this); only the card corners need a mirror check ---------- */
[dir="rtl"] #msh-view-table{
    border-radius:var(--ui-radius,8px);
}

/* Rounded accounting/payroll tables; preserve existing mobile card layout and scroll containers. */
@media(min-width:992px){
 table.mshresponse.accounting-rounded-table{border-collapse:separate;border-spacing:0;border:1px solid var(--tbl-border);border-radius:var(--ui-radius,8px);background:#fff;}
 table.mshresponse.accounting-rounded-table > :is(thead,tbody,tfoot) > tr > :is(th,td){border:0;border-bottom:1px solid var(--tbl-border);background-clip:padding-box;}
 table.mshresponse.accounting-rounded-table > thead:first-of-type > tr:first-child > :first-child{border-start-start-radius:var(--ui-radius,8px);}
 table.mshresponse.accounting-rounded-table > thead:first-of-type > tr:first-child > :last-child{border-start-end-radius:var(--ui-radius,8px);}
 table.mshresponse.accounting-rounded-table > :last-child > tr:last-child > :is(th,td){border-bottom:0;}
 table.mshresponse.accounting-rounded-table > :last-child > tr:last-child > :first-child{border-end-start-radius:var(--ui-radius,8px);}
 table.mshresponse.accounting-rounded-table > :last-child > tr:last-child > :last-child{border-end-end-radius:var(--ui-radius,8px);}
 table.mshresponse.accounting-rounded-table > tbody > tr:nth-child(even) > td{background-color:var(--tbl-row-alt);}
 table.mshresponse.accounting-rounded-table > tbody > tr:hover > td{background-color:var(--tbl-row-hover);}
}

/* A narrow desktop viewport must scroll its package table, never split amounts into letters. */
@media(min-width:992px){
 #msh-view-table:has(> table.package-columns){max-width:100%;overflow-x:auto;}
 table.mshresponse.package-columns{min-width:1080px;}
 table.mshresponse.package-columns td > b,
 table.mshresponse.package-columns td > b > sup,
 table.mshresponse.package-columns td > .tdqtty{white-space:nowrap;overflow-wrap:normal;word-break:normal;}
}

@media (min-width:992px){
 #msh-view-table:has(> table.admin-package-list){max-width:100%;overflow-x:auto;}
 table.mshresponse.admin-package-list{min-width:1080px;}
 table.admin-package-list td:has(> b),table.admin-package-list td > b,table.admin-package-list td > b > sup{white-space:nowrap;overflow-wrap:normal;word-break:normal;}
}
