/* UI enhancements - loaded after the base stylesheets, purely visual (no layout changes) */
:root{
    --ui-primary:#3f6ad8;
    --ui-radius:8px;
    --ui-shadow:0 2px 10px rgba(0,0,0,.08);
    --ui-shadow-hover:0 6px 18px rgba(0,0,0,.14);
    --ui-transition:.18s ease;
}
html{-webkit-text-size-adjust:100%;}
body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;}

/* Links & focus (keyboard accessibility) */
a{transition:color var(--ui-transition);}
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,.btn:focus-visible{
    outline:2px solid var(--ui-primary);outline-offset:2px;
}

/* ===== Buttons =====
   hierarchy: primary/success (solid) > outline (secondary) > soft chips (links inside rows) */
:root{
    --btn-ink:#3a4558;
    --btn-line:#cfd6e4;
    --btn-soft:#f2f5fb;
}
.btn{
    border-radius:var(--ui-radius);
    font-size:.74rem;
    font-weight:500;
    letter-spacing:.01em;
    vertical-align:middle;
    transition:box-shadow var(--ui-transition),transform var(--ui-transition),background-color var(--ui-transition),border-color var(--ui-transition),color var(--ui-transition),filter var(--ui-transition);
}
.btn:hover:not(:disabled):not(.disabled){box-shadow:var(--ui-shadow);transform:translateY(-1px);}
.btn:active:not(:disabled):not(.disabled){transform:translateY(0);box-shadow:none;filter:brightness(.96);}
.btn:disabled,.btn.disabled{cursor:not-allowed;opacity:.55;box-shadow:none !important;transform:none !important;}

/* secondary: calm outline (Refresh, Print, ...) instead of heavy black borders */
:is(button,a).btn-outline-dark{
    color:var(--btn-ink);
    background-color:#fff;
    border-color:var(--btn-line);
}
:is(button,a).btn-outline-dark:hover:not(:disabled):not(.disabled),
:is(button,a).btn-outline-dark:focus:not(:disabled):not(.disabled){
    color:#1f2a3d;
    background-color:var(--btn-soft);
    border-color:#aab6cc;
}
:is(button,a).btn-outline-dark:active:not(:disabled):not(.disabled),
:is(button,a).btn-outline-dark.active{
    color:#1f2a3d;
    background-color:#e6ecf6;
    border-color:#aab6cc;
}

/* primary / success: solid with a little depth */
.btn-primary,.btn-success{
    box-shadow:0 1px 2px rgba(20,40,90,.18);
}
.btn-primary:hover:not(:disabled):not(.disabled),
.btn-success:hover:not(:disabled):not(.disabled){
    filter:brightness(1.06);
    box-shadow:0 6px 14px -4px rgba(20,40,90,.35);
}

