/* =========================================================
   RESPONSIVE FIXES (all pages)
   Loaded last in <head> on every page so it wins over the
   page stylesheets. Keeps text inside its box at every width.
   ========================================================= */

/* Order details: delivery window wraps only between its two times */
.odsl-window-part {
    display: inline;
    white-space: nowrap;
    font: inherit !important;
    color: inherit !important;
}

/* ---------------------------------------------------------
   Orders: status cards (In Progress breakdown was cut off
   at the right edge on laptop widths)
   --------------------------------------------------------- */
.orders-page .orders-reference-status-card,
.orders-page .orders-reference-kpi {
    min-width: 0;
}
.orders-page .orders-reference-status-side > div > span {
    min-width: 0;
}
@media (max-width: 1919.98px) {
    .orders-page .orders-reference-status-card.status-progress .orders-reference-status-side {
        min-width: 0 !important;
        width: auto !important;
        padding-left: 0 !important;
        column-gap: 12px !important;
    }
    .orders-page .orders-reference-status-card.status-progress .orders-reference-status-side > div > span {
        white-space: normal !important;
    }
}

/* ---------------------------------------------------------
   Orders: filter bar. Was a fixed 10-column row that squeezed
   the search box and cut off "Reset Filters" below ~1700px.
   Filters now flow onto as many rows as needed.
   --------------------------------------------------------- */
@media (min-width: 992px) {
    .orders-page .ordersection .ao-table-sort-header {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
    }
    .orders-page .ordersection .ao-table-sort-header > .cc-header-1-col {
        grid-column: span 2;
        margin-bottom: 0 !important;
    }
    .orders-page .ordersection .ao-table-sort-header .select2-container {
        width: 100% !important;
    }
}
@media (min-width: 1700px) {
    .orders-page .ordersection .ao-table-sort-header {
        grid-template-columns: 1.35fr repeat(9, minmax(0, 1fr)) !important;
    }
    .orders-page .ordersection .ao-table-sort-header > .cc-header-1-col {
        grid-column: auto;
    }
}
.orders-page .ordersection .ao-table-sort-header .btn,
.orders-page .ordersection .ao-table-sort-header button {
    white-space: nowrap;
    width: 100%;
}

/* ---------------------------------------------------------
   Orders table on laptops (992-1399px): Location, Customer and
   Wallet were hidden, yet the table still needed a sideways
   scroll. Show every column, scroll the table inside its card
   and keep the Order # column pinned while scrolling.
   --------------------------------------------------------- */
@media (min-width: 992px) and (max-width: 1399.98px) {
    /* responsive.css hid the 3rd, 4th and 8th column of every list
       table on laptops (customer on Orders, name/amount on Finance...) */
    .order-list-table th:nth-child(3),
    .order-list-table td:nth-child(3),
    .order-list-table th:nth-child(4),
    .order-list-table td:nth-child(4),
    .ordersection .order-list-table th:nth-child(8),
    .ordersection .order-list-table td:nth-child(8) {
        display: table-cell;
    }
}
@media (min-width: 992px) {
    .orders-page .order-list-table-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .orders-page .order-list-table > thead > tr > th:first-child,
    .orders-page .order-list-table > tbody > tr > td:first-child {
        position: sticky;
        left: 0;
        z-index: 6;
        background-color: #fff;
        box-shadow: 1px 0 0 #eaecf0;
        min-width: 112px;
        white-space: nowrap;
    }
    .orders-page .order-list-table > thead > tr > th:first-child {
        background-color: inherit;
        z-index: 7;
    }
}
@media (min-width: 992px) and (max-width: 1599.98px) {
    /* room for all 15 columns so cells don't break word by word */
    .orders-page .ordersection .order-list-table {
        min-width: 1560px !important;
    }
}

/* ---------------------------------------------------------
   Tables on every page (Inventory, Categories, Suppliers,
   Supplier details, Finance): wide tables scroll sideways
   inside their own card instead of pushing the whole page
   wider than the screen and hiding the last columns.
   --------------------------------------------------------- */
.crm-right-area,
.crm-page-area {
    min-width: 0;
}
.crm-page-area .row > [class*="col"] {
    min-width: 0;
}
.ad-to-table-holder,
.cc-body-1.ad-to-table-holder,
.ad-to-table-holder .dt-layout-table,
.ad-to-table-holder .dt-layout-cell {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
@media (min-width: 992px) {
    .ad-to-table-holder > table,
    .ad-to-table-holder .dt-layout-cell > table {
        width: 100%;
    }
    .ad-to-table-holder .suppliers-list-table td,
    .ad-to-table-holder .suppliers-list-table th,
    .ad-to-table-holder .orders-table td,
    .ad-to-table-holder .orders-table th {
        vertical-align: middle;
    }
}
@media (min-width: 992px) {
    /* Inventory product table: keep readable column widths, scroll instead */
    #ps-sold-products .ad-to-table-holder > .ps-table-1 {
        min-width: 1400px;
    }
    #ps-sold-products .ps-table-1 > tbody > tr > td:first-child,
    #ps-sold-products .ps-table-1 > thead > tr > th:first-child {
        min-width: 230px;
    }
    /* Suppliers list */
    #supplier-table {
        min-width: 960px;
    }
}

/* Categories table (992-1099px): 2nd column was turned into an
   inline block, which knocked it out of line with its row. */
@media (min-width: 992px) and (max-width: 1099.98px) {
    .orders-table td:nth-child(2) {
        display: table-cell;
        max-width: 200px;
    }
}

/* Native dropdowns: long option text stops before the arrow */
select.form-select,
select.form-control {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}
select.form-select {
    padding-right: 2.1rem !important;
}
/* Date-range pickers stay on one line */
.head-dtp-dropdown {
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
}
.head-dtp-dropdown > span {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------------------------------------------------------
   Bootstrap rows placed directly in a clipped box had their
   right edge (status badges, prices) cut off by a few pixels.
   --------------------------------------------------------- */
.ordersmobile1-status-changes-card > .row,
.ordersmobile1-status-changes-card .row,
#ps-sold-products .ad-to-table-holder > .row,
.my-2 > .overflow-hidden .row,
.card-body-1.row {
    margin-left: 0;
    margin-right: 0;
}

/* Any DataTables table (Categories, Dashboard...) scrolls inside its box */
.dt-container {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Inventory status donut: centre label ("Variations") ran over the ring */
.chart-center-text {
    max-width: 64%;
}
.chart-center-text > span:first-child,
.chart-center-text > span:last-child {
    font-size: 12px !important;
    line-height: 1.15;
    max-width: 100%;
    overflow-wrap: anywhere;
}
.chart-center-text > span:nth-child(2) {
    font-size: clamp(22px, 2.2vw, 32px) !important;
}
@media (max-width: 1199.98px) {
    .chart-center-text > span:first-child,
    .chart-center-text > span:last-child {
        font-size: 10px !important;
    }
    .chart-center-text > span:nth-child(2) {
        font-size: 20px !important;
        margin: 1px 0 !important;
    }
}


/* 2026-12-04: success/error toast shown at the top-centre instead of bottom-right,
   so it never covers the Save/Cancel buttons at the bottom of sliders and modals. */
.toast-container.position-fixed {
    top: 0 !important;
    bottom: auto !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    max-width: 100%;
}