/* destructive actions read as danger */
.btn-outline-danger:hover:not(:disabled):not(.disabled){color:#fff;background-color:#d92550;border-color:#d92550;}

/* the driver's main action: Finish */
.btnfinish{
    color:#fff !important;
    background-color:#2db36b !important;
    border-color:#2db36b !important;
    box-shadow:0 2px 6px -1px rgba(45,179,107,.55) !important;
}
.btnfinish:hover:not(:disabled):not(.disabled){background-color:#26a05f !important;border-color:#26a05f !important;}

/* ===== table toolbar (Bills / Statement / Refresh / Print / Remove / Add) =====
   one tidy segmented group: same height, same padding, no heavy shadows, no gaps */
.btn-actions-pane-right{
    display:inline-flex;
    flex-wrap:wrap;
    align-items:center;
    gap:8px 10px;
}
/* date range (From / To) that sits in the same toolbar: same height as the buttons, clear spacing */
.btn-actions-pane-right .print-title-sub2{
    display:inline-flex !important;
    align-items:center;
    flex-wrap:wrap;
    gap:8px 14px;
}
.btn-actions-pane-right .form-group{
    display:inline-flex !important;
    align-items:center;
    gap:6px;
    margin:0 !important;
    font-size:.85rem !important;
}
.btn-actions-pane-right .form-group label{margin:0;white-space:nowrap;}
.btn-actions-pane-right .form-control{
    height:34px !important;
    width:auto !important;
    min-width:140px;
    padding:0 10px;
    font-size:.85rem !important;
}
.btn-actions-pane-right > .btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    height:34px;
    padding:0 14px !important;
    margin:0 !important; /* some screens put an inline margin on the first button (Send) that split it from the group */
    font-size:.76rem;
    line-height:1;
    white-space:nowrap;
    box-shadow:none !important;
}
.btn-actions-pane-right > .btn:hover:not(:disabled){
    transform:none;
    position:relative;
    z-index:1;
    box-shadow:0 2px 8px -2px rgba(20,40,90,.28) !important;
}
.btn-actions-pane-right > .btn i{margin:0;}
/* danger: calm outline that fills on hover */
.btn-actions-pane-right > .btn-outline-danger{color:#d92550;background:#fff;border-color:#efb5c4;}
.btn-actions-pane-right > .btn-outline-danger:hover:not(:disabled){color:#fff;background:#d92550;border-color:#d92550;}
/* the main action (Add) is solid */
.btn-actions-pane-right > .btnadd,
.btn-actions-pane-right > .btn-outline-info.btnadd{color:#fff;background:#3f6ad8;border-color:#3f6ad8;}
.btn-actions-pane-right > .btnadd:hover:not(:disabled){color:#fff;background:#3359bd;border-color:#3359bd;}
@media (min-width:769px){
    .btn-actions-pane-right{flex-wrap:nowrap;}
    /* neighbouring buttons join into one group (the toolbar gap is 10px, so pull back 10px + 1px border) */
    .btn-actions-pane-right > .btn + .btn{
        margin-inline-start:-11px !important;
        border-start-start-radius:0;
        border-end-start-radius:0;
    }
    .btn-actions-pane-right > .btn:has(+ .btn){
        border-start-end-radius:0;
        border-end-end-radius:0;
    }
}

/* ===== table header row: View + date range + custom tools + buttons =====
   everything on one line, same height, even spacing, vertically centred */
.pgHeadTbl{
    display:flex !important;
    flex-wrap:wrap;
    align-items:center;
    gap:8px 12px;
}
.pgHeadTbl > div{margin:0 !important;}
.pgHeadTbl .form-group{
    display:flex !important;
    align-items:center;
    gap:6px;
    margin:0 !important;
}
.pgHeadTbl .form-group label{margin:0 !important;font-weight:600;color:#4a566b;white-space:nowrap;font-size:.8rem;}
.pgHeadTbl .form-control,
.pgHeadTbl .custom-select,
.pgHeadTbl select.form-control{
    height:34px !important;
    padding-top:0;
    padding-bottom:0;
    font-size:.8rem !important;
    border-color:var(--btn-line);
    background-color:#fff;
}
.pgHeadTbl .itms-count{width:auto !important;min-width:78px;}
/* From / To: label box + date input look like one control */
.pgHeadTbl .input-group{flex-wrap:nowrap;width:auto;}
.pgHeadTbl .input-group-prepend{flex:0 0 auto;align-self:stretch;}
/* label box always as tall as its input (whatever height the input gets on desktop / phone) */
.pgHeadTbl .input-group-text,
.pgHeadTbl .input-group-text.txtdfdto{height:auto !important;align-self:stretch;}
.pgHeadTbl .input-group-text.txtdfdto{
    display:flex;
    align-items:center;
    justify-content:center;
    width:auto;
    min-width:54px;
    line-height:1;
    font-size:.8rem;
}
.pgHeadTbl .input-group-text{
    white-space:nowrap;
    height:34px;
    padding:0 12px;
    font-size:.8rem;
    font-weight:600;
    color:#4a566b;
    background:#f1f5fb;
    border-color:var(--btn-line);
    border-start-start-radius:var(--ui-radius);
    border-end-start-radius:var(--ui-radius);
}
.pgHeadTbl .input-group > .form-control{
    width:auto !important;
    min-width:150px;
    border-start-end-radius:var(--ui-radius);
    border-end-end-radius:var(--ui-radius);
}
.pgHeadTbl .btn-actions-pane-left{display:flex;align-items:center;gap:8px;}
.pgHeadTbl > .btn-actions-pane-left:not(:has(*)){display:none;}
/* tools stay on the start side, the buttons go to the opposite edge (follows LTR/RTL automatically) */
.pgHeadTbl > .btn-actions-pane-right{margin-inline-start:auto !important;}
.pgHeadTbl .btn-actions-pane-left .btn,
.pgHeadTbl .btn-actions-pane-left .form-control{height:34px;}
/* ===== table header row on phones: one control per line, equal widths, buttons share the row ===== */
@media (max-width:768px){
    .pgHeadTbl{flex-direction:row;gap:8px;}
    .pgHeadTbl > div:not(.btn-actions-pane-left):not(.btn-actions-pane-right){flex:1 1 100%;min-width:0;}
    .pgHeadTbl .form-group{width:100%;}
    .pgHeadTbl .itms-count{flex:1 1 auto;width:100% !important;}
    .pgHeadTbl .input-group{width:100%;}
    .pgHeadTbl .input-group-text.txtdfdto{min-width:68px;}
    .pgHeadTbl .input-group > .form-control{flex:1 1 auto;min-width:0;}
    .pgHeadTbl > .btn-actions-pane-right,
    .pgHeadTbl > .btn-actions-pane-left{flex:1 1 100%;margin-inline-start:0 !important;}
    .pgHeadTbl > .btn-actions-pane-right{display:flex;flex-wrap:wrap;gap:8px;}
    .pgHeadTbl > .btn-actions-pane-right > .btn{flex:1 1 auto;min-width:84px;height:42px;}
}
/* ===== HTML editor toolbar (msh-editor): keep its compact native buttons, none of the global button restyling ===== */
.msh-editor .btn{
    font-weight:400;
    letter-spacing:normal;
    min-height:0 !important;
    border-radius:3px;
    transition:none;
    box-shadow:none;
    filter:none;
}
.msh-editor .btn:hover:not(:disabled):not(.disabled),
.msh-editor .btn:active:not(:disabled):not(.disabled),
.msh-editor .btn:focus{
    transform:none;
    box-shadow:none;
    filter:none;
}
.msh-editor .btn:disabled,
.msh-editor .btn.disabled{opacity:1;}
.msh-editor .btn-group{vertical-align:middle;}
/* ===== modal footer: options (checkboxes) on the start side, buttons on the opposite side =====
   follows LTR / RTL automatically (logical margins) */
.modal-footer{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:flex-end;
    gap:8px;
}
.modal-footer > .btn{margin:0;}
.modal-footer > .chkprint{
    position:relative !important;     /* one template positions it absolutely */
    width:auto !important;
    margin:0 !important;
    margin-inline-end:auto !important;
    flex:1 1 auto;
    text-align:start;
}
.modal-footer > .chkprint.row{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:6px 20px;
}
.modal-footer > .chkprint [class*="col-"]{flex:0 0 auto;width:auto;max-width:none;padding:0 !important;}
.modal-footer > .chkprint .row{margin:0;}
/* checkbox + label: box on the start side in both directions */
.modal-footer .form-check{
    position:relative;
    margin:0;
    padding-left:0;
    padding-right:0;
    padding-inline-start:1.5rem;
}
.modal-footer .form-check-input{
    position:absolute;
    margin-left:0;
    margin-right:0;
    margin-inline-start:-1.5rem;
    margin-top:.35rem;
}
.modal-footer .form-check-label{margin:0;line-height:1.6;}
@media (max-width:576px){
    .modal-footer > .chkprint{flex:1 1 100%;margin-inline-end:0 !important;}
    .modal-footer > .btn{flex:1 1 auto;}
}
/* ===== assign packages screen (free packages | driver packages): header of both cards =====
   one tidy row: filters / search on the start side, arrows + driver on the other, all 34px high */
:is(.mainfreepkgs,.assignment-source-card) .card-header,
.mainpkgs .card-header{
    display:flex !important;
    align-items:center;
    flex-wrap:wrap;
    gap:8px 12px;
}
:is(.mainfreepkgs,.assignment-source-card) .btn-actions-pane-left,
.mainpkgs .btn-actions-pane-left{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:8px;
    flex:1 1 0;            /* takes the free width and wraps inside, so the arrow button stays on the first row */
    min-width:0;
    margin:0;
}
:is(.mainfreepkgs,.assignment-source-card) .btn-actions-pane-left > div,
.mainpkgs .btn-actions-pane-left > div{display:block !important;}
/* free packages: cities | stores | search share one line, the search gets a little more room */
:is(.mainfreepkgs,.assignment-source-card) .btn-actions-pane-left{flex-wrap:nowrap;}
:is(.mainfreepkgs,.assignment-source-card) .btn-actions-pane-left > div{flex:1 1 0;min-width:0;}
:is(.mainfreepkgs,.assignment-source-card) .btn-actions-pane-left > div:last-child{flex-grow:1.4;}
:is(.mainfreepkgs,.assignment-source-card) .btn-actions-pane-left .form-control{width:100% !important;min-width:0 !important;max-width:none !important;}
@media (max-width:576px){
    :is(.mainfreepkgs,.assignment-source-card) .btn-actions-pane-left{flex-wrap:wrap;}
    :is(.mainfreepkgs,.assignment-source-card) .btn-actions-pane-left > div{flex:1 1 45%;}
    :is(.mainfreepkgs,.assignment-source-card) .btn-actions-pane-left > div:last-child{flex:1 1 100%;}
}
:is(.mainfreepkgs,.assignment-source-card) .form-control,
.mainpkgs .form-control{
    height:34px !important;
    padding:0 10px !important;
    font-size:.85rem !important;
    width:auto;
}
:is(.mainfreepkgs,.assignment-source-card) select.form-control{min-width:120px;max-width:180px;}
:is(.mainfreepkgs,.assignment-source-card) .srchAssign,
.mainpkgs .srchDeAssign{min-width:170px !important;}
/* scoped to .card-header specifically (not a bare ":is(.mainfreepkgs,.assignment-source-card) .btn"/".mainpkgs .btn"): those two
   containers also wrap each package's whole list body below the header, including small inline buttons
   like the tel: phone badge (padding:1px 5px, no fixed height, set inline in the markup) - the old
   unscoped rule forced ITS OWN height/padding onto those too, stretching them into the toolbar's own
   34px pill style and leaving odd empty space around the number. */
:is(.mainfreepkgs,.assignment-source-card) .card-header .btn,
.mainpkgs .card-header .btn{
    height:34px;
    min-width:42px;
    padding:0 14px !important;
    margin:0 !important;
    display:inline-flex;
    align-items:center;
    justify-content:center;
}
:is(.mainfreepkgs,.assignment-source-card) .btn-actions-pane-right,
.mainpkgs .btn-actions-pane-right{
    display:flex;
    align-items:center;
    gap:10px;
    margin-inline-start:auto;
    flex:0 0 auto;
}
.mainpkgs .btn-actions-pane-right .widget-heading{
    padding:0 !important;
    margin:0;
    font-size:.95rem;
    font-weight:600;
    white-space:nowrap;
}
.mainpkgs .btn-actions-pane-right img{
    width:34px;
    height:34px;
    object-fit:cover;
    flex:0 0 auto;
}
/* soft "chips": call / WhatsApp / map / mail links inside table rows (templates carry inline paddings, so !important) */
.btn.btn-dashed.btn-icon{
    --chip-fg:#4a566b;--chip-bg:#f1f3f7;--chip-bd:#dde2ec;
    padding:2px 10px !important;
    border:1px solid var(--chip-bd) !important;
    border-radius:var(--ui-radius,8px); /* a fully round (999px) end-cap on a short, wide chip
                                            reads as a stretched balloon rather than a badge */
    color:var(--chip-fg);
    background-color:var(--chip-bg);
    font-weight:600;
    line-height:1.5;
    box-shadow:none;
}
.btn.btn-dashed.btn-icon:hover:not(:disabled){
    color:var(--chip-fg);
    background-color:var(--chip-bg);
    filter:brightness(.96);
    transform:none;
    box-shadow:0 2px 6px -2px rgba(0,0,0,.25);
}
.btn.btn-dashed.btn-icon[href^="tel:"]{--chip-fg:#17814a;--chip-bg:#e9f8ef;--chip-bd:#bfe8cf;}
/* phone numbers: one step smaller than the other chips (same size everywhere a phone chip appears) */
.btn.btn-dashed.btn-icon[href^="tel:"]{font-size:.66rem;}
.btn.btn-dashed.btn-icon[href*="wa.me"]{--chip-fg:#0b6b3a;--chip-bg:#d8f6e4;--chip-bd:#a6e6c0;}
.btn.btn-dashed.btn-icon[href*="maps.google"],
.btn.btn-dashed.btn-icon[href*="google.com/maps"]{--chip-fg:#2552c4;--chip-bg:#e8f0fe;--chip-bd:#c5d6fb;}
.btn.btn-dashed.btn-icon[href^="mailto:"]{--chip-fg:#4a566b;--chip-bg:#f1f3f7;--chip-bd:#dde2ec;}

/* chips in table cells: icon and number/e-mail stay on one line (the column grows instead of breaking the chip) */
.table .btn.btn-dashed.btn-icon{
    display:inline-block;
    white-space:nowrap;
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    vertical-align:middle;
    padding:2px 6px !important;
    min-height:0;              /* the 32px touch size of other phone buttons would push the text to the top of the chip */
    line-height:20px;          /* text centred in the chip, chip height = 26px on every screen size */
}
.table td:has(> .btn.btn-dashed.btn-icon){padding-left:4px;padding-right:4px;}
/* list rows: every cell centred on the same line, so chips and text of one row line up */
.mshresponse > tbody > tr > td{vertical-align:middle;}
/* Action column (edit / clone / delete): compact buttons in one row, header never clipped.
   Bootstrap's own .table sets width:100% (a hard constraint, not a hint) and this table otherwise
   relies on table-layout:auto with no width/min-width of its own on this column - at a desktop width
   just a bit too narrow for every column's comfortable size, auto-layout doesn't shrink every column
   proportionally, it can squeeze ONE of them (usually the last, here Action) down to a sliver instead,
   clipping its buttons and the "Action" label itself. min-width alone does NOT reliably stop this:
   table-layout:auto's column-width algorithm treats min-width as a loose hint, not a hard floor the
   way it would for a normal block element, and happily rendered this column narrower than its own
   min-width anyway. An explicit width is a strong enough hint that the algorithm does respect it (the
   same way the D.Date/Qtty/Amount columns already size correctly from their own explicit widths) -
   once that no longer fits in 100%, the table is simply wider than its container and scrolls sideways
   inside .table-responsive, which is what should happen instead of the squeeze. */
table.mshresponse th.tdAction,
table.mshresponse td.tdAction{
    width:92px;
}
/* Qtty/Amount totals pills (.tot-head/.sum-head): their header's own declared width is a leftover
   desktop-era percentage (6%/10%) sized for plain centred text, not this shadowed, padded pill - once
   fixing the Action column above left auto-layout a little less slack to redistribute, "7,289.55 JOD"
   no longer fit and spilled its "JOD" unit past the pill's own rounded edge. Desktop only (>=992px):
   on phones this cell is already flattened into a plain "label: value" line (see the
   th:has(.sum-head)/.tot-head rules below) with no pill/width constraint to fight. */
@media (min-width:992px){
    table.mshresponse th.tdAction,
    table.mshresponse td.tdAction{
        white-space:nowrap;
        padding-left:4px;
        padding-right:4px;
        text-align:center;
    }
    table.mshresponse td.tdAction .btn{
        padding:4px 7px !important;
        margin:2px 1px !important;
    }
}
/* Action buttons in the phone card layout: compact, not the tall 38px+ touch size of other buttons */
@media (max-width:991.98px){
    table.mshresponse td.tdAction .btn{
        min-height:0 !important;
        height:32px;
        min-width:36px;
        padding:0 10px !important;
        margin:2px 3px !important;
        display:inline-flex;
        align-items:center;
        justify-content:center;
        font-size:.9em;
    }
}
/* package rows (driver / store / admin lists): comfortable space between the frame and what is inside it */
.bg-packages .col-description{
    padding:10px 14px !important;
}
.bg-packages .widget-heading{
    line-height:2;
}
.bg-packages .widget-heading > .btn{margin:0 2px;}
.bg-packages .widget-subheading{margin-top:4px;}
.bg-packages hr{margin:8px 0 !important;}
.bg-packages .notestt.notelist.pkgs{display:inline-flex;flex-wrap:wrap;gap:6px;align-items:center;}
/* table header totals (sum / tot pills): one step smaller (12.8px -> 11.5px) */
.btn:has(> .sum-head),
.btn:has(> .tot-head){
    font-size:.72rem;
}
/* Archive screens (pst_*): Orders and Returns are now two fully independent tables (own columns, own
   tbody), shown/hidden as a whole - see combine/pst_pkg_tabs.php / acc.js renderDtls(). No column-hiding
   CSS is needed any more. */
/* returned view: two state buttons (returned from the driver / returned to the store) - programming comes later */
.btnRetDrv,
.btnRetStore{
    min-width:36px;
    height:32px;
    padding:0 10px !important;
}
.btnRetDrv.acc-ret-err,
.btnRetStore.acc-ret-err{box-shadow:0 0 0 2px #d92550 !important;}
.btnRetDrv[data-state="1"],
.btnRetStore[data-state="1"]{
    color:#fff;
    background-color:#2db36b;
    border-color:#2db36b;
    cursor:default;
    pointer-events:none;       /* restored once: cannot be pressed again */
    opacity:1 !important;
}
/* step 2 (returned to the store) stays locked until step 1 (returned from the driver) of the same row is done */
tr:has(.btnRetDrv[data-state="0"]) .btnRetStore[data-state="0"]{
    opacity:.4;
    cursor:not-allowed;
    pointer-events:none;
}
/* restored = check mark instead of the undo arrow (Font Awesome 'check' glyph) */
.btnRetDrv[data-state="1"] > i:before,
.btnRetStore[data-state="1"] > i:before{
    content:"\f00c";
}
/* counter inside a tab (returned packages) */
.dsh-tabs .nav-link .tab-count{
    display:inline-block;
    min-width:22px;
    margin-inline-start:8px;
    padding:1px 7px;
    border-radius:999px;
    background:#dbe2ee;
    color:#4a566b;
    font-size:.72rem;
    font-weight:700;
    line-height:1.5;
    text-align:center;
    vertical-align:middle;
}
.dsh-tabs .nav-link.active .tab-count{background:#3f6ad8;color:#fff;}
/* Active / Inactive toggle buttons (chkbtn0 = inactive, red; chkbtn1 = active, green):
   dashboard.css forces the red text colour with !important, so on hover the red icon stayed red on the red background.
   On hover / press the icon is white. */
.btn-outline-success.chkbtn0:hover,
.btn-outline-success.chkbtn0:focus:hover,
.btn-outline-success.chkbtn0:not(:disabled):not(.disabled):active,
.btn-outline-success.chkbtn0:not(:disabled):not(.disabled).active{
    color:#fff !important;
}
.btn-outline-success.chkbtn1:hover,
.btn-outline-success.chkbtn1:not(:disabled):not(.disabled):active{
    color:#fff;
}
/* top accounts table: the Rt.Qtty cell is plain text (no click effect) */

/* touch targets (drivers use the phone all day) */
@media (max-width:768px){
    :is(button,a).btn{min-height:auto;}
    .btn.btn-dashed.btn-icon{min-height:32px;display:inline-flex;align-items:center;gap:4px;}
    .btnfinish{min-height:46px;font-size:1.1em;}
    /* round icon-only buttons (package-tracking page: language / locate-me) */
    :is(button,a).btn.btnlangtab{min-width:auto;}
}

/* Form controls */
.form-control,select.form-control,textarea.form-control{
    border-radius:var(--ui-radius);
    transition:border-color var(--ui-transition),box-shadow var(--ui-transition);
}
.form-control:focus{border-color:var(--ui-primary);box-shadow:0 0 0 3px rgba(63,106,216,.18);}

/* Cards & panels */
.card,.main-card.card{border-radius:calc(var(--ui-radius) + 2px);box-shadow:var(--ui-shadow);border-color:rgba(0,0,0,.06);}
.modal-content{border-radius:calc(var(--ui-radius) + 4px);border:0;box-shadow:0 12px 40px rgba(0,0,0,.2);}
.dropdown-menu{border-radius:var(--ui-radius);box-shadow:var(--ui-shadow-hover);border-color:rgba(0,0,0,.06);}

/* ===== general modal modernization (combine/modals.php): applies to every popup so none is left at the
   plain default Bootstrap look - a modal's own #id rules (e.g. #finishPackages) can still refine further */
.modal-header{padding:12px 18px;align-items:center;background:#f6f8fc;border-bottom:1px solid #e3e8f0;}
/* bootstrap.min.css hardcodes the close button's "margin: -1rem -1rem -1rem auto" with a PHYSICAL left
   margin, which never flips for dir="rtl" pages - it just glues the button to the title instead of pushing
   it to the opposite edge. Logical properties fix this for every modal, in either direction, automatically */
.modal-header .close{margin:-1rem !important;margin-inline-start:auto !important;}
.modal-title{font-size:1.05rem;font-weight:700;color:#1f3864;}
.modal-body{padding:16px 18px 8px;}
.modal-body label:not(.form-check-label){font-size:.78rem;font-weight:600;color:#6c7a91;margin-bottom:4px;}
.modal-body .form-group{margin-bottom:14px;}
.modal-body .form-control{border:1.5px solid #d5dde8;border-radius:10px;font-size:.9rem;}
.modal-footer{padding:12px 18px 16px;border-top:0;gap:8px;}
.modal-footer .btn{border-radius:10px;font-weight:700;}

/* Tables */
.table{border-collapse:separate;border-spacing:0;}
/* tables read 10% smaller than the surrounding text (everything inside inherits / scales with em) */
.table{font-size:.9em;}
/* long header text continues on the next line instead of running into the neighbouring column */
.table thead th{
    white-space:normal;
    overflow-wrap:break-word;
    word-break:normal;
    vertical-align:middle;
    line-height:1;
}
.table-hover tbody tr{transition:background-color var(--ui-transition);}
.table-responsive{-webkit-overflow-scrolling:touch;}

/* Images never overflow their container */
img{max-width:100%;}
/* height:auto only for images WITHOUT a height attribute; otherwise it overrides height="60" etc. and every logo/avatar shows at its own natural size */
img:not([height]){height:auto;}
/* logos / avatars in tables: the size written in the template is the size shown (square box, whole picture kept) */
.table img[height="34"]:not([width]){width:34px;object-fit:contain;}
.table img[height="40"]:not([width]){width:40px;object-fit:contain;}
.table img[height="50"]:not([width]){width:50px;object-fit:contain;}
.table img[height="60"]:not([width]){width:60px;object-fit:contain;}
.table img[width][height]{object-fit:cover;flex:0 0 auto;}

/* Subtle scrollbars */
*{scrollbar-width:thin;scrollbar-color:rgba(0,0,0,.28) transparent;}
::-webkit-scrollbar{width:8px;height:8px;}
::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:8px;}
::-webkit-scrollbar-thumb:hover{background:rgba(0,0,0,.4);}
::-webkit-scrollbar-track{background:transparent;}

/* Small screens: keep touch targets comfortable */
@media (max-width:576px){
    .btn{min-height:40px;}
    .form-control{min-height:42px;font-size:16px;} /* 16px avoids iOS zoom-on-focus */
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion:reduce){
    *,*::before,*::after{transition:none!important;animation-duration:.01ms!important;scroll-behavior:auto!important;}
}

/* Print: hide interactive chrome */
@media print{
    .btn,.no-print{display:none!important;}
    .card{box-shadow:none;}
}
/* Public package-tracking page (/package/?q=..., combine/enquiryp.php): the whole card was
   rendering empty/invisible. ".pg-card" (login-modern.css) has backdrop-filter, which makes it
   the positioning container for its absolutely-positioned child ".enquiry.package"
   (top:0;right:0;bottom:0;left:0, no height of its own); with its only child taken out of normal
   flow, ".pg-card" had nothing left to size itself by and collapsed to ~44px (just its own
   padding) - every percentage height below that point (".scroll-area-xs", the scrollbar area)
   then resolved against that same near-zero value, clipping the package details to nothing.
   Giving the card a real minimum height breaks that chain. Scoped to this exact page only via
   ":has(> .enquiry.package)" - the login page's own ".pg-card" (which holds the login form
   directly, not this element) is untouched. */
.pg-card:has(> .enquiry.package){
    min-height:100vh;
    /* keep it as the positioning container (any non-static position does that) without its
       own decorative chrome - the enquiry card below already draws its own white panel, so the
       card's background/shadow/blur was showing through at the margins as a second "ghost" box
       peeking out behind it. */
    position:relative;
    background:transparent;
    box-shadow:none;
    backdrop-filter:none;
    -webkit-backdrop-filter:none;
    padding:0;
}
/* Post modal, "Payment" tab (stores / drivers): same text size as the Details tab (its table is 12.67px), compact controls */
#ppTabPay,
#ppTabPay label,
#ppTabPay .form-check-label,
#ppTabPay .form-control{font-size:.792rem;}
#ppTabPay label{font-weight:400;}
#ppTabPay .form-control{height:calc(1.5em + .6rem);padding:.25rem .6rem;}
#ppTabPay textarea.form-control{height:auto;}
#ppTabPay .form-group{margin-bottom:.7rem;}
/* check mark on the Payment tab (payment activated): space between the text and the icon */
.ppTabs .ppTabOn{margin-inline-start:8px;}
/* Payment modal (acc_straccountstm / acc_drvaccountstm "Payment" button): same compact text and controls as the Payment tab of the Post modal */
#modalPaid .modal-body,
#modalPaid label,
#modalPaid .form-check-label,
#modalPaid .form-control{font-size:.792rem;}
#modalPaid label{font-weight:400;margin-bottom:.25rem;}
#modalPaid .form-control{height:calc(1.5em + .6rem);padding:.25rem .6rem;}
#modalPaid textarea.form-control{height:auto;}
#modalPaid .form-group{margin-bottom:.7rem;}
#modalPaid .modal-footer{font-size:.792rem;}
#modalPaid .modal-footer .chkprint{font-size:.792rem !important;}
#modalPaid .numtoword{font-size:.75rem !important;}
/* Accounts statements screens (acc_straccountstm / acc_drvaccountstm): compact balance rows, phone chips on one line */
.tblMainAcc .trbalance > td{padding-top:6px;padding-bottom:6px;vertical-align:middle;}
.tblMainAcc .trbalance .widget-heading{font-size:inherit;line-height:1.35;}
.tblMainAcc .trbalance .widget-subheading{display:flex !important;flex-wrap:wrap;gap:4px;margin-top:3px;}
.tblMainAcc .trbalance img.img-avatar{width:34px;height:34px;}
.tblMainAcc .trbalance .btnPaid{padding:2px 10px !important;font-size:.72rem;}
.tblMainAcc .trbalance sup,
.tblMainAcc tfoot sup{font-size:.62em;}
@media (max-width:991.98px){
    /* the inner scroll box of the balance list overlapped its own total row on small screens: let the page scroll instead */
    .tblMainAcc table.scrlbody,
    .tblMainAcc table.scrlbody tbody{max-height:none !important;overflow:visible !important;}
}

.pstRetView{display:inline-block;font-size:1.1em;color:#adb5bd;}
.pstRetView[data-state="1"]{color:#28a441;}
.pstRetView[data-state="1"] i:before{content:"\f058";}
.pstRetView:not([data-state="1"]) i:before{content:"\f057";}

/* ===== phones: compact table header (tools row + filter / summary cells), same look on every list screen =====
   991px, not 768px: that's the actual breakpoint dashboard.css itself switches table.mshresponse's body
   rows into stacked "cards" at (see its own @media (max-width:991.98px) block) - matching it here avoids a
   768-991px dead zone where the body is already stacked but this header styling hasn't kicked in yet,
   leaving the old desktop-width filter cells (e.g. the Store dropdown) narrow with background showing
   through next to them. */
@media (max-width:991.98px){
    /* tools row (view count, Bills / Statement / Refresh / Print / Remove / Add ...) */
    .pgHeadTbl{gap:6px;margin-bottom:6px;}
    .pgHeadTbl .form-group{margin:0;display:flex;align-items:center;gap:8px;}
    .pgHeadTbl .form-group label{margin:0;font-size:.8rem;white-space:nowrap;}
    .pgHeadTbl .form-control,.pgHeadTbl .itms-count{height:32px !important;min-height:32px !important;padding-top:2px;padding-bottom:2px;}
    .pgHeadTbl > .btn-actions-pane-right{gap:6px;}
    .pgHeadTbl > .btn-actions-pane-right > .btn,
    .pgHeadTbl .btn-actions-pane-left .btn{height:34px !important;min-height:34px !important;min-width:0 !important;padding:0 10px !important;font-size:.82rem;line-height:1;}
    .pgHeadTbl .btn i{font-size:.9em;}
    /* filter / search cells of the table header: label and control on ONE line.
       tbody's own rows ALREADY do exactly this (dashboard.css forces tbody > tr to display:block, and
       each td then sizes to a reliable ~100% width) even though tbody itself stays table-row-group - so
       the fix isn't "take everything out of table layout", just do the same thing here: force the
       <tr>, not only the <th>, to display:block. Left as table-row (the default), the <th>'s own
       width:100%/flex-basis never resolved against it consistently - "Store" and "Status" ended up two
       very different widths despite identical rules, because each silently fell back to the browser's
       own table column-width algorithm instead. */
    table.mshresponse > thead > tr{display:block !important;}
    table.mshresponse > thead > tr > th[tdtile]:not(:empty){
        display:flex !important;align-items:center;gap:8px;padding:3px 8px !important;min-height:0;
        width:100% !important;box-sizing:border-box;
    }
    table.mshresponse > thead > tr > th[tdtile]:not(:empty):before{
        flex:0 0 31%;max-width:31%;padding:0 !important;font-size:.76rem;font-weight:600;line-height:1.15;white-space:normal;
    }
    /* flex-basis:0 (not auto): a <select> sizes its auto/content basis from its OWN option text, so the
       Store filter (long store names) and Status filter (short words like "All") ended up wildly
       different widths under the same flex:1 1 auto even though both should just fill the rest of the
       row equally - forcing the basis to 0 makes flex-grow:1 the only thing that decides the width. */
    table.mshresponse > thead > tr > th[tdtile] .form-control,
    table.mshresponse > thead > tr > th[tdtile] select,
    table.mshresponse > thead > tr > th[tdtile] input{
        flex:1 1 0;min-width:0;width:auto !important;height:32px !important;min-height:32px !important;padding:2px 8px !important;
    }
    /* totals pills (Qty / Amount / Delivery / Total): label + value on one slim line */
    table.mshresponse > thead > tr > th:has(.sum-head),
    table.mshresponse > thead > tr > th:has(.tot-head){
        display:flex !important;align-items:center;gap:8px;padding:3px 8px !important;
    }
    table.mshresponse > thead > tr > th:has(.sum-head):before,
    table.mshresponse > thead > tr > th:has(.tot-head):before{
        position:static !important;flex:0 0 31%;max-width:31%;padding:0 !important;background:none !important;font-size:.76rem;font-weight:600;line-height:1.15;
        content:attr(tdtile) ' :' !important;
    }
    /* this pill (.btn.btn-outline-dark.btn-shadow) is made for sitting alone in a roomy desktop column
       header - its box-shadow/border read as a second, separate box once squeezed right next to the
       ":before" label in this flex row, instead of a plain "label: value" line like every other filter
       cell here. Flatten it to match them. */
    table.mshresponse > thead > tr > th:has(.sum-head) > div,
    table.mshresponse > thead > tr > th:has(.tot-head) > div{
        flex:1 1 auto;width:auto !important;padding:2px 8px !important;font-size:.85rem;min-height:0 !important;height:auto;
        box-shadow:none !important;border:0 !important;background:transparent !important;color:#1f3864 !important;
    }
    table.mshresponse > thead > tr > th:has(.sum-head) > div sup,
    table.mshresponse > thead > tr > th:has(.tot-head) > div sup{font-size:.65em;}
}

/* ===== driver "finish package" popup (acn_dpackages): quantity hidden, tidy layout ===== */
#finishPackages .modal-dialog{max-width:440px;}
#finishPackages .modal-content{border:0;border-radius:14px;overflow:hidden;box-shadow:0 12px 40px rgba(31,56,100,.25);}
#finishPackages .modal-header:first-child{padding:10px 16px;align-items:center;background:#f6f8fc;border-bottom:1px solid #e3e8f0;}
#finishPackages .modal-title{font-size:1rem;font-weight:700;color:#1f3864;}
#finishPackages .modal-body{padding:12px 16px 4px;}
#finishPackages .modal-body label:not(.form-check-label){font-size:.78rem;font-weight:600;color:#6c7a91;margin-bottom:3px;}
#finishPackages .form-group{margin-bottom:10px;}
/* amount: the one field the driver types, large and clear */
#finishPackages #pkamount{height:46px;font-size:1.25rem;font-weight:700;text-align:center;color:#1f3864;border-radius:10px;}
#finishPackages #pknote{min-height:56px;height:56px;border-radius:10px;font-size:.9rem;}
/* the two options (returned / paid to the store): side by side, as tappable boxes */
#finishPackages .form-row > .col-md-12 > .form-row > .col-md-6:has(.form-check){padding-inline:5px;}
#finishPackages .form-check{margin:0;padding:0;}
#finishPackages .form-check > .form-check-label{
    display:flex;align-items:center;gap:8px;width:100%;margin:0;padding:9px 10px;border:1px solid transparent;border-radius:10px;
    font-size:.82rem;font-weight:600;cursor:pointer;transition:background .15s,border-color .15s,box-shadow .15s;
}
/* the two options keep a plain white box; the status choices keep their own colours (clr33..clr88 of dashboard.css) */
#finishPackages .form-check:not(.pop-expulsion-status) > .form-check-label{background:#fff;border-color:#d5dde8;color:#3b4660;}
#finishPackages .form-check > .form-check-label > input{position:static;margin:0;flex:0 0 auto;width:18px;height:18px;}
#finishPackages .form-check:not(.pop-expulsion-status) > .form-check-label:has(input:checked){background:#eaf0ff;border-color:#3f6ad8;color:#1f3864;}
#finishPackages .pop-expulsion-status > .form-check-label:has(input:checked){box-shadow:0 0 0 2px #1f3864;}/* status choices: two columns of tiles */
#finishPackages fieldset.form-control{padding:0;border:0;background:none;height:auto;}
#finishPackages fieldset .row{margin:0 !important;gap:6px 0;}
#finishPackages .pop-expulsion-status{padding:0 3px !important;}
#finishPackages .pop-expulsion-status > .form-check-label{padding:8px 10px;font-size:.8rem;font-weight:600;}
#finishPackages .pop-expulsion-status > .form-check-label i{width:18px;text-align:center;}
#finishPackages .modal-body hr{margin:4px 0 8px;}
/* footer: the two buttons share the width */
#finishPackages .modal-footer{padding:10px 16px 14px;border-top:0;display:flex;gap:8px;}
#finishPackages .modal-footer .btn{flex:1 1 0;height:42px;font-weight:700;border-radius:10px;}
@media (max-width:576px){
    #finishPackages .modal-dialog{margin:8px;max-width:none;}
    #finishPackages .modal-body{padding:10px 12px 2px;}
}

/* status choices of the finish popup: white tiles, the status colour only on the icon and the text */
#finishPackages .pop-expulsion-status > label.form-check-label,
#finishPackages .pop-expulsion-status > label.form-check-label::before{background:#fff !important;border-color:#d5dde8 !important;}
#finishPackages .pop-expulsion-status > label.form-check-label::before{border:0 !important;background:none !important;}
#finishPackages .pop-expulsion-status > label.clr33{color:#c514b3;}
#finishPackages .pop-expulsion-status > label.clr44{color:#b3a800;}
#finishPackages .pop-expulsion-status > label.clr55{color:#2f9fb3;}
#finishPackages .pop-expulsion-status > label.clr66{color:#a52d2d;}
#finishPackages .pop-expulsion-status > label.clr77{color:#f40e16;}
#finishPackages .pop-expulsion-status > label.clr88{color:#2f9e0b;}
#finishPackages .pop-expulsion-status > label.form-check-label:has(input:checked){background:#f6f9ff !important;border-color:currentColor !important;box-shadow:0 0 0 1px currentColor;}

/* Customers (home, no-company picker): one card per company - logo, name, a title/description (placeholder
   copy for now), and three actions. login.css has a page-wide "a{color:#fff !important}" (meant for the
   login screen's own dark links) which this page's stylesheet also reuses, so button colors need !important */
.customers-row{row-gap:24px;justify-content:center;}
/* this heading and the empty-state message sit directly on the page's own colourful gradient background
   (not inside a white card like everything below it), where the default dark/black text barely reads -
   a soft white with a little shadow for contrast works on every gradient tone this background cycles through */
.customers-title,.customers-title *{color:#fff !important;text-shadow:0 1px 6px rgba(0,0,0,.25);}
.customers-empty{color:rgba(255,255,255,.92) !important;text-shadow:0 1px 6px rgba(0,0,0,.25);}
.customers-empty i{color:#ffd166;}
.company-card{
    /* the gap comes from .customers-row's row-gap (not this margin): .col-md-* is a flex item of .row, and
       a flex item always establishes its own block formatting context, so a plain margin-bottom here never
       reaches outside it to create space before the next wrapped column - it just silently collapses away */
    background:#fff;border-radius:calc(var(--ui-radius) + 6px);box-shadow:var(--ui-shadow);
    padding:26px 22px;text-align:center;height:100%;
    display:flex;flex-direction:column;align-items:center;
}
.company-card-logo{
    width:84px;height:84px;border-radius:20px;background:#f8fafc;border:1px solid #e3e8f0;
    display:flex;align-items:center;justify-content:center;margin-bottom:14px;overflow:hidden;
}
.company-card-logo img{max-width:70%;max-height:70%;object-fit:contain;}
.company-card-name{font-weight:700;color:var(--ui-primary) !important;font-size:.95rem;margin-bottom:10px;}
/* a title/description of unpredictable length (admin-entered, per company) must never stretch the card
   itself - the title clamps to 2 lines with an ellipsis, the description gets a fixed max-height and
   scrolls internally instead, so every card in the row stays the same height regardless of its content */
.company-card-title{
    font-weight:700;color:#1f3864 !important;font-size:1.05rem;margin:0 0 8px;
    display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.3;
}
.company-card-desc{
    color:#6c7a91 !important;font-size:.85rem;margin:0 0 18px;
    max-height:4.8em;overflow-y:auto;line-height:1.6;padding-inline-end:4px;
}
/* fixed, deterministic layout (Login full-width on its own row, About/Contact paired below) instead of
   relying on flex-wrap: Arabic/English text widths differ enough that auto-wrap put the 3 buttons on a
   different number of rows per language, so the card looked inconsistent between them */
.company-card-actions{margin-top:auto;display:flex;flex-direction:column;gap:8px;width:100%;}
.company-card-actions-row{display:flex;gap:8px;width:100%;}
.company-card-actions-row .btn{flex:1 1 0;}
.company-card-actions .btn{font-size:.8rem;border-radius:999px;}
/* login.css's page-wide "a{color:#fff !important}" made the outline buttons' labels invisible (white text
   on their own white/transparent background) - only the filled blue Login button happened to still show */
.company-card-actions .btn-outline-secondary{color:#6c7a91 !important;}
.company-card-actions .btn-outline-secondary:hover{color:#fff !important;background:#6c7a91;}
.company-card-login{color:#fff !important;width:100%;}

/* Customers card modal (About Us / Contact Us popup): the modal body had no padding/spacing of its own, and
   login.css's page-wide "a{color:#fff !important}" made the phone/email links invisible (white on white),
   leaving only their icons visible */
#companyInfoModalBody{padding:22px 24px;}
#companyInfoModalBody .aboutContent{line-height:1.8;color:#3b4660;text-align:start !important;}
.company-contact-info{display:flex;flex-direction:column;gap:10px;}
.company-contact-info .contact-info-row{
    /* a long email must wrap inside the box instead of overflowing past its border */
    display:flex;align-items:center;gap:10px;padding:12px 16px;border:1.5px solid #e3e8f0;border-radius:12px;
    color:#3b4660 !important;font-size:.92rem;font-weight:600;text-decoration:none;
    transition:background .15s,border-color .15s,color .15s;
    overflow-wrap:anywhere;word-break:break-word;
}
.company-contact-info .contact-info-row:hover{background:#f6f9ff;border-color:var(--ui-primary);color:#1f3864 !important;}
/* the full Contact Us page (/contact/) only - one size step down for the phone/email text, not the
   Customers card popup which shares this same markup/class */
.contact-page .company-contact-info .contact-info-row{font-size:.84rem;}
.company-contact-info .contact-info-row i{flex:0 0 auto;color:var(--ui-primary);width:18px;text-align:center;font-size:1rem;}
.contact-info-map{margin-top:4px;height:200px;border-radius:12px;overflow:hidden;border:1px solid #e3e8f0;}
.contact-info-map iframe{width:100%;height:100%;border:0;}
/* Contact Us popup: on a normal browser window there is plenty of width to spare, so the message form
   and the phone numbers/map sit side by side (like the full Contact Us page does) instead of one long
   stacked column - the modal itself needs to be wider than Bootstrap's default (500px) for that to have
   room to breathe. */
#companyInfoModal .modal-dialog{max-width:760px;}
.contact-modal-grid{display:grid;grid-template-columns:1fr 1fr;gap:28px;align-items:start;}
.contact-modal-grid .modal-contact-form{margin:0;}
/* phones: the modal's default (desktop) width cramps the message form, phone rows and map into a
   narrow column - give it almost the full screen width, stack the two columns back into one, and let
   its body scroll internally (not the whole page) so a tall mix of form + rows + map still fits within
   the viewport's height */
@media (max-width:767px){
    #companyInfoModal .modal-dialog{max-width:96vw;width:96vw;margin:10px auto;}
    #companyInfoModal .modal-content{max-height:92vh;}
    #companyInfoModalBody{max-height:calc(92vh - 54px);overflow-y:auto;padding:16px 14px;}
    .contact-info-map{height:230px;}
    .contact-modal-grid{grid-template-columns:1fr;gap:16px;}
}

/* Contact Us page (public, site-wide): was plain unstyled Bootstrap form + a bare heading borrowed from the
   copyright line - a proper title/icon, card wrappers, and the same contact-chip style as the Customers
   card modal (for visual consistency across the two places contact info shows up) */
.contact-page-title{display:flex;align-items:center;justify-content:center;gap:10px;font-weight:700;color:#1f3864;margin-bottom:18px;}
.contact-page-icon{
    display:flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:50%;
    background:rgba(63,106,216,.12);color:var(--ui-primary);font-size:1rem;flex:0 0 auto;
}
.contact-form-card,.contact-info-card{
    background:#fff;border:1px solid #e3e8f0;border-radius:calc(var(--ui-radius) + 4px);
    box-shadow:var(--ui-shadow);padding:22px;height:100%;
}
/* .form-row's two col-md-6 cards stack full-width on phones with no gap of their own between them,
   so the form card's bottom border touches the info card's top border directly */
@media (max-width:767px){
    .contact-page .form-row > [class*="col-"]{margin-bottom:16px;}
    .contact-page .form-row > [class*="col-"]:last-child{margin-bottom:0;}
}
.contact-info-card h4{font-weight:700;color:#1f3864 !important;font-size:1.05rem;margin-bottom:16px;}
.contact-form-card .form-group{margin-bottom:0;}
.contact-form-card .input-group{margin-bottom:14px;}
.contact-form-card .bio{border-color:#d5dde8;}
.contact-form-card .input-group-text.bio{background:#f8fafc;color:#6c7a91;border-color:#d5dde8;}
.contact-form-card .form-control.bio{font-size:.86rem;}

/* Settings > Administrators: mark the main administrator (emp_type=0) - the server already refuses to let
   anyone else delete or edit this row (cls_t::protect_main), this just makes that visible: a small crown
   badge on the corner of the avatar itself, above the photo and off to the side (not centered on top) */
.main-admin-avwrap{position:relative;display:inline-block;}
.main-admin-badge{display:none;}
.main-admin-badge[data-et="0"]{
    display:flex;align-items:center;justify-content:center;position:absolute;top:-6px;inset-inline-end:-6px;
    width:18px;height:18px;border-radius:50%;background:#fff;color:#e6a118;font-size:.62rem;
    box-shadow:0 1px 4px rgba(0,0,0,.3);
}

/* App footer on phones: table.js moves each table's pager (.view-pages, itself already wrap-capable -
   see tables-modern.css) into the global footer, right beside the copyright text. The theme's own
   .app-footer__inner/.app-footer-right never wrap, so on narrow screens that combined row ran wider
   than the screen and the pager got pushed off to the side. Let everything wrap and stack centered. */
@media (max-width:767px){
    .app-footer .app-footer__inner{flex-wrap:wrap;justify-content:center;row-gap:6px;padding:8px 10px;}
    .app-footer .app-footer__inner .app-footer-left,
    .app-footer .app-footer__inner .app-footer-right{margin-inline-start:0;flex-wrap:wrap;justify-content:center;width:100%;}
    .app-footer .footer-dots{flex-wrap:wrap;justify-content:center;row-gap:6px;column-gap:8px;}
    .app-footer .footer-dots .dots-separator{display:none;}
    .app-footer .view-pages{width:100%;justify-content:center;padding:6px 0 0;border-top:0;background:transparent;}
}
/* .app-container forces min-height:100vh (theme default, main_ds1.css), and on mobile the footer already
   leaves fixed/floating position for normal document flow (dashboard.css: .fixed-footer .app-footer {
   position: unset }). But .app-main__outer (holding the screen's content + the footer) only ever sizes
   to its own content, not to that full-height parent, so a short screen's footer landed right after a
   small card with the rest of the 100vh left blank underneath it. Make the content area the one that
   stretches (sticky footer pattern) so the footer always sits at the bottom with no dead strip below it. */
@media (max-width:991.98px){
    /* .app-main__outer already carries flex-grow:1 from the theme, meaning to fill .app-main - but on
       mobile .app-main itself is plain display:block (the sidebar goes off-canvas there), so that
       flex-grow has nothing to act on and .app-main__outer just shrinks to its own content height
       instead. Make .app-main a flex column too so the grow actually reaches .app-main__outer. */
    .app-main{display:flex;flex-direction:column;min-width:0;}
    /* flex items default to min-width:auto, meaning they refuse to shrink below their content's natural
       width - a wide table (even one already wrapped in its own .table-responsive) could then force this
       flex item wider than the screen, scrolling the WHOLE page sideways instead of just that table. */
    .app-main__inner{flex:1 0 auto;min-width:0;}
}

/* Assign Packages (Drivers > Packages badge): .btn-actions-pane-left/-right share one flex row with no
   explicit width; the search input keeps its desktop min-width:150px (set inline on the element) and on
   phones overflows its own shrunk flex-item box, landing visually on top of the driver avatar/name next
   to it. Stack both panes full-width instead of fighting that inline min-width. */
@media (max-width:767px){
    #edit_packages .card-header{flex-direction:column;align-items:stretch;row-gap:8px;}
    #edit_packages .btn-actions-pane-left,
    #edit_packages .btn-actions-pane-right{width:100%;flex-wrap:wrap;}
    #edit_packages .btn-actions-pane-left input[type="search"]{width:100% !important;min-width:0 !important;}
}

/* Posted statement screens (pst_stores/pst_sstores/pst_drivers/pst_ddrivers/pst_employees.php): the
   "Statements" header's From/To date filters are two separate inline-block <div class="form-group">,
   each a fixed 116px wide text+input pair with no flex/wrap layout of their own - they just wrap one at
   a time onto their own line as soon as the row runs out of room, each line a mismatched label-over-input
   stack. Give that whole right-hand pane one tidy wrapping row with a bit less font instead, at any width. */
.cardstat-body .card-header{flex-wrap:wrap;row-gap:8px;}
.cardstat-body .btn-actions-pane-right{display:flex;flex-wrap:wrap;align-items:center;gap:8px;}
.cardstat-body .btn-actions-pane-right .form-group{display:flex !important;align-items:center;gap:6px;margin:0 !important;}
.cardstat-body .btn-actions-pane-right .form-group label{white-space:nowrap;font-size:.76rem !important;}
.cardstat-body .btn-actions-pane-right input.form-control{width:112px !important;height:28px !important;font-size:.78rem !important;}
@media (max-width:767px){
    .cardstat-body .btn-actions-pane-left,
    .cardstat-body .btn-actions-pane-right{width:100%;}
}

/* Add/Edit item modal header (dashboard/tbledit.php): the "limit reached" warning + Save button used
   hardcoded float:left/text-align:right (dashboard.css) or float:right/text-align:left (dashboardrtl.css)
   - two separate stylesheets guessing the direction instead of one rule that just follows it, and on a
   narrow phone the warning's fixed font-size wrapped it onto a second line, with Save then landing
   wherever the float math put it. Flexbox (logical gap/order, no left/right) replaces both, and the
   warning shrinks to fit one line on phones instead of wrapping. */
.edit-btn-tools{
    display: flex !important; align-items: center; gap: 8px;
    text-align: start;
}
/* .msg-max-warn is a generic "no data" / warning message class reused by many unrelated screens
   (acc_stores, acc_drivers, acc_employees, account statements, payroll...) for a plain centered banner -
   scoped to .edit-btn-tools specifically so only the Add/Edit modal's own warning is turned into a flex
   row; an earlier unscoped version of this rule broke that banner everywhere else it's used. */
.edit-btn-tools .msg-max-warn{
    float: none !important; display: flex; align-items: center; gap: 6px; margin: 0; flex: 1 1 auto;
    min-width: 0; text-align: start; white-space: normal;
}
/* margin-inline-start:auto (not justify-content:space-between on the parent): the warning message is
   only ever rendered when the item-limit is close to being reached, so most of the time Save is the
   ONLY child in this row - and space-between with a single flex item falls back to flex-start, pinning
   Save to the start edge (the left, in an English/LTR session) instead of the end. An auto start-margin
   on the button itself pushes it to the end whether or not the warning is present. */
.edit-btn-tools .btnsv{flex: 0 0 auto; margin-inline-start: auto !important;}
@media (max-width: 480px){
    .edit-btn-tools .msg-max-warn{font-size: .68rem !important; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
    .edit-btn-tools .btnsv{font-size: .8rem; padding: 4px 10px;}
}

/* Assign Packages modal: search and driver identity share one flexible header row. */
#edit_packages .assign-driver-header{display:flex;flex-wrap:nowrap;align-items:center;gap:12px;height:auto;}
#edit_packages .assign-driver-header > .btn-actions-pane-left{display:flex;flex-wrap:nowrap;align-items:center;gap:6px;flex:1 1 0;min-width:0;margin:0;}
#edit_packages .assign-driver-header > .btn-actions-pane-left > .btn{flex:0 0 auto;}
#edit_packages .assign-driver-header > .btn-actions-pane-left > div{flex:1 1 0;min-width:0;}
#edit_packages .assign-driver-header > .btn-actions-pane-right{display:flex;flex-wrap:nowrap;align-items:center;gap:6px;flex:0 1 48%;min-width:0;margin:0;}
#edit_packages .assign-driver-header .widget-content-left{flex:0 0 auto;}
#edit_packages .assign-driver-header .widget-heading{min-width:0;white-space:normal;overflow-wrap:anywhere;padding-right:0 !important;}

/* Arrange button matches the neutral toolbar and turns blue on interaction. */
.pgHeadTbl .btnDriverOrder{color:#495057;border-color:#ced4da;background:transparent;}
.pgHeadTbl .btnDriverOrder:hover,
.pgHeadTbl .btnDriverOrder:focus-visible{color:#fff !important;border-color:#3f6ad8 !important;background:#3f6ad8 !important;}

/* Saved driver route editor, independent of all table/card layout rules. */
#driverRouteOrder .modal-body{max-height:65vh;overflow-y:auto;}
#driverRouteOrder .driver-route-list{list-style:none;margin:12px 0 0;padding:0;}
#driverRouteOrder .driver-route-item{display:flex;align-items:center;gap:12px;padding:12px;margin:8px 0;border:1px solid #dce4ee;border-radius:8px;background:#fff;}
#driverRouteOrder .driver-route-rank{display:flex;align-items:center;gap:8px;flex:0 0 auto;}
#driverRouteOrder .driver-route-grip{cursor:grab;color:#75849b;padding:6px;}
#driverRouteOrder .driver-route-position{width:72px;padding:5px;text-align:center;}
#driverRouteOrder .driver-route-info{min-width:0;flex:1;overflow-wrap:anywhere;line-height:1.5;}
#driverRouteOrder .driver-route-actions{display:flex;gap:4px;flex:0 0 auto;}
#driverRouteOrder .driver-route-actions .btn{padding:6px 10px;}
#driverRouteOrder .driver-route-placeholder{height:76px;border:2px dashed #3f6ad8;border-radius:8px;background:#edf3ff;}
@media (max-width:560px){
    #driverRouteOrder .driver-route-item{gap:8px;padding:10px;}
    #driverRouteOrder .driver-route-rank{flex-direction:column;gap:2px;}
    #driverRouteOrder .driver-route-position{width:56px;}
    #driverRouteOrder .driver-route-actions{flex-direction:column;}
}

/* Account/Posted list screens (acc_stores.php and the like): phones keep thead:first-of-type visible
   (it holds the live per-column search box) while tables-modern.css hides thead:last-of-type (the column
   labels, redundant once each row shows its own tdtile label) - see tables-modern.css around line 380.
   But only ONE of that first row's cells actually has a search box (tdtile="Search"); every other column
   still renders its own empty, fixed-width, same-background <th>, which on a narrow phone reads as one
   meaningless solid-colour bar next to the real search field. Rather than hide/resize them (the table's
   own auto column-width layout fought back when tried - the search cell stayed its original width
   regardless), just make the empty ones blend into the page: no fill, no border, so only the search
   field reads as a control. Column widths/layout are untouched either way.
   (Coloring the empty <th>s themselves isn't enough: with no tbody rows to anchor column widths - this
   is the "no data" empty state - the table's auto layout collapses every content-less column to 0
   width, so an empty <th>'s own background never gets to paint anything. What actually shows is the
   <tr>'s own inline background-color underneath, in the space those zero-width cells leave uncovered -
   so the <tr> itself needs the override, not its cells.) */
@media (max-width:991.98px){
    table.mshresponse > thead:first-of-type > tr{background-color: #fff !important;}
}

/* Shared accounting payment validation. */
#modalPaid .payment-field-error{display:block;color:#c82333;font-size:.8rem;margin-top:4px;line-height:1.5;text-align:start;}
#modalPaid .form-control[aria-invalid="true"]{border-color:#c82333 !important;}

/* Explain the posting mode in each accounting tab. */
#modalPosted .post-mode-notice{display:flex;align-items:flex-start;gap:8px;padding:10px 12px;margin-bottom:14px;border:1px solid #ccdced;border-radius:8px;background:#f1f6fc;color:#28496c;font-size:.76rem;line-height:1.6;text-align:start;}
#modalPosted .post-mode-notice i{margin-top:4px;flex-shrink:0;}
#modalPosted .modal-emp img{background:rgba(255,255,255,.88);padding:3px;border:1px solid rgba(255,255,255,.6);border-radius:7px!important;box-sizing:content-box;object-fit:contain;opacity:1;}
#modalPosted .post-mode-payment{background:#edf8f1;border-color:#c8e8d3;color:#23623c;}

/* Assignment feedback floats above the lists without changing their height. */
:is(#edit_packages,#driverTransfer) .assignment-feedback{position:fixed;inset-inline-end:12px;bottom:12px;z-index:1060;display:flex;align-items:flex-start;gap:10px;width:max-content;max-width:min(480px,calc(100% - 24px));max-height:100px;overflow:auto;padding:8px 10px;margin:0;border-radius:9px;font-size:.75rem;line-height:1.5;text-align:start;box-shadow:0 3px 14px #233b5c26;cursor:pointer;}
:is(#edit_packages,#driverTransfer) .assignment-feedback span{min-width:0;overflow-wrap:anywhere;}
:is(#edit_packages,#driverTransfer) .assignment-feedback-close{flex:0 0 auto;border:0;background:transparent;color:inherit;font-size:18px;line-height:1;padding:0 2px;cursor:pointer;}
/* Transfer uses the same Bootstrap card/header/table structure as Assign Packages. */
#driverTransfer .modal-body{overflow:auto;min-height:0;}
#driverTransfer .transfer-count{font-size:.8rem;color:#61748b;margin:4px 0;}
#driverTransfer .transfer-list{height:calc(100vh - 95px);overflow:auto;}
#driverTransfer .transfer-group td{background:#e9f3ff;color:#24517b;font-weight:600;}
#driverTransfer .transfer-staged > td{background:#effaf3;}
#driverTransfer .transfer-driver-fee{display:block;color:#217247;font-size:.78rem;}
#driverTransfer .transfer-remove{padding:2px 6px;font-size:.75rem;margin-inline-start:8px;}
html[dir=rtl] #transferStage i{transform:rotate(180deg);}
@media(min-width:992px){
 #driverTransfer .modal-body{display:flex;flex-direction:column;overflow:hidden;}
 #driverTransfer .modal-body > .card-body,#driverTransfer .modal-body > .card-body > .dataTables_wrapper{display:flex;flex-direction:column;flex:1;min-height:0;}
 #driverTransfer .transfer-panels{flex:1;min-height:0;}
 #driverTransfer .transfer-column,#driverTransfer .assignment-source-card > .card-body,#driverTransfer .assignment-source-card .dataTables_wrapper{display:flex;flex-direction:column;min-height:0;}
 #driverTransfer .assignment-source-card{flex:1;min-height:0;}
 #driverTransfer .card-header,#driverTransfer .transfer-count{flex-shrink:0;}
 #driverTransfer .transfer-list{height:auto;flex:1;min-height:0;}
}

/* Allow nested flex cards and Select2 labels to shrink within the modal columns. */
#driverTransfer .modal-content,
#driverTransfer .modal-body,
#driverTransfer .modal-body > .card-body,
#driverTransfer .dataTables_wrapper,
#driverTransfer .transfer-column,
#driverTransfer .assignment-source-card,
#driverTransfer .assignment-source-card > .card-body{min-width:0;}
#driverTransfer .transfer-column > .assignment-source-card{width:100%;max-width:100%;}
#driverTransfer .transfer-list{width:100%;max-width:100%;}
#driverTransfer .card-header .btn-actions-pane-left > div{min-width:0;max-width:100%;}
#driverTransfer .transfer-list td{overflow-wrap:anywhere;}

/* Bound the Bootstrap row to the modal, including nested flex wrappers. */
#driverTransfer .modal-body > .card-body,
#driverTransfer .modal-body > .card-body > .dataTables_wrapper{width:100%;max-width:100%;box-sizing:border-box;}
#driverTransfer .transfer-panels{width:100%;max-width:100%;margin-left:0;margin-right:0;align-items:stretch;}
#driverTransfer .transfer-column{flex:0 0 50%;width:50%;max-width:50%;padding-left:8px;padding-right:8px;box-sizing:border-box;}
#driverTransfer .assignment-source-card > .card-body,
#driverTransfer .assignment-source-card .dataTables_wrapper{width:100%;max-width:100%;box-sizing:border-box;}
#driverTransfer .card-header{font-weight:400;}
#driverTransfer .card-header .form-control{font-size:.8rem !important;font-weight:400 !important;}
#driverTransfer .card-header .form-control{height:34px !important;min-height:34px !important;box-sizing:border-box;}
@media(max-width:991.98px){
 #driverTransfer .transfer-column{flex:0 0 100%;width:100%;max-width:100%;}
 #driverTransfer .modal-body{overflow-y:auto;}
}

/* Keep both columns within the available row, independent of intrinsic table widths. */
#driverTransfer .transfer-panels{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;}
#driverTransfer .transfer-column{width:auto;max-width:100%;padding:0;min-width:0;}
#driverTransfer .modal-body{overflow-x:hidden;}
#driverTransfer .transfer-list{min-width:0;}
@media(min-width:992px){
 #driverTransfer .transfer-list table{width:100%;min-width:0;table-layout:fixed;}
 #driverTransfer .transfer-check-column{width:36px;}
 #driverTransfer .transfer-city-column,#driverTransfer .transfer-store-column{width:18%;}
 #driverTransfer .transfer-list .mntbl-chk{width:36px !important;padding-left:6px;padding-right:6px;}
 #driverTransfer .transfer-list .custom-control{padding-left:0;min-width:20px;width:20px;margin:auto;}
 #driverTransfer .transfer-list .custom-control-label{position:relative;display:block;width:20px;min-height:20px;}
 #driverTransfer .transfer-list .custom-control-label:before,
 #driverTransfer .transfer-list .custom-control-label:after{left:0;right:auto;}
 #driverTransfer .transfer-list td:not(.mntbl-chk){overflow-wrap:break-word;}
}
@media(max-width:991.98px){
 #driverTransfer .transfer-panels{grid-template-columns:minmax(0,1fr);}
 #driverTransfer .transfer-list colgroup{display:none;}
}

/* RTL theme adds right padding to custom-control; keep the checkbox inside its own column. */
@media(min-width:992px){
 #driverTransfer .transfer-list .custom-control{padding:0 !important;}
 #driverTransfer .transfer-list .custom-control-label{margin:0 !important;padding:0 !important;}
 #driverTransfer .transfer-list .custom-control-label::before,
 #driverTransfer .transfer-list .custom-control-label::after{left:2px !important;right:auto !important;}
 #driverTransfer .transfer-list .custom-control-input{left:2px;right:auto;}
}

/* Match the Transfer search controls without touching Select2 positioning or scroll handlers. */
#driverTransfer .card-header .select2-container .select2-selection--single{height:34px;min-height:34px;padding:0;border-radius:10px;border:1.5px solid #d5dde8 !important;box-sizing:border-box;}
#driverTransfer .card-header .select2-container .select2-selection__rendered{font-size:.8rem;font-weight:400;line-height:31px !important;padding-inline-start:10px;padding-inline-end:26px;}
#driverTransfer .card-header .select2-container .select2-selection__arrow{height:31px;top:0;bottom:0;margin:auto 0;}
body:has(#driverTransfer.show) > .select2-container--open .select2-dropdown,
body:has(#driverTransfer.show) > .select2-container--open .select2-search__field{font-size:.8rem;font-weight:400;}

/* Sidebar panel toggle: reuse existing click handlers and cookie state. */
.sidebar-panel-toggle{display:inline-flex;align-items:center;justify-content:center;width:38px;height:36px;padding:5px!important;border:1px solid transparent;border-radius:9px;color:var(--ui-primary,#3f6ad8);transition:background .15s,border-color .15s;}
.sidebar-panel-toggle:hover,.sidebar-panel-toggle:focus-visible{background:rgba(63,106,216,.09);border-color:rgba(63,106,216,.2);opacity:1;}
.sidebar-panel-icon{width:26px;height:26px;flex:none;}
.sidebar-panel-arrow{transform-origin:14.5px 12px;transition:transform .18s;}
.closed-sidebar .close-sidebar-btn .sidebar-panel-arrow{transform:rotate(180deg);}
.mobile-toggle-nav .sidebar-panel-arrow{transform:rotate(180deg);}
.sidebar-mobile-open .mobile-toggle-nav .sidebar-panel-arrow{transform:rotate(0deg);}
[dir="rtl"] .sidebar-panel-icon{transform:scaleX(-1);}
@media(prefers-reduced-motion:reduce){.sidebar-panel-arrow{transition:none;}}

/* Keep posted statement date controls compact on phones/tablets. */
@media(max-width:991.98px){
 .cardstat-body .posted-statement-header{height:auto!important;min-height:0;display:flex;gap:10px;text-transform:none!important;}
 .cardstat-body .posted-statement-header > .btn-actions-pane-left{width:100%;margin:0;font-size:.95rem;text-align:start;}
 .cardstat-body .posted-statement-header > .btn-actions-pane-right{width:100%;min-width:0;margin:0;display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-start;}
 .cardstat-body .posted-statement-header .print-title-sub2{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;width:100%;min-width:0;}
 .cardstat-body .posted-statement-header .print-title-sub2 .form-group{display:flex!important;flex-direction:column;align-items:stretch;gap:3px;min-width:0;}
 .cardstat-body .posted-statement-header .print-title-sub2 label{font-size:.7rem!important;line-height:1.2;text-align:start;}
 .cardstat-body .posted-statement-header .print-title-sub2 input.form-control{box-sizing:border-box;width:100%!important;min-width:0;max-width:100%;height:32px!important;min-height:32px!important;font-size:.75rem!important;padding:4px 7px!important;border-radius:8px;}
 .cardstat-body .posted-statement-header > .btn-actions-pane-right > .btn{font-size:.75rem!important;min-height:30px;height:30px;padding:3px 10px!important;margin:0!important;}
}

/* Shared From/To fields: same joined label/date design across lists, statements and reports. */
.ui-date-range.ui-date-range{display:flex!important;align-items:center;gap:10px;min-width:0;flex-wrap:wrap;}
.ui-date-range .ui-date-field.ui-date-field,.rp-f.ui-date-field{display:flex!important;flex-direction:row!important;align-items:stretch!important;gap:0!important;min-width:0;margin:0!important;}
.ui-date-field > .input-group{display:flex;flex-wrap:nowrap;width:100%;}
.ui-date-field > label,.ui-date-field .input-group-text.txtdfdto{display:flex;align-items:center;justify-content:center;background:#f1f5fb;border:1px solid var(--btn-line,#cbd5e1);border-inline-end:0;border-radius:8px 0 0 8px;padding:0 12px;min-width:50px;font-size:.8rem!important;line-height:1.2;font-weight:600;color:#4a566b;white-space:nowrap;margin:0!important;}
.ui-date-field.ui-date-field input.form-control{flex:1 1 auto!important;width:150px!important;min-width:0!important;max-width:100%;height:36px!important;min-height:36px!important;font-size:.8rem!important;padding:5px 9px!important;border-radius:0 8px 8px 0!important;}
[dir="rtl"] .ui-date-field > label,[dir="rtl"] .ui-date-field .input-group-text.txtdfdto{border-radius:0 8px 8px 0;}
[dir="rtl"] .ui-date-field.ui-date-field input.form-control{border-radius:8px 0 0 8px!important;}
@media(max-width:991.98px){
 .pgHeadTbl > .ui-date-range.ui-date-range,.posted-statement-header .ui-date-range.ui-date-range,.cardstat-body .ui-date-range.ui-date-range{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);width:100%;flex:1 1 100%;gap:8px;}
 .ui-date-range .ui-date-field.ui-date-field,.rp-f.ui-date-field{min-width:0!important;}
 .ui-date-field > label,.ui-date-field .input-group-text.txtdfdto{min-width:32px!important;padding:0 6px!important;font-size:.68rem!important;}
 .ui-date-field.ui-date-field input.form-control{width:100%!important;height:32px!important;min-height:32px!important;font-size:.72rem!important;padding:4px 5px!important;}
 .rp-f.ui-date-field{flex:1 1 45%;max-width:100%;}
 .cardstat-body .posted-statement-header .ui-date-field.ui-date-field{flex-direction:row!important;gap:0!important;}
 .cardstat-body .posted-statement-header .ui-date-field > label{font-size:.68rem!important;}
 .cardstat-body .posted-statement-header .ui-date-field input.form-control{border-radius:0 8px 8px 0!important;}
 [dir="rtl"] .cardstat-body .posted-statement-header .ui-date-field input.form-control{border-radius:8px 0 0 8px!important;}
}
@media(max-width:340px){.ui-date-range.ui-date-range{grid-template-columns:minmax(0,1fr)!important;}.rp-f.ui-date-field{flex-basis:100%;}}

/* Payroll month uses the same joined date control as From/To. */
.payroll-month-control{min-width:0;}
.payroll-month-control .ui-date-field{display:flex;align-items:stretch;min-width:0;}
.payroll-month-control .ui-date-field > label{text-transform:none;font-weight:600;}
.payroll-month-control .ui-date-field input.form-control{width:180px!important;}
@media(max-width:991.98px){.payroll-month-control{flex:1 1 auto;}.payroll-month-control .ui-date-field{width:100%;}.payroll-month-control .ui-date-field input.form-control{width:150px!important;}.payroll-month-control .ui-date-field > label{min-width:0!important;}}

/* Accounting: existing search/filter and action buttons share one toolbar. */
.pgHeadTblacc .accounting-toolbar{display:flex!important;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;height:auto!important;min-height:0;}
.pgHeadTblacc .accounting-toolbar > :is(.admin-pending-search,.balance-local-filter){display:flex;align-items:center;flex:1 1 240px;gap:8px;min-width:0;max-width:680px;margin:0!important;padding:0;}
.pgHeadTblacc .accounting-toolbar .admin-pending-search label{margin:0;white-space:nowrap;font-size:.8rem;}
.pgHeadTblacc .accounting-toolbar .form-control{min-width:0;height:34px!important;min-height:34px;font-size:.8rem;}
.pgHeadTblacc .accounting-toolbar .search-head-store{flex:1 1 0;width:100%;max-width:none;}
.pgHeadTblacc .accounting-toolbar > .btn-actions-pane-right{display:flex;align-items:center;align-self:center;flex:0 0 auto;gap:8px;width:auto!important;margin:0!important;margin-inline-start:auto!important;padding:0!important;}
.pgHeadTblacc .accounting-toolbar > .btn-actions-pane-right > .btn{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;margin:0!important;margin-inline-start:0!important;border-radius:8px!important;line-height:1.2;white-space:nowrap;}
@media(max-width:991.98px){
 .pgHeadTblacc .accounting-toolbar{gap:8px;}
 .pgHeadTblacc .accounting-toolbar > :is(.admin-pending-search,.balance-local-filter){flex:1 1 120px;}
 .pgHeadTblacc .accounting-toolbar > .btn-actions-pane-right .btn{font-size:.72rem!important;padding:4px 7px!important;min-width:0;min-height:32px;height:32px;white-space:nowrap;}
 .pgHeadTblacc .accounting-toolbar .admin-pending-search{gap:5px;}
 .pgHeadTblacc .accounting-toolbar .admin-pending-search label{font-size:.72rem;}
 .pgHeadTblacc .accounting-toolbar .balance-local-filter{flex-wrap:wrap;}
 .pgHeadTblacc .accounting-toolbar .balance-local-filter > .form-control{flex:1 1 100px;width:0;}
}

/* Compact gap below accounting search/actions only. */
.pgHeadTblacc .tblMainAcc > .accounting-toolbar{padding-bottom:4px!important;}
.pgHeadTblacc .tblMainAcc > .accounting-toolbar + .card-body{padding-top:4px!important;}
.pgHeadTblacc .tblMainAcc > .accounting-toolbar + .card-body > table.mshresponse{margin-top:4px!important;}

/* Statement filters form a full row; actions follow below on small screens. */
@media(max-width:767px){
 .pgHeadTblacc .accounting-toolbar:has(> .balance-local-filter){align-items:stretch;gap:8px;}
 .pgHeadTblacc .accounting-toolbar > .balance-local-filter.balance-filter-row{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);flex:1 1 100%;width:100%;max-width:none;gap:8px;}
 .pgHeadTblacc .accounting-toolbar > .balance-local-filter.balance-filter-row > .form-control{width:100%!important;min-width:0!important;max-width:100%;height:34px!important;font-size:.76rem!important;}
 .pgHeadTblacc .accounting-toolbar:has(> .balance-local-filter) > .btn-actions-pane-right{justify-content:flex-end;width:100%!important;flex:1 1 100%;margin:0!important;}
}
@media(max-width:340px){.pgHeadTblacc .accounting-toolbar > .balance-local-filter.balance-filter-row{grid-template-columns:minmax(0,1fr);}}



/* Keep mobile header controls near the edges and give the title the remaining width. */
@media(max-width:991.98px){
 .app-container > .app-header{padding-inline:6px!important;gap:4px;}
 .app-container > .app-header > .app-header__mobile-menu,
 .app-container > .app-header > .app-header__menu{flex:0 0 38px;width:38px;min-width:38px;margin:0!important;padding:0!important;align-items:center;justify-content:center;}
 .app-container > .app-header > .app-header__mobile-menu{order:1;}
 .app-container > .app-header > .app-header__menu{order:3;}
 .app-container > .app-header > .app-header__logo{display:flex!important;order:2;flex:1 1 0;width:auto!important;min-width:0;padding-inline:2px!important;margin:0!important;gap:5px;}
 .app-container > .app-header > .app-header__logo > .header__pane{display:none;}
 .app-container > .app-header > .app-header__logo .logo-src{flex:0 0 30px;width:30px;max-width:30px!important;margin:0!important;background-size:contain;background-repeat:no-repeat;background-position:center;}
 .app-container > .app-header > .app-header__logo .header-text-light{margin:0!important;min-width:0;flex:1 1 0;}
 .app-container > .app-header > .app-header__mobile-menu .sidebar-panel-toggle{margin:0!important;padding:5px!important;}
 .app-container > .app-header > .app-header__menu > span{margin:0!important;padding:0!important;}
 .app-container > .app-header > .app-header__menu .mobile-toggle-header-nav{margin:0!important;}
}

/* A compact options grid replaces the mobile header ellipsis. */
.app-header .app-header__menu .header-options-toggle{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:34px;height:34px;min-width:34px;padding:7px!important;line-height:1;border:1px solid #d5dff0!important;border-radius:10px!important;background:#edf3ff!important;color:#3f6ad8!important;box-shadow:0 2px 5px #1f386410;transition:background .15s,border-color .15s;}
.app-header .app-header__menu .header-options-toggle svg{display:block;width:19px;height:19px;flex:none;pointer-events:none;}
.app-header .app-header__menu .header-options-toggle:hover{background:#e1eaff!important;border-color:#adc2ed!important;}
.app-header .app-header__menu .header-options-toggle.active{background:#3f6ad8!important;border-color:#3f6ad8!important;color:#fff!important;}
.app-header .app-header__menu .header-options-toggle:focus-visible{outline:2px solid #3f6ad8;outline-offset:2px;}

/* Mobile header options: subscription row plus a separate, balanced action row. */
@media(max-width:991.98px){
 .app-header .app-header__content.mobile-options-panel{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:10px;left:8px!important;right:8px!important;width:auto!important;height:auto;min-height:0;padding:12px!important;border:1px solid #dce4f1;border-radius:15px;overflow:visible;box-shadow:0 8px 28px #1f386426;transform:none;}
 .app-header .app-header__content.mobile-options-panel.header-mobile-open{top:68px;}
 .app-header .mobile-options-panel > .app-header-left{display:flex;width:100%;margin:0;padding:0;justify-content:center;}
 .app-header .mobile-options-panel > .app-header-left > .btn{display:flex;align-items:center;justify-content:center;gap:7px;width:100%;min-height:32px;height:auto;padding:6px 10px!important;margin:0!important;border-radius:9px!important;font-size:.75rem;line-height:1.4;white-space:normal;box-shadow:none!important;}
 .app-header .mobile-options-panel > .app-header-right{display:flex;align-items:center;justify-content:space-between;flex-wrap:nowrap;width:100%;min-width:0;margin:0;padding:0;gap:10px;}
 .app-header .mobile-options-panel .header-dots{display:flex;align-items:center;flex-wrap:nowrap;gap:10px;margin:0;padding:0;}
 .app-header .mobile-options-panel .header-dots > .dropdown{margin:0;padding:0;}
 .app-header .mobile-options-panel .header-dots > .dropdown > .btn{display:flex;align-items:center;justify-content:center;margin:0!important;padding:0!important;width:38px;height:38px;min-width:38px;border-radius:11px;}
 .app-header .mobile-options-panel .header-dots .icon-wrapper{width:36px;height:36px;margin:0;}
 .app-header .mobile-options-panel .header-dots .icon-wrapper i{font-size:17px;}
 .app-header .mobile-options-panel .header-btn-lg{display:flex!important;align-items:center;margin:0!important;padding:0!important;padding-inline-start:10px!important;border:0;border-inline-start:1px solid #e3e9f2;}
 .app-header .mobile-options-panel .header-btn-lg .btn-group > a[data-toggle="dropdown"]{display:flex;align-items:center;justify-content:center;gap:6px;min-height:38px;}
 .app-header .mobile-options-panel .header-btn-lg .btn-group > a > img{width:32px;height:32px;object-fit:cover;}
 .app-header .mobile-options-panel .header-btn-lg .btn-group > a > i{margin:0!important;font-size:12px;}
 .app-header .mobile-options-panel .header-user-info{display:none;}
 .app-header .mobile-options-panel .dropdown-menu{max-width:calc(100vw - 32px);min-width:0;border-radius:12px;font-size:.8rem;}
}
