/* =====================================================================
   Pixels back office: the whole admin design, written for this shop.
   No admin template. Bootstrap 4 is used only for its grid, utilities and
   the behaviour of modals, dropdowns and tabs; every component's look is
   defined here.

   Direction: a well-made piece of computer hardware. Light aluminium
   panels, machined edges (every corner square), one deep blue for actions,
   and status shown as small square indicator lights. The shop's crimson is
   kept for the one action that earns money (New sale) and for counts that
   need someone's attention.

   Type: the IBM Plex family. Plex Sans for everything you read,
   Plex Sans Condensed for page titles and figures, Plex Mono for codes
   (order, invoice and serial numbers).
   ===================================================================== */

:root {
    /* Surfaces */
    --canvas: #EDEFF2;       /* the workspace behind the panels */
    --panel: #FFFFFF;
    --panel-sunk: #F5F6F8;   /* table heads, footers, read-only fields */
    --rule: #D5D9E0;
    --rule-soft: #E6E9ED;

    /* Text */
    --ink: #191D25;
    --text: #2B313C;
    --muted: #5F6876;
    --faint: #8A929E;

    /* Action */
    --primary: #23408F;
    --primary-hover: #1B3274;
    --primary-tint: #E7ECF7;
    --primary-ring: rgba(35, 64, 143, 0.22);

    /* The shop's own colour */
    --brand: #E94560;
    --brand-fill: #C92A47;
    --brand-fill-hover: #AE2340;

    /* Status */
    --ok: #17784F;   --ok-ink: #11603F;   --ok-tint: #E3F2EA;   --ok-line: #B9DCC9;
    --warn: #E09B1F; --warn-ink: #8A5300; --warn-tint: #FBF1DC; --warn-line: #EED3A0;
    --bad: #C0322E;  --bad-ink: #9F2724;  --bad-tint: #F9E6E5;  --bad-line: #EDC1BF;
    --info: #246B93; --info-ink: #1C5677; --info-tint: #E3EFF6; --info-line: #BAD5E6;
    --neutral: #59616E;

    /* Type */
    --font: 'IBM Plex Sans', 'Noto Sans Bengali', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-title: 'IBM Plex Sans Condensed', 'IBM Plex Sans', 'Noto Sans Bengali', system-ui, sans-serif;
    --font-code: 'IBM Plex Mono', 'Noto Sans Bengali', ui-monospace, monospace;

    /* Frame */
    --sidebar-w: 248px;
    --rail-w: 60px;
    --top-h: 56px;
    --appbar-h: 56px;
    --tabbar-h: 62px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --pad: 28px;

    /* Names older page code still uses */
    --brand-tint: var(--primary-tint);
    --admin-primary: var(--primary);
    --admin-secondary: var(--brand);
}

/* ---------------------------------------------------------------------
   Base
   --------------------------------------------------------------------- */

html {
    -webkit-text-size-adjust: 100%;
}

body.bo {
    margin: 0;
    background: var(--canvas);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Pages and plugins that name a font of their own get the house face */
body.bo .card, body.bo .btn, body.bo input, body.bo select, body.bo textarea, body.bo button,
body.bo .dropdown-menu, body.bo .modal, body.bo .tooltip, body.bo .popover, body.bo table,
body.bo .swal2-popup, body.bo #toast-container, body.bo .select2-container {
    font-family: var(--font);
}

body.bo h1, body.bo h2, body.bo h3, body.bo h4, body.bo h5, body.bo h6,
body.bo .h1, body.bo .h2, body.bo .h3, body.bo .h4, body.bo .h5, body.bo .h6 {
    color: var(--ink);
    font-family: var(--font);
    font-weight: 600;
    letter-spacing: -0.005em;
    line-height: 1.25;
}

body.bo h1, body.bo .h1 { font-size: 1.75rem; }
body.bo h2, body.bo .h2 { font-size: 1.45rem; }
body.bo h3, body.bo .h3 { font-size: 1.2rem; }
body.bo h4, body.bo .h4 { font-size: 1.07rem; }
body.bo h5, body.bo .h5 { font-size: 1rem; }
body.bo h6, body.bo .h6 { font-size: 0.9rem; }

body.bo a { color: var(--primary); }
body.bo a:hover { color: var(--primary-hover); }

body.bo hr { border-top-color: var(--rule-soft); }

body.bo small, body.bo .small { font-size: 12.5px; }

body.bo :focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Figures line up in columns */
body.bo .table, body.bo .small-box h3, body.bo .info-box-number, body.bo .badge,
body.bo .stat-number, body.bo .currency {
    font-variant-numeric: tabular-nums;
}

/* Codes: order, invoice, serial, account numbers */
body.bo code, body.bo kbd, body.bo pre, body.bo samp,
body.bo .mono-text, body.bo .code-num, body.bo .order-num, body.bo .po-num,
body.bo .supplier-code, body.bo .movement-num, body.bo .account-num, body.bo .transaction-num,
body.bo .expense-num, body.bo .warranty-code, body.bo .claim-num, body.bo .barcode-code,
body.bo .date-text, body.bo .date-val {
    font-family: var(--font-code) !important;
    font-weight: 400;
    letter-spacing: 0;
}

/* Prices and quantities that pages mark as "mono": the text face with figures that line up.
   The typewriter face is kept for codes only. */
body.bo .font-mono {
    font-family: var(--font) !important;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}

/* Bold reads as semibold in this face: strong enough, never shouting */
body.bo .font-weight-bold,
body.bo .fw-bold {
    font-weight: 600 !important;
}

body.bo code {
    color: var(--ink);
    background: var(--panel-sunk);
    border: 1px solid var(--rule-soft);
    padding: 1px 5px;
    font-size: 0.88em;
}

/* ---------- Square edges everywhere ----------
   The class is repeated on purpose: it lifts this rule above the stronger selectors that
   some pages use in their own style blocks. Radio buttons and loading spinners stay round,
   because their shape is how they are recognised. */
html body.bo.bo.bo.bo:not(.bo-admin):not(.auth) *,
html body.bo.bo.bo.bo:not(.bo-admin):not(.auth) *::before,
html body.bo.bo.bo.bo:not(.bo-admin):not(.auth) *::after {
    border-radius: 0 !important;
}

html body.bo.bo.bo.bo input[type="radio"],
html body.bo.bo.bo.bo .custom-radio .custom-control-label::before,
html body.bo.bo.bo.bo .custom-radio .custom-control-label::after,
html body.bo.bo.bo.bo .spinner-border,
html body.bo.bo.bo.bo .spinner-grow {
    border-radius: 50% !important;
}

/* Flat panels: depth comes from edges, not drop shadows. Only things that float above the
   page (menus, dialogs, notices) cast a shadow. */
body.bo:not(.bo-admin) .shadow-sm, body.bo:not(.bo-admin) .shadow, body.bo:not(.bo-admin) .shadow-lg {
    box-shadow: none !important;
}

/* ---------------------------------------------------------------------
   Frame: sidebar, top bar, page
   --------------------------------------------------------------------- */

.bo-side {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1032;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border-right: 1px solid var(--rule);
}

.bo-frame {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Brand */
.side-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--top-h);
    flex: 0 0 auto;
    padding: 0 16px;
    border-bottom: 1px solid var(--rule-soft);
    color: var(--ink) !important;
    text-decoration: none !important;
    overflow: hidden;
}

.side-brand-mark {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    background: var(--ink);
    color: #fff;
    font-family: var(--font-title);
    font-weight: 600;
    font-size: 16px;
    box-shadow: inset 0 -3px 0 var(--brand);
}

.side-brand-words {
    min-width: 0;
    line-height: 1.15;
}

.side-brand-words strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.side-brand-words small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

/* New sale */
.side-sale {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 0 0 auto;
    margin: 14px 12px 6px;
    min-height: 40px;
    background: var(--brand-fill);
    color: #fff !important;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
    overflow: hidden;
}

.side-sale:hover { background: var(--brand-fill-hover); }

/* Menu */
.side-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px 0 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--rule) transparent;
}

.side-sep {
    height: 1px;
    margin: 8px 18px;
    background: var(--rule-soft);
}

.side-label {
    padding: 14px 20px 6px;
    color: var(--faint);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.side-link,
.side-group-head {
    display: flex;
    align-items: center;
    gap: 12px;
    width: calc(100% - 16px);
    min-height: 36px;
    margin: 1px 8px;
    padding: 6px 10px;
    border: 0;
    background: transparent;
    color: var(--text) !important;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    text-align: left;
    text-decoration: none !important;
    cursor: pointer;
}

.side-link > i,
.side-group-head > i:first-child {
    flex: 0 0 18px;
    width: 18px;
    text-align: center;
    color: var(--faint);
    font-size: 15px;
}

.side-link > span,
.side-group-head > span {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.side-link:hover,
.side-group-head:hover {
    background: var(--panel-sunk);
    color: var(--ink) !important;
}

.side-link:hover > i,
.side-group-head:hover > i:first-child {
    color: var(--muted);
}

.side-chevron {
    flex: 0 0 auto;
    color: var(--faint);
    font-size: 11px;
    transition: transform 0.15s ease;
}

.side-group.open > .side-group-head .side-chevron {
    transform: rotate(90deg);
}

.side-group-items {
    display: none;
    padding: 2px 0 6px;
}

.side-group.open > .side-group-items {
    display: block;
}

.side-group-items .side-link {
    min-height: 32px;
    padding-left: 40px;
    font-size: 13.5px;
    font-weight: 400;
}

/* The page you are on: a lit edge, like an indicator on a front panel */
.side-link.active {
    background: var(--primary-tint);
    color: var(--primary) !important;
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--primary);
}

.side-link.active > i {
    color: var(--primary);
}

.side-group.has-active > .side-group-head {
    color: var(--ink) !important;
    font-weight: 600;
}

.side-group.has-active > .side-group-head > i:first-child {
    color: var(--primary);
}

/* Counts that need attention */
.side-count,
.top-count {
    flex: 0 0 auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: inline-grid;
    place-items: center;
    background: var(--brand-fill);
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* Elements that exist only in the phone layout */
.sheet-head,
.tabbar,
.sheet-backdrop {
    display: none;
}

/* Top bar */
.bo-top {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: 6px;
    height: var(--top-h);
    padding: 0 16px 0 12px;
    background: var(--panel);
    border-bottom: 1px solid var(--rule);
}

/* The page title lives in the top bar: the one loud piece of type on every screen */
.top-title {
    flex: 0 1 auto;
    min-width: 0;
    margin: 0 0 0 6px;
    color: var(--ink) !important;
    font-family: var(--font-title) !important;
    font-size: 22px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    letter-spacing: -0.005em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-spacer { flex: 1 1 auto; }

.top-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted) !important;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none !important;
    cursor: pointer;
}

.top-btn:hover,
.top-btn[aria-expanded="true"] {
    background: var(--panel-sunk);
    border-color: var(--rule-soft);
    color: var(--ink) !important;
}

.top-btn > i { font-size: 16px; }

.top-btn .top-count {
    position: absolute;
    top: 2px;
    right: 0;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    font-size: 10.5px;
}

.top-user {
    padding: 0 8px 0 4px;
    margin-left: 6px;
    height: 44px;
}

.user-initials {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    background: var(--primary-tint);
    color: var(--primary);
    font-weight: 600;
    font-size: 13px;
}

.user-chip-text {
    text-align: left;
    line-height: 1.15;
}

.user-chip-text strong {
    display: block;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 600;
}

.user-chip-text small {
    color: var(--muted);
    font-size: 12px;
}

/* Page */
.bo-main {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: clip;   /* grid rows can round a pixel past the edge */
}

/* Under the top bar, one line: the breadcrumb on the left, the page's buttons on the right */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 20px;
    min-height: 64px;
    padding: 14px var(--pad);
}

.page-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 13px;
}

.page-crumbs li + li::before {
    content: "/";
    margin-right: 6px;
    color: var(--faint);
}

.page-crumbs a {
    color: var(--muted);
}

.page-crumbs a:hover {
    color: var(--primary);
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.page-actions:empty {
    display: none;
}

.page-actions > form {
    margin: 0;
}

.page-body {
    padding: 0 var(--pad) 36px;
}

/* Pages wrap themselves in their own padded container; the page frame already has the
   margins, so content lines up with the title */
.page-body > .container-fluid,
.page-body > .container,
.page-body > .container-fluid > .container-fluid {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

.page-body > .container-fluid.pt-3,
.page-body > .container-fluid.pt-4,
.page-body > .container-fluid.py-3,
.page-body > .container-fluid.py-4 {
    padding-top: 0 !important;
}

/* Wide tables scroll inside their panel instead of pushing the page sideways */
.page-body .dataTables_wrapper > .row > [class*="col-"],
.page-body .card-body {
    min-width: 0;
}

.page-body .dataTables_wrapper > .row:nth-child(2) > [class*="col-"] {
    overflow-x: auto;
}

/* ---------- Sidebar width: drag the edge (kept for the signed-in session) ---------- */

.sidebar-resizer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: calc(var(--sidebar-w) - 4px);
    z-index: 1033;
    width: 8px;
    cursor: col-resize;
    touch-action: none;
}

.sidebar-resizer::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 3px;
    width: 2px;
    background: transparent;
    transition: background-color 0.15s ease;
}

.sidebar-resizer:hover::after,
.sidebar-resizer.dragging::after,
.sidebar-resizer:focus-visible::after {
    background: var(--primary);
}

.sidebar-resizer:focus-visible {
    outline: none;
}

body.resizing,
body.resizing * {
    cursor: col-resize !important;
    user-select: none !important;
    transition: none !important;
}

/* ---------- Narrow menu: icons only (desktop) ---------- */

@media (min-width: 992px) {
    html.rail .bo-side { width: var(--rail-w); }
    html.rail .bo-frame { margin-left: var(--rail-w); }
    html.rail .sidebar-resizer { display: none; }

    html.rail .side-brand { padding: 0; justify-content: center; }
    html.rail .side-brand-words,
    html.rail .side-label,
    html.rail .side-link > span,
    html.rail .side-group-head > span,
    html.rail .side-chevron,
    html.rail .side-sale > span,
    html.rail .side-group-items { display: none !important; }

    html.rail .side-sale { margin: 12px 10px 6px; padding: 0; }
    html.rail .side-link,
    html.rail .side-group-head { justify-content: center; padding: 6px 0; }
    html.rail .side-link .side-count { position: absolute; transform: translate(12px, -10px); min-width: 16px; height: 16px; font-size: 10px; }
    html.rail .side-link { position: relative; }
}

/* ---------------------------------------------------------------------
   Panels (cards)
   --------------------------------------------------------------------- */

body.bo .card {
    margin-bottom: 20px;
    background: var(--panel);
    border: 1px solid var(--rule);
    box-shadow: none;
    overflow: visible;
}

/* Every panel has its edge, also where a page asked for a borderless card */
body.bo .card.border-0 {
    border: 1px solid var(--rule) !important;
}

body.bo .card > .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    min-height: 50px;
    padding: 10px 18px;
    background: var(--panel) !important;
    border-bottom: 1px solid var(--rule-soft);
    color: var(--ink) !important;
}

body.bo .card > .card-header > .d-flex,
body.bo .card > .card-header > .row {
    flex: 1 1 100%;
}

body.bo .card > .card-header::after {
    display: none;
}

body.bo .card-title,
body.bo .card-header h1, body.bo .card-header h2, body.bo .card-header h3,
body.bo .card-header h4, body.bo .card-header h5, body.bo .card-header h6 {
    margin: 0;
    color: var(--ink) !important;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}

body.bo .card-title i,
body.bo .card-header h1 i, body.bo .card-header h2 i, body.bo .card-header h3 i,
body.bo .card-header h4 i, body.bo .card-header h5 i, body.bo .card-header h6 i {
    color: var(--muted) !important;
}

body.bo .card-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

body.bo .card-body {
    padding: 18px;
}

body.bo .card > .card-footer {
    padding: 12px 18px;
    background: var(--panel-sunk) !important;
    border-top: 1px solid var(--rule-soft);
}

/* A coloured heading strip becomes a calm heading with a coloured top edge */
body.bo .card > .card-header[class*="bg-"]:not(.bg-white):not(.bg-light):not(.bg-transparent) {
    color: var(--ink) !important;
}

body.bo .card:has(> .card-header.bg-primary), body.bo .card.card-primary:not(.card-outline), body.bo .card.card-outline.card-primary { border-top: 3px solid var(--primary); }
body.bo .card:has(> .card-header.bg-success), body.bo .card.card-success:not(.card-outline), body.bo .card.card-outline.card-success { border-top: 3px solid var(--ok); }
body.bo .card:has(> .card-header.bg-warning), body.bo .card.card-warning:not(.card-outline), body.bo .card.card-outline.card-warning { border-top: 3px solid var(--warn); }
body.bo .card:has(> .card-header.bg-danger), body.bo .card.card-danger:not(.card-outline), body.bo .card.card-outline.card-danger { border-top: 3px solid var(--bad); }
body.bo .card:has(> .card-header.bg-info), body.bo .card.card-info:not(.card-outline), body.bo .card.card-outline.card-info { border-top: 3px solid var(--info); }
body.bo .card:has(> .card-header.bg-secondary), body.bo .card.card-secondary:not(.card-outline), body.bo .card.card-outline.card-secondary { border-top: 3px solid var(--neutral); }
body.bo .card:has(> .card-header.bg-dark) { border-top: 3px solid var(--ink); }

body.bo .card > .card-header.text-white *,
body.bo .card > .card-header[class*="bg-gradient"] * {
    color: var(--ink) !important;
}

/* Cards that pages make clickable or lift on hover stay where they are */
body.bo .card:hover,
body.bo .small-box:hover,
body.bo .info-box:hover {
    transform: none !important;
}

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */

body.bo .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 6px 14px;
    border: 1px solid transparent;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    box-shadow: none !important;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

body.bo .btn i { line-height: 1; }
body.bo .btn i.mr-1, body.bo .btn i.mr-2, body.bo .btn i.me-1, body.bo .btn i.me-2,
body.bo .btn i.ml-1, body.bo .btn i.ml-2 { margin: 0 !important; }

body.bo .btn-block { display: flex; width: 100%; }

body.bo .btn-lg { min-height: 44px; padding: 9px 20px; font-size: 15.5px; }
body.bo .btn-sm { min-height: 30px; padding: 4px 10px; font-size: 13px; gap: 5px; }
body.bo .btn-xs { min-height: 26px; padding: 2px 8px; font-size: 12px; gap: 4px; }

body.bo .btn:focus,
body.bo .btn.focus {
    box-shadow: none !important;
}

body.bo .btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

body.bo .btn:disabled,
body.bo .btn.disabled {
    opacity: 0.5;
}

body.bo .btn-primary, body.bo .btn-primary:not(:disabled):not(.disabled):active { background: var(--primary) !important; border-color: var(--primary) !important; color: #fff !important; }
body.bo .btn-primary:hover { background: var(--primary-hover) !important; border-color: var(--primary-hover) !important; }

body.bo .btn-success { background: var(--ok) !important; border-color: var(--ok) !important; color: #fff !important; }
body.bo .btn-success:hover { background: var(--ok-ink) !important; border-color: var(--ok-ink) !important; }

body.bo .btn-danger { background: var(--bad) !important; border-color: var(--bad) !important; color: #fff !important; }
body.bo .btn-danger:hover { background: var(--bad-ink) !important; border-color: var(--bad-ink) !important; }

body.bo .btn-warning { background: var(--warn) !important; border-color: var(--warn) !important; color: #2A1A00 !important; }
body.bo .btn-warning:hover { background: #C98710 !important; border-color: #C98710 !important; }

body.bo .btn-info { background: var(--info) !important; border-color: var(--info) !important; color: #fff !important; }
body.bo .btn-info:hover { background: var(--info-ink) !important; border-color: var(--info-ink) !important; }

body.bo .btn-dark { background: var(--ink) !important; border-color: var(--ink) !important; color: #fff !important; }

/* Secondary actions are quiet: a panel with an edge */
body.bo .btn-secondary,
body.bo .btn-light,
body.bo .btn-default,
body.bo .btn-white,
body.bo .btn-outline-secondary,
body.bo .btn-outline-dark,
body.bo .btn-outline-light {
    background: var(--panel) !important;
    border-color: var(--rule) !important;
    color: var(--ink) !important;
}

body.bo .btn-secondary:hover,
body.bo .btn-light:hover,
body.bo .btn-default:hover,
body.bo .btn-white:hover,
body.bo .btn-outline-secondary:hover,
body.bo .btn-outline-dark:hover,
body.bo .btn-outline-light:hover {
    background: var(--panel-sunk) !important;
    border-color: #BFC5CF !important;
}

body.bo .btn-outline-primary { background: var(--panel) !important; border-color: var(--primary) !important; color: var(--primary) !important; }
body.bo .btn-outline-success { background: var(--panel) !important; border-color: var(--ok-line) !important; color: var(--ok) !important; }
body.bo .btn-outline-warning { background: var(--panel) !important; border-color: var(--warn-line) !important; color: var(--warn-ink) !important; }
body.bo .btn-outline-danger  { background: var(--panel) !important; border-color: var(--bad-line) !important; color: var(--bad) !important; }
body.bo .btn-outline-info    { background: var(--panel) !important; border-color: var(--info-line) !important; color: var(--info) !important; }

body.bo .btn-outline-primary:hover, body.bo .btn-outline-primary.active { background: var(--primary) !important; color: #fff !important; }
body.bo .btn-outline-success:hover, body.bo .btn-outline-success.active { background: var(--ok) !important; border-color: var(--ok) !important; color: #fff !important; }
body.bo .btn-outline-warning:hover, body.bo .btn-outline-warning.active { background: var(--warn) !important; border-color: var(--warn) !important; color: #2A1A00 !important; }
body.bo .btn-outline-danger:hover,  body.bo .btn-outline-danger.active  { background: var(--bad) !important; border-color: var(--bad) !important; color: #fff !important; }
body.bo .btn-outline-info:hover,    body.bo .btn-outline-info.active    { background: var(--info) !important; border-color: var(--info) !important; color: #fff !important; }

body.bo .btn-link { color: var(--primary) !important; background: transparent !important; }

/* New sale, wherever it appears */
body.bo .btn-sale { background: var(--brand-fill) !important; border-color: var(--brand-fill) !important; color: #fff !important; }
body.bo .btn-sale:hover { background: var(--brand-fill-hover) !important; border-color: var(--brand-fill-hover) !important; }

/* A card's own small icon buttons */
body.bo .btn-tool {
    min-height: 28px;
    padding: 2px 8px;
    background: transparent !important;
    color: var(--muted) !important;
}

body.bo .btn-tool:hover { color: var(--ink) !important; background: var(--panel-sunk) !important; }

/* Row actions in lists (view, edit, delete ...): quiet square icon buttons whose icon
   carries the colour, instead of a row of solid coloured blocks */
body.bo td .btn-sm:not([class*="btn-outline"]),
body.bo td .btn-xs:not([class*="btn-outline"]),
body.bo td .btn-circle,
body.bo td .action-circle {
    background: var(--panel) !important;
    border: 1px solid var(--rule) !important;
}

body.bo td .btn-sm.btn-primary, body.bo td .btn-xs.btn-primary, body.bo td .btn-circle.btn-primary, body.bo td .action-circle.btn-primary { color: var(--primary) !important; }
body.bo td .btn-sm.btn-info, body.bo td .btn-xs.btn-info, body.bo td .btn-circle.btn-info, body.bo td .action-circle.btn-info { color: var(--info) !important; }
body.bo td .btn-sm.btn-success, body.bo td .btn-xs.btn-success, body.bo td .btn-circle.btn-success, body.bo td .action-circle.btn-success { color: var(--ok) !important; }
body.bo td .btn-sm.btn-warning, body.bo td .btn-xs.btn-warning, body.bo td .btn-circle.btn-warning, body.bo td .action-circle.btn-warning { color: var(--warn-ink) !important; }
body.bo td .btn-sm.btn-danger, body.bo td .btn-xs.btn-danger, body.bo td .btn-circle.btn-danger, body.bo td .action-circle.btn-danger { color: var(--bad) !important; }
body.bo td .btn-sm.btn-secondary, body.bo td .btn-xs.btn-secondary, body.bo td .btn-circle.btn-secondary, body.bo td .action-circle.btn-secondary { color: var(--neutral) !important; }
body.bo td .btn-sm.btn-dark, body.bo td .btn-xs.btn-dark { color: var(--ink) !important; }

body.bo td .btn-sm:not([class*="btn-outline"]):hover,
body.bo td .btn-xs:not([class*="btn-outline"]):hover,
body.bo td .btn-circle:hover,
body.bo td .action-circle:hover {
    background: var(--panel-sunk) !important;
    border-color: #BFC5CF !important;
}

body.bo .btn-group > .btn + .btn { margin-left: -1px; }

/* Square icon buttons in list rows (pages call them action-circle or btn-circle) */
body.bo .action-circle,
body.bo .btn-circle {
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0 !important;
    font-size: 13px;
    transform: none !important;
}

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */

body.bo label,
body.bo .col-form-label {
    margin-bottom: 6px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
}

body.bo .custom-control-label,
body.bo .form-check-label {
    font-size: 14px;
    font-weight: 400;
    color: var(--text);
}

body.bo .form-group { margin-bottom: 16px; }

body.bo .form-control,
body.bo .custom-select {
    height: 38px;
    padding: 7px 11px;
    background-color: var(--panel);
    border: 1px solid var(--rule);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
    box-shadow: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

body.bo textarea.form-control { height: auto; min-height: 76px; }

/* A field without an edge reads as plain text; pages that ask for borderless fields get the edge back */
body.bo .form-control.border-0,
body.bo .custom-select.border-0,
body.bo .input-group-text.border-0 {
    border: 1px solid var(--rule) !important;
}

body.bo .input-group > .input-group-prepend > .input-group-text + *,
body.bo .input-group > .input-group-prepend + .form-control { margin-left: -1px; }
body.bo select.form-control[multiple], body.bo select.form-control[size] { height: auto; }

body.bo .form-control-sm, body.bo .custom-select-sm { height: 32px; padding: 4px 9px; font-size: 13px; }
body.bo .form-control-lg, body.bo .custom-select-lg { height: 46px; padding: 9px 14px; font-size: 16px; }

body.bo .form-control::placeholder { color: var(--faint); opacity: 1; }

body.bo .form-control:hover:not(:focus):not(:disabled):not([readonly]),
body.bo .custom-select:hover:not(:focus) {
    border-color: #BCC3CD;
}

body.bo .form-control:focus,
body.bo .custom-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-ring) !important;
    outline: none;
}

body.bo .form-control:disabled,
body.bo .form-control[readonly],
body.bo .custom-select:disabled {
    background-color: var(--panel-sunk);
    color: var(--muted);
}

body.bo .form-control.is-invalid,
body.bo .was-validated .form-control:invalid { border-color: var(--bad) !important; }
body.bo .form-control.is-valid { border-color: var(--ok) !important; }
body.bo .invalid-feedback, body.bo .field-validation-error, body.bo .text-danger.field-validation-error { color: var(--bad); font-size: 12.5px; }
body.bo .validation-summary-errors ul { margin: 0; padding-left: 18px; }

body.bo .form-text { color: var(--muted); font-size: 12.5px; }

body.bo .input-group-text {
    background: var(--panel-sunk);
    border-color: var(--rule);
    color: var(--muted);
    font-size: 14px;
}

body.bo .input-group > .form-control,
body.bo .input-group > .custom-select { height: 38px; }
body.bo .input-group-sm > .form-control { height: 32px; }
body.bo .input-group > .input-group-append > .btn,
body.bo .input-group > .input-group-prepend > .btn { min-height: 38px; }
body.bo .input-group-sm > .input-group-append > .btn,
body.bo .input-group-sm > .input-group-prepend > .btn { min-height: 32px; }

/* Checkboxes, radios, switches */
body.bo .custom-control-label::before {
    border-color: #AEB6C2;
    background: var(--panel);
    box-shadow: none !important;
}

body.bo .custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

body.bo .custom-control-input:focus-visible ~ .custom-control-label::before {
    box-shadow: 0 0 0 3px var(--primary-ring) !important;
}

body.bo .custom-switch .custom-control-label::after {
    background-color: #8C95A2;
}

body.bo .custom-switch .custom-control-input:checked ~ .custom-control-label::after {
    background-color: #fff;
}

body.bo .custom-file-label {
    height: 38px;
    border-color: var(--rule);
    color: var(--muted);
    font-size: 14px;
}

body.bo .custom-file-label::after {
    height: 36px;
    background: var(--panel-sunk);
    color: var(--ink);
    font-weight: 500;
}

/* Select2 (searchable dropdowns) */
body.bo .select2-container .select2-selection--single {
    height: 38px !important;
    padding: 0 !important;
    border: 1px solid var(--rule) !important;
    background: var(--panel) !important;
}

body.bo .select2-container .select2-selection--single .select2-selection__rendered {
    padding: 0 30px 0 11px !important;
    line-height: 36px !important;
    color: var(--ink) !important;
    font-size: 14px;
}

body.bo .select2-container .select2-selection--single .select2-selection__placeholder { color: var(--faint) !important; }

body.bo .select2-container .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
    right: 4px !important;
}

body.bo .select2-container .select2-selection--multiple {
    min-height: 38px;
    border: 1px solid var(--rule) !important;
}

body.bo .select2-container .select2-selection--multiple .select2-selection__choice {
    background: var(--primary-tint);
    border: 1px solid #C9D3EC;
    color: var(--primary);
}

body.bo .select2-container--focus .select2-selection,
body.bo .select2-container--open .select2-selection {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-ring);
}

body.bo .select2-dropdown {
    border: 1px solid var(--rule) !important;
    box-shadow: 0 10px 28px rgba(25, 29, 37, 0.14);
    font-size: 14px;
}

body.bo .select2-search--dropdown .select2-search__field {
    height: 34px;
    padding: 4px 9px;
    border: 1px solid var(--rule) !important;
}

body.bo .select2-results__options {
    max-height: 260px !important;
    overflow-y: auto !important;
}

body.bo .select2-results__option { padding: 7px 11px; }

body.bo .select2-container .select2-results__option--highlighted[aria-selected],
body.bo .select2-container .select2-results__option--highlighted {
    background: var(--primary) !important;
    color: #fff !important;
}

body.bo .select2-container .select2-results__option[aria-selected="true"]:not(.select2-results__option--highlighted) {
    background: var(--primary-tint);
    color: var(--primary);
}

body.bo .input-group > .select2-container {
    flex: 1 1 auto !important;
    width: 1% !important;
}

/* ---------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------- */

body.bo .table {
    margin-bottom: 0;
    color: var(--text);
    font-size: 14px;
}

body.bo .table thead th,
body.bo .table > thead > tr > td {
    padding: 10px 12px !important;
    background: var(--panel-sunk) !important;
    color: var(--muted) !important;
    border-top: 0 !important;
    border-bottom: 1px solid var(--rule) !important;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0 !important;
    text-transform: none !important;
    white-space: nowrap;
    vertical-align: middle;
}

/* Coloured or dark table heads are neutral too: the data is what matters */
body.bo .table thead[class*="bg-"],
body.bo .table thead.thead-dark,
body.bo .table thead.text-white,
body.bo .table thead.text-uppercase,
body.bo .table thead tr[class*="bg-"] {
    background: var(--panel-sunk) !important;
    color: var(--muted) !important;
    text-transform: none !important;
}

body.bo .table td,
body.bo .table th {
    padding: 8px 12px;
    border-top: 1px solid var(--rule-soft);
    vertical-align: middle;
    line-height: 1.4;
}

body.bo .table td.py-3, body.bo .table td.py-4, body.bo .table td.p-3, body.bo .table td.p-4 {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

body.bo .table td .small, body.bo .table td small {
    font-size: 12.5px;
}

/* Pictures in list rows: one compact size */
body.bo .table td [style*="width: 45px"][style*="height: 45px"],
body.bo .table td [style*="width: 50px"][style*="height: 50px"],
body.bo .table td [style*="width: 60px"][style*="height: 60px"],
body.bo .table td [style*="width:50px"][style*="height:50px"] {
    width: 36px !important;
    height: 36px !important;
    padding: 2px !important;
}

/* DataTables shades a hovered or striped row cell by cell, which lit only part of a row */
body.bo table.dataTable > tbody > tr > *,
body.bo table.dataTable.table-hover > tbody > tr:hover > *,
body.bo table.dataTable.table-striped > tbody > tr.odd > *,
body.bo table.dataTable > tbody > tr.selected > * {
    box-shadow: none !important;
}

body.bo .table-hover > tbody > tr:hover > td {
    background: transparent;
}

body.bo .table-sm td, body.bo .table-sm th,
body.bo .table-sm thead th { padding: 6px 10px; }

body.bo .table-bordered, body.bo .table-bordered td, body.bo .table-bordered th { border-color: var(--rule-soft); }

body.bo .table-striped tbody tr:nth-of-type(odd) { background: #FAFBFC; }

body.bo .table-hover tbody tr:hover,
body.bo .table tbody tr.hover-float-row:hover {
    background: #F4F6FA !important;
    color: inherit;
    transform: none !important;
    box-shadow: none !important;
}

body.bo .table tfoot td, body.bo .table tfoot th {
    background: var(--panel-sunk);
    border-top: 1px solid var(--rule);
    color: var(--ink);
    font-weight: 600;
}

body.bo .table-valign-middle td, body.bo .table-valign-middle th { vertical-align: middle; }

body.bo .table-active, body.bo .table-active > td { background: var(--primary-tint) !important; }
body.bo .table-success, body.bo .table-success > td { background: var(--ok-tint) !important; }
body.bo .table-warning, body.bo .table-warning > td { background: var(--warn-tint) !important; }
body.bo .table-danger, body.bo .table-danger > td { background: var(--bad-tint) !important; }
body.bo .table-info, body.bo .table-info > td { background: var(--info-tint) !important; }

body.bo .card-body.p-0 > .table,
body.bo .card-body.p-0 > .table-responsive > .table { border: 0; }

/* DataTables controls */
body.bo .dataTables_wrapper { font-size: 13.5px; }

body.bo .dataTables_wrapper .dataTables_length label,
body.bo .dataTables_wrapper .dataTables_filter label {
    color: var(--muted);
    font-weight: 500;
    font-size: 13px;
}

body.bo .dataTables_wrapper .dataTables_filter input,
body.bo .dataTables_wrapper .dataTables_length select {
    height: 34px;
    padding: 4px 9px;
    border: 1px solid var(--rule);
    font-size: 13.5px;
}

body.bo .dataTables_wrapper .dataTables_filter input { width: 220px; margin-left: 8px; }
body.bo .dataTables_wrapper .dataTables_length select { width: auto; min-width: 72px; padding-right: 28px; margin: 0 6px; background-position: right 8px center; }

body.bo .dataTables_wrapper .dataTables_info {
    color: var(--muted);
    font-size: 13px;
    padding-top: 14px;
}

body.bo .dataTables_wrapper > .row:first-child,
body.bo .dataTables_wrapper > .row:last-child { margin: 0; padding: 12px 4px; }

body.bo .card-body.p-0 .dataTables_wrapper > .row:first-child,
body.bo .card-body.p-0 .dataTables_wrapper > .row:last-child { padding: 12px 18px; }

body.bo table.dataTable { margin-top: 0 !important; margin-bottom: 0 !important; }

body.bo table.dataTable thead .sorting::before, body.bo table.dataTable thead .sorting::after,
body.bo table.dataTable thead .sorting_asc::before, body.bo table.dataTable thead .sorting_asc::after,
body.bo table.dataTable thead .sorting_desc::before, body.bo table.dataTable thead .sorting_desc::after {
    font-size: 10px;
}

/* Lists run edge to edge inside their panel; search and paging sit in strips above and below */
body.bo .card-body:has(> .dataTables_wrapper),
body.bo .card-body:has(> .table-responsive > .dataTables_wrapper),
body.bo .card-body:has(> .table-responsive:only-child),
body.bo .card-body:has(> table.table:only-child) {
    padding: 0 !important;
}

body.bo .card .dataTables_wrapper > .row {
    margin: 0 !important;
}

body.bo .card .dataTables_wrapper > .row > [class*="col-"] {
    padding: 0;
}

body.bo .card .dataTables_wrapper > .row:first-child {
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--rule-soft);
}

body.bo .card .dataTables_wrapper > .row:last-child {
    align-items: center;
    padding: 10px 18px;
    border-top: 1px solid var(--rule-soft);
}

body.bo .card .dataTables_wrapper .dataTables_info { padding-top: 0; }
body.bo .card .dataTables_wrapper .dataTables_paginate { margin: 0; }
body.bo .card .dataTables_wrapper .dataTables_paginate .pagination { margin: 0; justify-content: flex-end; }

body.bo .dataTables_wrapper .dataTables_length label,
body.bo .dataTables_wrapper .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

body.bo .dataTables_wrapper .dataTables_length select,
body.bo .dataTables_wrapper .dataTables_filter input { margin: 0 !important; }

body.bo .card .table > thead > tr > th:first-child,
body.bo .card .table > tbody > tr > td:first-child,
body.bo .card .table > tfoot > tr > *:first-child { padding-left: 18px !important; }

body.bo .card .table > thead > tr > th:last-child,
body.bo .card .table > tbody > tr > td:last-child,
body.bo .card .table > tfoot > tr > *:last-child { padding-right: 18px !important; }

body.bo .card .table > thead > tr > th { border-top: 0 !important; }

/* Paging */
body.bo .pagination { gap: 4px; }

body.bo .page-link {
    min-width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0 10px;
    margin: 0 !important;
    border: 1px solid var(--rule);
    background: var(--panel);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 500;
}

body.bo .page-link:hover { background: var(--panel-sunk); color: var(--ink); border-color: #BFC5CF; }
body.bo .page-link:focus { box-shadow: 0 0 0 3px var(--primary-ring); }

body.bo .page-item.active .page-link,
body.bo .dataTables_wrapper .paginate_button.current .page-link {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}

body.bo .page-item.disabled .page-link { color: var(--faint); background: var(--panel); }

/* ---------------------------------------------------------------------
   Status: badges as indicator lights, alerts
   --------------------------------------------------------------------- */

body.bo .badge {
    --led: var(--neutral);
    font-family: var(--font) !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0;
    white-space: nowrap;
    vertical-align: middle;
}

body.bo .badge-primary   { --led: var(--primary); background: var(--primary-tint) !important; color: var(--primary) !important; }
body.bo .badge-success   { --led: var(--ok);      background: var(--ok-tint) !important;      color: var(--ok-ink) !important; }
body.bo .badge-warning   { --led: var(--warn);    background: var(--warn-tint) !important;    color: var(--warn-ink) !important; }
body.bo .badge-danger    { --led: var(--bad);     background: var(--bad-tint) !important;     color: var(--bad-ink) !important; }
body.bo .badge-info      { --led: var(--info);    background: var(--info-tint) !important;    color: var(--info-ink) !important; }
body.bo .badge-secondary { --led: var(--neutral); background: #ECEEF1 !important;             color: var(--neutral) !important; }
body.bo .badge-light     { --led: var(--faint);   background: var(--panel-sunk) !important;   color: var(--text) !important; box-shadow: inset 0 0 0 1px var(--rule-soft); }
body.bo .badge-dark      { --led: #fff;           background: var(--ink) !important;          color: #fff !important; }

/* In lists, a status reads like a front-panel light: a lit square, then the word */
body.bo td .badge:not(:empty)::before,
body.bo .badge.led::before {
    content: "";
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    background: var(--led);
}

body.bo td .badge:has(> i)::before { display: none; }

body.bo .alert {
    padding: 12px 16px;
    border: 1px solid var(--rule);
    border-left-width: 3px;
    background: var(--panel);
    color: var(--text);
    font-size: 14px;
}

body.bo .alert-success { background: var(--ok-tint);   border-color: var(--ok-line);   border-left-color: var(--ok);   color: var(--ok-ink); }
body.bo .alert-warning { background: var(--warn-tint); border-color: var(--warn-line); border-left-color: var(--warn); color: #5E3B00; }
body.bo .alert-danger  { background: var(--bad-tint);  border-color: var(--bad-line);  border-left-color: var(--bad);  color: var(--bad-ink); }
body.bo .alert-info    { background: var(--info-tint); border-color: var(--info-line); border-left-color: var(--info); color: var(--info-ink); }
body.bo .alert-primary { background: var(--primary-tint); border-color: #C9D3EC; border-left-color: var(--primary); color: var(--primary); }
body.bo .alert-secondary, body.bo .alert-light { background: var(--panel); border-color: var(--rule); border-left-color: var(--neutral); color: var(--text); }

body.bo .alert .close { opacity: 0.6; text-shadow: none; }

/* Colour utilities, mapped onto the palette */
body.bo .text-primary { color: var(--primary) !important; }
body.bo .text-success { color: var(--ok) !important; }
body.bo .text-warning { color: var(--warn-ink) !important; }
body.bo .text-danger  { color: var(--bad) !important; }
body.bo .text-info    { color: var(--info) !important; }
body.bo .text-secondary, body.bo .text-muted { color: var(--muted) !important; }
body.bo .text-dark    { color: var(--ink) !important; }

body.bo .bg-primary   { background-color: var(--primary) !important; }
body.bo .bg-success   { background-color: var(--ok) !important; }
body.bo .bg-warning   { background-color: var(--warn) !important; }
body.bo .bg-danger    { background-color: var(--bad) !important; }
body.bo .bg-info      { background-color: var(--info) !important; }
body.bo .bg-secondary { background-color: var(--neutral) !important; }
body.bo .bg-dark      { background-color: var(--ink) !important; }
body.bo .bg-light     { background-color: var(--panel-sunk) !important; }

body.bo .bg-gradient-primary { background: var(--primary) !important; color: #fff; }
body.bo .bg-gradient-success { background: var(--ok) !important; color: #fff; }
body.bo .bg-gradient-info    { background: var(--info) !important; color: #fff; }
body.bo .bg-gradient-warning { background: var(--warn) !important; color: #2A1A00; }
body.bo .bg-gradient-danger  { background: var(--bad) !important; color: #fff; }

body.bo .border-primary { border-color: var(--primary) !important; }
body.bo .border-success { border-color: var(--ok) !important; }
body.bo .border-warning { border-color: var(--warn) !important; }
body.bo .border-danger  { border-color: var(--bad) !important; }
body.bo .border-info    { border-color: var(--info) !important; }
body.bo .border, body.bo .border-top, body.bo .border-bottom, body.bo .border-left, body.bo .border-right { border-color: var(--rule-soft); }

body.bo .text-xs { font-size: 12px !important; }

/* Small labels in capitals with wide spacing read as template chrome; sentence case instead */
body.bo .page-body .small.text-uppercase,
body.bo .page-body small.text-uppercase,
body.bo .page-body .text-xs.text-uppercase,
body.bo .page-body .text-uppercase.text-muted,
body.bo .page-body h6.text-uppercase,
body.bo .page-body label.text-uppercase {
    text-transform: none !important;
    letter-spacing: 0 !important;
}
body.bo .text-sm { font-size: 13px !important; }

/* ---------------------------------------------------------------------
   Figures: dashboard tiles (small-box) and figure strips (info-box)
   --------------------------------------------------------------------- */

body.bo .small-box,
body.bo .info-box {
    --tile: var(--primary);
    --tile-tint: var(--primary-tint);
    position: relative;
    display: flex;
    margin-bottom: 20px;
    background: var(--panel) !important;
    border: 1px solid var(--rule) !important;
    box-shadow: inset 3px 0 0 var(--tile) !important;
    color: var(--text) !important;
}

body.bo .small-box.bg-success, body.bo .info-box.bg-success, body.bo .small-box.bg-gradient-success, body.bo .info-box.bg-gradient-success { --tile: var(--ok); --tile-tint: var(--ok-tint); }
body.bo .small-box.bg-warning, body.bo .info-box.bg-warning, body.bo .small-box.bg-gradient-warning, body.bo .info-box.bg-gradient-warning { --tile: var(--warn); --tile-tint: var(--warn-tint); }
body.bo .small-box.bg-danger,  body.bo .info-box.bg-danger,  body.bo .small-box.bg-gradient-danger,  body.bo .info-box.bg-gradient-danger  { --tile: var(--bad); --tile-tint: var(--bad-tint); }
body.bo .small-box.bg-info,    body.bo .info-box.bg-info,    body.bo .small-box.bg-gradient-info,    body.bo .info-box.bg-gradient-info    { --tile: var(--info); --tile-tint: var(--info-tint); }
body.bo .small-box.bg-secondary, body.bo .info-box.bg-secondary { --tile: var(--neutral); --tile-tint: #ECEEF1; }

body.bo .small-box {
    flex-direction: column;
    height: calc(100% - 20px);
    min-height: 132px;
}

body.bo .small-box > .inner {
    flex: 1 1 auto;
    padding: 16px 64px 12px 20px;
}

body.bo .small-box > .inner h3 {
    margin: 0 0 4px !important;
    color: var(--ink) !important;
    font-family: var(--font-title);
    font-size: 30px !important;
    font-weight: 600 !important;
    line-height: 1.1;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

body.bo .small-box > .inner p {
    margin: 0 0 6px !important;
    color: var(--muted) !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
}

/* The page's own trend line ("+4% vs yesterday") */
body.bo .small-box > .inner [style*="background"] {
    background: var(--panel-sunk) !important;
    color: var(--muted) !important;
    padding: 2px 8px !important;
    font-size: 12px !important;
}

body.bo .small-box > .inner [style*="background"] span,
body.bo .small-box > .inner .text-white,
body.bo .small-box > .inner .text-white-50 {
    color: var(--muted) !important;
}

body.bo .small-box > .icon {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: var(--tile-tint);
}

body.bo .small-box > .icon > i {
    position: static !important;
    color: var(--tile) !important;
    font-size: 16px !important;
    opacity: 1 !important;
    transform: none !important;
}

body.bo .small-box > .small-box-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 20px;
    background: transparent !important;
    border-top: 1px solid var(--rule-soft);
    color: var(--primary) !important;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
}

body.bo .small-box > .small-box-footer:hover { background: var(--panel-sunk) !important; }
body.bo .small-box > .small-box-footer i { color: var(--primary) !important; font-size: 12px; }

body.bo .info-box {
    align-items: center;
    gap: 14px;
    min-height: 76px;
    padding: 14px 16px 14px 18px;
}

body.bo .info-box .info-box-icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    background: var(--tile-tint) !important;
    color: var(--tile) !important;
    font-size: 18px;
}

body.bo .info-box .info-box-icon i { color: var(--tile) !important; }

body.bo .info-box .info-box-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

body.bo .info-box .info-box-text {
    color: var(--muted) !important;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.bo .info-box .info-box-number {
    color: var(--ink) !important;
    font-family: var(--font-title);
    font-size: 22px;
    font-weight: 600;
}

body.bo .info-box .progress { height: 3px; margin: 6px 0 4px; background: var(--rule-soft); }
body.bo .info-box .progress-bar { background: var(--tile) !important; }
body.bo .info-box .progress-description { color: var(--muted) !important; font-size: 12px; }

/* Tile text that pages set to white for their old coloured tiles */
body.bo .small-box .text-white, body.bo .info-box .text-white { color: inherit !important; }

/* ---------------------------------------------------------------------
   Tabs, lists, menus, dialogs, progress
   --------------------------------------------------------------------- */

/* Tabs: one strip on a hairline, the open tab lit from below. Pages that strip the line
   (border-0) or paint tabs bold get the same strip. */
body.bo .nav-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--rule) transparent;
    gap: 2px;
    margin-bottom: 18px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--rule) !important;
}

body.bo .nav-tabs .nav-item {
    flex: 0 0 auto;
    margin: 0 !important;
}

body.bo .nav-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 12px !important;
    border: 0 !important;
    border-bottom: 2px solid transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--muted) !important;
    font-size: 14px;
    font-weight: 500 !important;
    white-space: nowrap;
}

body.bo .nav-tabs .nav-link i {
    color: var(--faint);
    font-size: 13px;
    margin: 0 !important;
}

body.bo .nav-tabs .nav-link .badge {
    padding: 1px 6px;
    font-size: 11.5px;
}

body.bo .nav-tabs .nav-link:hover {
    color: var(--ink) !important;
    border-bottom-color: var(--rule) !important;
}

body.bo .nav-tabs .nav-link.active,
body.bo .nav-tabs .nav-item.show .nav-link {
    color: var(--primary) !important;
    border-bottom-color: var(--primary) !important;
    font-weight: 600 !important;
}

body.bo .nav-tabs .nav-link.active i { color: var(--primary); }

body.bo .nav-pills .nav-link { color: var(--muted); font-weight: 500; }
body.bo .nav-pills .nav-link.active { background: var(--primary); color: #fff; }

body.bo .list-group-item {
    border-color: var(--rule-soft);
    color: var(--text);
    padding: 11px 16px;
}

body.bo .list-group-item.active { background: var(--primary); border-color: var(--primary); color: #fff; }
body.bo .list-group-item-action:hover { background: var(--panel-sunk); }

body.bo .dropdown-menu {
    padding: 4px 0;
    border: 1px solid var(--rule);
    box-shadow: 0 10px 28px rgba(25, 29, 37, 0.14);
    font-size: 14px;
}

body.bo .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    color: var(--text);
}

body.bo .dropdown-item i { width: 16px; text-align: center; color: var(--muted); margin: 0 !important; }
body.bo .dropdown-item:hover, body.bo .dropdown-item:focus { background: var(--panel-sunk); color: var(--ink); }
body.bo .dropdown-item.active, body.bo .dropdown-item:active { background: var(--primary-tint); color: var(--primary); }
body.bo .dropdown-divider { border-top-color: var(--rule-soft); margin: 4px 0; }
body.bo .dropdown-header { color: var(--faint); font-size: 12px; }

body.bo .modal-backdrop.show { background: #10131A; opacity: 0.5; }

body.bo .modal-content {
    border: 1px solid var(--rule);
    box-shadow: 0 24px 60px rgba(16, 19, 26, 0.28);
}

body.bo .modal-header {
    align-items: center;
    padding: 14px 20px;
    background: var(--panel) !important;
    border-bottom: 1px solid var(--rule-soft);
    color: var(--ink) !important;
}

body.bo .modal-header[class*="bg-"]:not(.bg-white):not(.bg-light) { box-shadow: inset 0 3px 0 var(--primary); }
body.bo .modal-header.bg-success { box-shadow: inset 0 3px 0 var(--ok); }
body.bo .modal-header.bg-warning { box-shadow: inset 0 3px 0 var(--warn); }
body.bo .modal-header.bg-danger  { box-shadow: inset 0 3px 0 var(--bad); }
body.bo .modal-header.bg-info    { box-shadow: inset 0 3px 0 var(--info); }

body.bo .modal-header *,
body.bo .modal-header .close { color: var(--ink) !important; text-shadow: none; }

body.bo .modal-title {
    color: var(--ink) !important;
    font-family: var(--font-title);
    font-size: 19px;
    font-weight: 600;
}

body.bo .modal-body { padding: 20px; }

body.bo .modal-footer {
    padding: 12px 20px;
    background: var(--panel-sunk);
    border-top: 1px solid var(--rule-soft);
    gap: 8px;
}

body.bo .modal-footer > * { margin: 0; }

body.bo .progress { height: 8px; background: var(--rule-soft); }
body.bo .progress-bar { background-color: var(--primary); }

body.bo .breadcrumb { background: transparent; padding: 0; margin: 0; font-size: 13px; }

body.bo .tooltip-inner { background: var(--ink); font-size: 12.5px; padding: 5px 9px; }

body.bo .close { font-weight: 400; }

/* Loading spinners */
body.bo .spinner-border.text-primary { color: var(--primary) !important; }

/* Order and delivery timelines use the same colour meanings */
body.bo .tracking-timeline-marker.bg-success { background-color: var(--ok) !important; }
body.bo .tracking-timeline-marker.bg-warning { background-color: var(--warn) !important; }
body.bo .tracking-timeline-marker.bg-danger { background-color: var(--bad) !important; }
body.bo .tracking-timeline-marker.bg-info { background-color: var(--info) !important; }
body.bo .tracking-timeline-marker.bg-primary { background-color: var(--primary) !important; }
body.bo .tracking-timeline-marker.bg-secondary { background-color: var(--neutral) !important; }

body.bo .currency { font-family: var(--font); }

body.bo .attention-badge-link { display: inline-block; text-decoration: none !important; }
body.bo .attention-badge-link:hover { opacity: 0.85; }

/* Bootstrap 5 names a few pages use (this site runs Bootstrap 4) */
body.bo .fw-bold { font-weight: 700 !important; }
body.bo .fw-semibold { font-weight: 600 !important; }
body.bo .ms-1 { margin-left: 0.25rem !important; } body.bo .ms-2 { margin-left: 0.5rem !important; } body.bo .ms-3 { margin-left: 1rem !important; }
body.bo .me-1 { margin-right: 0.25rem !important; } body.bo .me-2 { margin-right: 0.5rem !important; } body.bo .me-3 { margin-right: 1rem !important; }
body.bo .ps-3 { padding-left: 1rem !important; }
body.bo .gap-1 { gap: 0.25rem !important; } body.bo .gap-2 { gap: 0.5rem !important; } body.bo .gap-3 { gap: 1rem !important; }
body.bo .text-end { text-align: right !important; }
body.bo .text-start { text-align: left !important; }

/* ---------------------------------------------------------------------
   Notices (toastr) and confirmations (SweetAlert2)
   --------------------------------------------------------------------- */

body.bo #toast-container > div {
    width: 340px;
    padding: 14px 16px 14px 50px;
    opacity: 1;
    border-left: 3px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 12px 32px rgba(16, 19, 26, 0.22) !important;
    font-size: 14px;
    background-position: 16px center;
}

body.bo #toast-container > div:hover { box-shadow: 0 12px 32px rgba(16, 19, 26, 0.3) !important; }
body.bo #toast-container > .toast-success { background-color: var(--ok); }
body.bo #toast-container > .toast-error { background-color: var(--bad); }
body.bo #toast-container > .toast-info { background-color: var(--info); }
body.bo #toast-container > .toast-warning { background-color: #B87700; }
body.bo .toast-title { font-weight: 600; }
body.bo .toast-progress { opacity: 0.35; background: #fff; }

body.bo .swal2-popup {
    padding: 24px;
    border: 1px solid var(--rule);
}

body.bo .swal2-title {
    color: var(--ink);
    font-family: var(--font-title);
    font-size: 22px;
    font-weight: 600;
}

body.bo .swal2-html-container { color: var(--text); font-size: 15px; }

body.bo .swal2-styled {
    min-height: 38px;
    padding: 7px 18px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: none !important;
}

body.bo .swal2-styled.swal2-confirm:not([style*="background"]) { background: var(--primary); }
body.bo .swal2-styled.swal2-cancel:not([style*="background"]),
body.bo .swal2-styled.swal2-cancel.swal-quiet { background: var(--panel) !important; color: var(--ink); border: 1px solid var(--rule); }
body.bo .swal2-styled:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------------------------------------------------------------------
   Print: only the page content
   --------------------------------------------------------------------- */

@media print {
    .bo-side, .tabbar, .sheet-backdrop, .sidebar-resizer, .page-head, .bo-top > :not(.top-title) { display: none !important; }
    .bo-top { position: static; height: auto; padding: 0 0 12px; border: 0; }
    .top-title { margin: 0; }
    .bo-frame { margin-left: 0 !important; }
    body.bo { background: #fff; }
    .page-head, .page-body { padding-left: 0; padding-right: 0; }
}

/* =====================================================================
   Tablet width: a little less room around the page
   ===================================================================== */

@media (min-width: 992px) and (max-width: 1279.98px) {
    :root { --pad: 20px; }
}

/* =====================================================================
   Phone and small tablet: an app
   ===================================================================== */

@media (max-width: 991.98px) {
    :root { --pad: 14px; }

    .sidebar-resizer { display: none; }

    .bo-frame {
        margin-left: 0;
        padding-top: calc(var(--appbar-h) + var(--safe-top));
        padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 20px);
    }

    /* ---- App bar ---- */
    .bo-top {
        position: fixed;
        left: 0;
        right: 0;
        top: 0;
        height: calc(var(--appbar-h) + var(--safe-top));
        padding: var(--safe-top) 6px 0 14px;
        z-index: 1035;
    }

    .top-menu-toggle,
    .top-shop,
    .user-chip-text,
    .top-spacer {
        display: none !important;
    }

    .top-title {
        flex: 1 1 auto;
        margin: 0;
        font-size: 19px !important;
    }

    .top-user { margin-left: 0; padding: 0 6px; }

    /* The page keeps only its buttons */
    .page-crumbs { display: none; }

    .page-head {
        min-height: 0;
        padding: 12px var(--pad) 0;
    }

    .page-head:not(:has(.page-actions:not(:empty))) {
        display: none;
    }

    .page-actions { width: 100%; }
    .page-actions > .btn, .page-actions > a.btn, .page-actions > form { flex: 1 1 auto; }
    .page-actions > form > .btn { width: 100%; }

    .page-body { padding-top: 14px; }

    /* ---- Bottom tab bar ---- */
    .tabbar {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1040;
        height: calc(var(--tabbar-h) + var(--safe-bottom));
        padding-bottom: var(--safe-bottom);
        background: rgba(255, 255, 255, 0.97);
        border-top: 1px solid var(--rule);
        -webkit-backdrop-filter: saturate(180%) blur(12px);
        backdrop-filter: saturate(180%) blur(12px);
    }

    .tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-width: 0;
        border: 0;
        background: transparent;
        color: var(--muted);
        font-size: 11px;
        font-weight: 500;
        text-decoration: none !important;
        -webkit-tap-highlight-color: transparent;
    }

    .tab i { font-size: 19px; height: 22px; line-height: 22px; }

    .tab[aria-current="page"], .tab.is-open { color: var(--primary); font-weight: 600; }
    .tab[aria-current="page"] i { color: var(--primary); }
    .tab:active { opacity: 0.6; }

    .tab-sale { color: var(--ink); }

    .sale-disc {
        width: 48px;
        height: 48px;
        margin-top: -22px;
        display: grid;
        place-items: center;
        background: var(--brand-fill);
        color: #fff;
        border: 4px solid var(--canvas);
        box-shadow: 0 8px 18px rgba(201, 42, 71, 0.32);
    }

    .sale-disc i { font-size: 18px; height: auto; line-height: 1; color: #fff !important; }
    .tab-sale[aria-current="page"] { color: var(--brand-fill); }

    /* ---- The menu, as a sheet from the bottom ---- */
    .bo-side {
        top: auto;
        right: 0;
        width: 100%;
        height: min(88vh, 760px);
        z-index: 1060;
        background: var(--canvas);
        border-right: 0;
        box-shadow: 0 -12px 40px rgba(16, 19, 26, 0.22);
        transform: translateY(105%);
        visibility: hidden;
        transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.3s;
    }

    body.sheet-open .bo-side {
        transform: none;
        visibility: visible;
        transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s;
    }

    body.sheet-open { overflow: hidden; }

    .side-brand, .side-sale, .side-sep { display: none; }

    .sheet-head {
        display: block;
        flex: 0 0 auto;
        padding: 8px 16px 6px;
    }

    .sheet-grabber {
        width: 40px;
        height: 4px;
        margin: 2px auto 12px;
        background: #BFC5CF;
    }

    .sheet-user {
        background: var(--panel);
        border: 1px solid var(--rule);
    }

    .sheet-user-row {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 12px 12px 14px;
    }

    .sheet-user .user-initials { width: 40px; height: 40px; font-size: 15px; }

    .sheet-user-text { flex: 1 1 auto; min-width: 0; line-height: 1.2; }
    .sheet-user-text strong { display: block; color: var(--ink); font-size: 15px; font-weight: 600; }
    .sheet-user-text small { color: var(--muted); }

    .sheet-close {
        flex: 0 0 auto;
        width: 36px;
        height: 36px;
        border: 0;
        background: var(--panel-sunk);
        color: var(--muted);
    }

    .sheet-user-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        border-top: 1px solid var(--rule-soft);
    }

    .sheet-user-actions a {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 46px;
        color: var(--primary);
        font-weight: 600;
        text-decoration: none;
    }

    .sheet-user-actions a + a { border-left: 1px solid var(--rule-soft); color: var(--muted); }

    .side-nav {
        padding: 4px 16px calc(24px + var(--safe-bottom));
        -webkit-overflow-scrolling: touch;
    }

    /* Rows like a phone's settings list. Groups are always open on a phone. */
    .side-label { padding: 16px 4px 6px; font-size: 13px; }

    .side-link, .side-group-head {
        width: 100%;
        min-height: 48px;
        margin: 0;
        padding: 12px 14px;
        font-size: 15.5px;
        background: var(--panel);
    }

    .side-link > i, .side-group-head > i:first-child { color: var(--primary); font-size: 16px; flex-basis: 22px; width: 22px; }

    .side-nav > .side-link,
    .side-group {
        border: 1px solid var(--rule);
        margin-bottom: 8px;
    }

    .side-group-head {
        pointer-events: none;
        min-height: 0;
        padding: 10px 14px 6px;
        background: transparent;
        color: var(--muted) !important;
        font-size: 13px;
        font-weight: 600;
    }

    .side-group { background: var(--panel); }
    .side-group-head > i, .side-chevron { display: none; }

    .side-group-items { display: block !important; padding: 0; }

    .side-group-items .side-link {
        min-height: 48px;
        padding: 12px 14px;
        font-size: 15.5px;
        border-top: 1px solid var(--rule-soft);
    }

    .side-link.active { box-shadow: inset 3px 0 0 var(--primary); }

    .sheet-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1050;
        background: rgba(16, 19, 26, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    body.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }

    /* Tab rows (order statuses, settings sections ...) scroll sideways */
    body.bo .page-body .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    body.bo .page-body .nav-tabs::-webkit-scrollbar { display: none; }
    body.bo .page-body .nav-tabs .nav-item { flex: 0 0 auto; }
    body.bo .page-body .nav-tabs .nav-link { white-space: nowrap; }

    /* POS: the products and the payment panel stack */
    .pos-container { flex-direction: column; gap: 14px !important; }
    .pos-right { width: 100% !important; }

    /* ---- Content ---- */
    body.bo .card { margin-bottom: 14px; }
    body.bo .card > .card-header { padding: 10px 14px; }
    body.bo .card-body { padding: 14px; overflow-x: auto; }

    body.bo .card-footer .btn { width: 100%; margin: 0 0 8px; }
    body.bo .card-footer .btn:last-child { margin-bottom: 0; }

    /* 16px keeps phones from zooming into a field when it is tapped */
    body.bo .form-control, body.bo .custom-select,
    body.bo .select2-container .select2-selection,
    body.bo input, body.bo select, body.bo textarea {
        font-size: 16px !important;
    }

    body.bo .form-control:not(textarea), body.bo .custom-select { height: 44px; }
    body.bo .select2-container .select2-selection--single { height: 44px !important; }
    body.bo .select2-container .select2-selection--single .select2-selection__rendered { line-height: 42px !important; }

    body.bo .btn { min-height: 42px; }
    body.bo .btn-sm, body.bo .btn-xs { min-height: 34px; min-width: 34px; }

    body.bo .small-box > .inner h3 { font-size: 26px !important; }

    /* Dialogs rise from the bottom, like a phone sheet */
    body.bo .modal-dialog,
    body.bo .modal-dialog-centered {
        margin: 0 !important;
        max-width: 100% !important;
        min-height: 100% !important;
        display: flex !important;
        align-items: flex-end !important;
    }

    body.bo .modal-content {
        border: 0;
        max-height: 92vh;
        overflow-y: auto;
        padding-bottom: var(--safe-bottom);
    }

    body.bo .modal.fade .modal-dialog { transform: translateY(40px); }
    body.bo .modal.show .modal-dialog { transform: none; }

    /* Notices appear under the app bar, full width */
    body.bo #toast-container.toast-top-full-width {
        top: calc(var(--appbar-h) + var(--safe-top) + 8px);
        left: 12px;
        right: 12px;
        width: auto;
    }

    body.bo #toast-container.toast-top-full-width > div { width: 100%; }

    /* DataTables controls: search full width on top, paging centred */
    body.bo .card .dataTables_wrapper > .row:nth-child(2) > [class*="col-"] { padding: 12px; }
    body.bo .card .table > tbody > tr > td:first-child,
    body.bo .card .table > tbody > tr > td:last-child { padding-left: 0 !important; padding-right: 0 !important; }

    body.bo div.dataTables_wrapper > div.row:first-child {
        display: flex !important;
        flex-direction: column-reverse !important;
        gap: 10px;
        margin: 0 0 12px !important;
    }

    body.bo div.dataTables_wrapper > div.row:first-child > div {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        text-align: left !important;
    }

    body.bo div.dataTables_wrapper div.dataTables_filter label { display: block; width: 100%; margin: 0; }

    body.bo div.dataTables_wrapper div.dataTables_filter input {
        display: block;
        width: 100% !important;
        margin: 6px 0 0 !important;
        height: 44px;
    }

    body.bo div.dataTables_wrapper div.dataTables_paginate { display: flex; justify-content: center; margin-top: 12px !important; }
    body.bo div.dataTables_wrapper div.dataTables_info { text-align: center; white-space: normal; }
}

/* Narrow phones: tiles drop their icon so the label fits beside the edge */
@media (max-width: 575.98px) {
    body.bo .small-box { min-height: 0; }
    body.bo .small-box > .inner { padding: 14px 14px 10px 16px; }
    body.bo .small-box > .icon { display: none; }
    body.bo .small-box > .small-box-footer { padding: 9px 14px 9px 16px; }
}

/* ---------- Tables become cards on phones ----------
   The layout's script copies each column heading onto its cells (data-label)
   and marks the table .m-stack. Tables without a heading row keep scrolling
   sideways, and a table can opt out with .no-stack. */

@media (max-width: 767.98px) {
    table.m-stack,
    table.m-stack > tbody,
    table.m-stack > tbody > tr,
    table.m-stack > tbody > tr > td {
        display: block !important;
        width: 100% !important;
    }

    table.m-stack { border: 0 !important; background: transparent !important; margin-bottom: 0 !important; }
    table.m-stack > thead { display: none !important; }

    .card-body.p-0 > table.m-stack,
    .card-body.p-0 > .table-responsive > table.m-stack { padding: 12px; }

    table.m-stack > tbody > tr {
        background: var(--panel) !important;
        border: 1px solid var(--rule);
        margin: 0 0 10px;
        padding: 4px 14px;
    }

    /* Label on the left, the value on the right. A value made of several blocks wraps
       onto the next lines instead of running off the card. */
    table.m-stack > tbody > tr > td {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: flex-start;
        gap: 6px 14px;
        border: 0 !important;
        padding: 9px 0 !important;
        text-align: right !important;
        white-space: normal !important;
        max-width: none !important;
    }

    table.m-stack > tbody > tr > td + td { border-top: 1px solid var(--rule-soft) !important; }
    table.m-stack > tbody > tr > td > * { max-width: 100%; min-width: 0; }

    table.m-stack > tbody > tr > td::before {
        content: attr(data-label);
        flex: 0 1 auto;
        max-width: 45%;
        margin-right: auto;
        color: var(--muted);
        font-size: 13px;
        font-weight: 500;
        text-align: left;
    }

    /* A column without a heading (picture, name, buttons): full width */
    table.m-stack > tbody > tr > td[data-label=""] { justify-content: flex-start; text-align: left !important; }
    table.m-stack > tbody > tr > td[data-label=""]::before { display: none; }

    table.m-stack > tbody > tr > td .text-truncate { max-width: 100% !important; white-space: normal !important; }

    /* "No records" and similar single-cell rows */
    table.m-stack > tbody > tr.m-full > td { display: block !important; text-align: center !important; }
    table.m-stack > tbody > tr.m-full > td::before { display: none; }

    table.m-stack > tfoot { display: block; }

    table.m-stack > tfoot > tr {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 4px 12px;
        background: var(--panel);
        border: 1px solid var(--rule);
        padding: 10px 14px;
    }

    table.m-stack > tfoot > tr > td,
    table.m-stack > tfoot > tr > th { border: 0 !important; padding: 2px 0 !important; }
}

@media (prefers-reduced-motion: reduce) {
    .bo-side,
    body.sheet-open .bo-side,
    .sheet-backdrop,
    .side-chevron,
    body.bo .modal.fade .modal-dialog {
        transition: none !important;
    }
}

/* Admin-only theme tokens; customer account screens keep the base theme. */
:root.admin-workspace {
    --canvas: #F4F6FA;
    --rule: #DFE5EE;
    --rule-soft: #EBEFF5;
    --ink: #17243B;
    --text: #334155;
    --muted: #64748B;
    --primary: #335CDE;
    --primary-hover: #2748B5;
    --primary-tint: #EDF2FF;
    --font-title: 'IBM Plex Sans', 'Noto Sans Bengali', system-ui, sans-serif;
    --top-h: 72px;
    --appbar-h: 64px;
}

/* Component shapes are scoped; native controls and plugin icons retain their shape. */
body.bo.bo-admin .card, body.bo.bo-admin .small-box, body.bo.bo-admin .info-box { border-radius: 14px; }
body.bo.bo-admin .btn, body.bo.bo-admin .form-control, body.bo.bo-admin .custom-select,
body.bo.bo-admin .select2-container .select2-selection { border-radius: 8px; }
body.bo.bo-admin .dropdown-menu, body.bo.bo-admin .modal-content, body.bo.bo-admin .swal2-popup { border-radius: 12px; }
body.bo.bo-admin .alert { border-radius: 10px; }
body.bo.bo-admin .badge { border-radius: 6px; }
body.bo.bo-admin .user-initials { border-radius: 50%; }
body.bo.bo-admin .shadow-sm { box-shadow: 0 3px 14px rgba(23, 36, 59, 0.04) !important; }

/* Professional admin presentation. Screen-only so invoices retain their print layout. */
@media screen {
    body.bo.bo-admin .card { box-shadow: 0 3px 14px rgba(23, 36, 59, .035); }
    body.bo.bo-admin .card > .card-header { padding: 16px 20px; border-radius: 14px 14px 0 0; }
    body.bo.bo-admin .card > .card-footer { border-radius: 0 0 14px 14px; }
    body.bo.bo-admin .card-body { padding: 20px; }
    body.bo.bo-admin .card-title { letter-spacing: -.015em; }
    .bo-top { border-bottom-color: var(--rule-soft); gap: 10px; }
    .top-title { font-size: 20px !important; letter-spacing: -.025em; }
    .top-btn { border-radius: 9px; height: 40px; }
    .top-user { height: 46px; border-left: 1px solid var(--rule-soft); padding-left: 14px; }
    .user-initials { background: #E9EEFC; }
    .top-count, .side-count { border-radius: 6px; }
    .page-head { min-height: 66px; }
    .page-crumbs { align-items: center; font-size: 12px; }
    .page-crumbs [aria-current="page"] { color: var(--ink); font-weight: 500; }
    .page-crumbs li + li::before { content: "›"; margin: 0 8px; }
    body.bo.bo-admin .btn { font-weight: 500; transition: background-color .15s, box-shadow .15s; }
    body.bo.bo-admin .btn-primary { box-shadow: 0 2px 4px rgba(51,92,222,.15); }
    body.bo.bo-admin .form-control, body.bo.bo-admin .custom-select { border-color: #D8E0EB; background-color: #fff; }
    body.bo.bo-admin .form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
    body.bo.bo-admin label { color: #475569; }
    body.bo.bo-admin .table thead th { background: #F7F9FC !important; color: #64748B !important; font-size: 11px !important; letter-spacing: .045em !important; font-weight: 600; }
    body.bo.bo-admin .table tbody td { border-color: var(--rule-soft); }
    body.bo.bo-admin .table-hover tbody tr:hover { background-color: #F5F8FF !important; }
    body.bo.bo-admin .page-link { border-radius: 6px; margin: 0 2px; }
    body.bo.bo-admin .dropdown-menu { padding: 6px; box-shadow: 0 12px 36px rgba(23,36,59,.12); }
    body.bo.bo-admin .dropdown-item { border-radius: 6px; padding: 9px 12px; }
    body.bo.bo-admin .modal-header { padding: 18px 22px; }
    body.bo.bo-admin .modal-content { box-shadow: 0 24px 80px rgba(23,36,59,.2); }
    body.bo.bo-admin .nav-tabs .nav-link { padding: 12px 16px; }
    body.bo.bo-admin .small-box, body.bo.bo-admin .info-box { box-shadow: 0 3px 14px rgba(23,36,59,.04) !important; }
    body.bo.bo-admin .small-box > .inner { padding: 22px 20px 16px; }
    body.bo.bo-admin .small-box > .inner h3 { font-size: clamp(22px, 2vw, 30px) !important; letter-spacing: -.035em; overflow-wrap: anywhere; white-space: normal; }
    body.bo.bo-admin .small-box > .icon { top: 18px; right: 18px; border-radius: 10px; width: 34px; height: 34px; }
    body.bo.bo-admin .small-box > .small-box-footer { padding: 11px 20px; border-radius: 0 0 14px 14px; font-size: 12px; }
    body.bo.bo-admin .info-box .info-box-icon { border-radius: 10px; }
    .dashboard-intro { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 26px; }
    .dashboard-eyebrow { color: var(--primary); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 8px; }
    body.bo.bo-admin .dashboard-intro h2 { font-size: 28px; letter-spacing: -.035em; margin-bottom: 8px; }
    .dashboard-intro p:last-child { margin: 0; color: var(--muted); }
    .dashboard-date { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); color: var(--muted); font-size: 12px; white-space: nowrap; }
    .dashboard-section-label { display: flex; align-items: center; gap: 12px; margin: 2px 0 14px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
    .dashboard-section-label::after { content: ""; height: 1px; flex: 1; background: var(--rule); }
    .dashboard-page .row.mb-4 { margin-bottom: 8px !important; }
    .dashboard-page .small-box > .inner { display: flex; flex-direction: column; align-items: flex-start; padding-top: 20px; }
    .dashboard-page .small-box > .inner p { order: -1; min-height: 34px; padding-right: 36px; font-size: 12px !important; }
    .dashboard-page .small-box > .inner h3 { margin-bottom: 12px !important; }
    .dashboard-page .small-box > .inner [style*="background"] { border-radius: 5px; }
    .dashboard-page .alert { flex-wrap: wrap; gap: 8px 0; padding: 14px 18px; font-size: 12px; }
    .dashboard-page .small-box.metric-sales { --tile: #335CDE; --tile-tint: #EDF2FF; border-top: 3px solid var(--tile) !important; }
    .dashboard-page .small-box.metric-orders { --tile: #15805B; --tile-tint: #E7F5EE; border-top: 3px solid var(--tile) !important; }
    .dashboard-page .small-box.metric-deliveries { --tile: #9A640F; --tile-tint: #FFF5DF; border-top: 3px solid var(--tile) !important; }
    .dashboard-page .small-box.metric-stock { --tile: #BC4256; --tile-tint: #FCECF0; border-top: 3px solid var(--tile) !important; }
    .skip-to-content { position: fixed; top: -70px; left: 16px; z-index: 1100; background: white; padding: 12px 18px; border-radius: 8px; }
    .skip-to-content:focus { top: 12px; }
}
@media screen and (min-width: 992px) {
    .bo-side { background: #152239; border-right: 0; }
    .side-brand { height: 88px; padding: 0 20px; color: #F5F8FF !important; border-bottom: 1px solid #29364B; }
    .side-brand-mark { width: 36px; height: 36px; border-radius: 10px; background: #335CDE; box-shadow: none; font-size: 21px; }
    .side-brand-words small { color: #9BACCA; font-size: 11px; margin-top: 5px; }
    .side-sale { margin: 20px 16px 12px; border-radius: 8px; background: #335CDE; min-height: 42px; box-shadow: 0 4px 12px #0B162640; }
    .side-sale:hover { background: #4770EB; }
    .side-nav { padding-top: 8px; scrollbar-color: #3A4962 transparent; }
    .side-link, .side-group-head { color: #B8C5DA !important; min-height: 40px; margin: 3px 12px; width: calc(100% - 24px); border-radius: 7px; font-size: 13px; }
    .side-link > i, .side-group-head > i:first-child, .side-chevron { color: #91A2BD; }
    .side-link:hover, .side-group-head:hover { background: #21314C; color: #FFF !important; }
    .side-link:hover > i, .side-group-head:hover > i:first-child { color: #DCE6F9; }
    .side-link.active { background: #2A4067; color: #FFF !important; box-shadow: inset 3px 0 0 #7FA2FF; }
    .side-link.active > i, .side-group.has-active > .side-group-head > i:first-child { color: #9DB8FF; }
    .side-group.has-active > .side-group-head { color: #F5F8FF !important; }
    .side-group-items .side-link { font-size: 12px; min-height: 34px; }
    .side-sep { background: #2A3850; margin: 16px 22px; }
    .side-count { background: #374C70; color: #E6EEFF; }
    .bo-side :focus-visible { outline-color: #A9C1FF; }
    .bo-top { padding-right: 28px; padding-left: 20px; }
    html.rail .side-link, html.rail .side-group-head { margin-left: 6px; margin-right: 6px; width: calc(100% - 12px); }
}
@media screen and (max-width: 991.98px) {
    .dashboard-intro { align-items: flex-start; margin-bottom: 20px; }
    body.bo.bo-admin .dashboard-intro h2 { font-size: 24px; }
    .dashboard-date { display: none; }
    .bo-side { border-radius: 20px 20px 0 0; }
    .sheet-user, .side-nav > .side-link, .side-group { border-radius: 10px; overflow: hidden; }
    .sheet-close { border-radius: 8px; }
    .sheet-grabber { border-radius: 4px; }
    .sale-disc { border-radius: 16px; }
    .tabbar { box-shadow: 0 -4px 20px rgba(23,36,59,.05); }
    body.bo.bo-admin .card-body { padding: 16px; }
    body.bo.bo-admin .modal-content { border-radius: 18px 18px 0 0; }
}
@media screen and (max-width: 575.98px) {
    .dashboard-page .row { margin-left: -6px; margin-right: -6px; }
    .dashboard-page .row > [class*="col-"] { padding-left: 6px; padding-right: 6px; }
    body.bo.bo-admin .small-box > .inner { padding: 16px 12px 12px; }
    .dashboard-page .small-box > .inner p { padding-right: 0; }
    body.bo.bo-admin .small-box > .small-box-footer { padding: 10px 12px; gap: 8px; font-size: 11px; }
    body.bo.bo-admin .small-box > .inner h3 { font-size: 23px !important; }
    table.m-stack > tbody > tr { border-radius: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    body.bo.bo-admin .btn { transition: none; }
}

@media print { .skip-to-content { display: none !important; } }

/* Shared admin tabs and combo boxes. Keep all routes, tab handlers and form values intact. */
@media screen {
    body.bo.bo-admin .nav-tabs,
    body.bo.bo-admin .nav-pills {
        gap: 6px;
        padding: 6px;
        margin-bottom: 20px !important;
        background: #E9EEF6;
        border: 1px solid #DFE5EE !important;
        border-radius: 12px;
        align-items: center;
        scrollbar-width: thin;
    }
    body.bo.bo-admin .nav-tabs .nav-item,
    body.bo.bo-admin .nav-pills .nav-item { margin: 0 !important; }
    body.bo.bo-admin .nav-tabs .nav-link,
    body.bo.bo-admin .nav-pills .nav-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 40px;
        height: auto;
        padding: 10px 14px !important;
        border: 1px solid transparent !important;
        border-radius: 9px !important;
        background: transparent !important;
        color: #52627A !important;
        font-size: 13px;
        font-weight: 500 !important;
        line-height: 1.4;
        box-shadow: none !important;
        white-space: nowrap;
        text-decoration: none;
    }
    body.bo.bo-admin .nav-tabs .nav-link:hover,
    body.bo.bo-admin .nav-pills .nav-link:hover { background: #F5F7FC !important; color: var(--ink) !important; }
    body.bo.bo-admin .nav-tabs .nav-link.active,
    body.bo.bo-admin .nav-tabs .nav-item.show .nav-link,
    body.bo.bo-admin .nav-pills .nav-link.active {
        background: #FFFFFF !important;
        border-color: #D8E1F0 !important;
        color: var(--primary) !important;
        font-weight: 600 !important;
        box-shadow: 0 2px 5px rgba(23,36,59,.08) !important;
    }
    body.bo.bo-admin :is(.nav-tabs, .nav-pills) .nav-link:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
    body.bo.bo-admin :is(.nav-tabs, .nav-pills) .nav-link.disabled { opacity: .5; pointer-events: none; }
    body.bo.bo-admin :is(.nav-tabs, .nav-pills) .nav-link i { color: inherit; }

    /* Native dropdowns retain native keyboard and screen-reader behaviour. */
    body.bo.bo-admin select:not([multiple]):not([size]):not(.select2-hidden-accessible) {
        appearance: none;
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 16px;
        background-color: var(--panel) !important;
        color: var(--ink);
        padding-right: 38px !important;
        padding-left: 12px !important;
        border-radius: 8px;
        font-weight: 400 !important;
        cursor: pointer;
        max-width: 100%;
    }
    body.bo.bo-admin select:disabled { background-color: var(--panel-sunk) !important; color: var(--muted); cursor: not-allowed; opacity: .75; }
    body.bo.bo-admin select:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
    body.bo.bo-admin select option { background: var(--panel); color: var(--ink); }
    body.bo.bo-admin .dataTables_length select { min-width: 78px; }

    /* Give filter buttons their own space; the icon and dropdown form one field. */
    body.bo.bo-admin :is(.page-actions form, form[method="get" i]) .input-group:has(select) {
        align-items: stretch;
        flex-wrap: nowrap;
        border-radius: 9px !important;
        box-shadow: none !important;
        max-width: 100%;
    }
    body.bo.bo-admin :is(.page-actions form, form[method="get" i]) .input-group:has(select) > .input-group-prepend > .input-group-text {
        border: 1px solid var(--rule) !important;
        border-right: 0 !important;
        border-radius: 8px 0 0 8px !important;
        background: var(--panel) !important;
        color: var(--muted) !important;
        padding: 0 12px !important;
    }
    body.bo.bo-admin :is(.page-actions form, form[method="get" i]) .input-group:has(select) > select {
        height: 40px;
        min-width: 0;
        border: 1px solid var(--rule) !important;
        border-radius: 8px !important;
        margin: 0;
    }
    body.bo.bo-admin :is(.page-actions form, form[method="get" i]) .input-group > .input-group-prepend + select {
        border-left: 0 !important;
        border-radius: 0 8px 8px 0 !important;
        padding-left: 4px !important;
    }
    body.bo.bo-admin :is(.page-actions form, form[method="get" i]) .input-group:has(select) > .input-group-append { margin-left: 10px; }
    body.bo.bo-admin :is(.page-actions form, form[method="get" i]) .input-group:has(select) > .input-group-append > .btn {
        border-radius: 8px !important;
        min-height: 40px;
        padding: 8px 18px !important;
        font-weight: 500 !important;
        white-space: nowrap;
    }
    body.bo.bo-admin :is(.page-actions form, form[method="get" i]) .input-group > select:focus { border-color: var(--primary) !important; }
    body.bo.bo-admin .page-actions form { max-width: 100%; }

    /* Searchable selects share the same shape, surface and interaction colours. */
    body.bo.bo-admin .select2-container .select2-selection { border-radius: 8px !important; }
    body.bo.bo-admin .select2-container .select2-selection--single { height: 40px !important; }
    body.bo.bo-admin .select2-container .select2-selection--single .select2-selection__rendered { line-height: 38px !important; padding-left: 12px !important; padding-right: 38px !important; }
    body.bo.bo-admin .select2-container .select2-selection--single .select2-selection__arrow { height: 38px !important; right: 10px !important; }
    body.bo.bo-admin .select2-container .select2-selection__arrow b { border: solid #64748B !important; border-width: 0 1.5px 1.5px 0 !important; width: 7px; height: 7px; transform: rotate(45deg); margin-top: -5px !important; }
    body.bo.bo-admin .select2-container--open .select2-selection__arrow b { transform: rotate(225deg); margin-top: -1px !important; }
    body.bo.bo-admin .select2-dropdown { border-radius: 10px !important; padding: 6px; overflow: hidden; box-shadow: 0 10px 28px rgba(23,36,59,.12); }
    body.bo.bo-admin .select2-search--dropdown .select2-search__field { border-radius: 6px; }
    body.bo.bo-admin .select2-results__option { border-radius: 5px; margin: 2px 0; padding: 9px 10px; }
    body.bo.bo-admin .select2-container .select2-selection--multiple { min-height: 40px; padding: 2px 6px; }
    body.bo.bo-admin .select2-container .select2-selection__choice { border-radius: 5px; padding: 2px 7px; }
    body.bo.bo-admin .select2-container--disabled .select2-selection { background: var(--panel-sunk) !important; opacity: .75; }
}
@media screen and (max-width: 991.98px) {
    body.bo.bo-admin :is(.nav-tabs, .nav-pills) .nav-link { min-height: 44px; }
    body.bo.bo-admin :is(.page-actions form, form[method="get" i]) .input-group:has(select) > select,
    body.bo.bo-admin :is(.page-actions form, form[method="get" i]) .input-group:has(select) > .input-group-append > .btn { min-height: 44px; height: 44px; }
    body.bo.bo-admin .select2-container .select2-selection--single { height: 44px !important; }
    body.bo.bo-admin .select2-container .select2-selection--single .select2-selection__rendered { line-height: 42px !important; }
    body.bo.bo-admin .select2-container .select2-selection--single .select2-selection__arrow { height: 42px !important; }
    body.bo.bo-admin .page-actions form .input-group { width: 100%; }
}
@media (forced-colors: active) {
    body.bo.bo-admin select:not([multiple]):not([size]) { appearance: auto; background-image: none; }
    body.bo.bo-admin :is(.nav-tabs, .nav-pills) .nav-link.active { outline: 2px solid Highlight; }
}

/* One outer height for selects and their adjacent actions, including Select2 wrappers. */
@media screen {
    body.bo.bo-admin { --control-height: 40px; }
    body.bo.bo-admin :is(.page-actions, .form-inline, .input-group) { --field-height: var(--control-height); }
    body.bo.bo-admin .input-group-sm { --field-height: 32px; }
    body.bo.bo-admin :is(.page-actions, .form-inline, .input-group) :is(.btn, .form-control:not(textarea), .custom-select, .input-group-text) {
        box-sizing: border-box;
        height: var(--field-height) !important;
        min-height: var(--field-height) !important;
    }
    body.bo.bo-admin :is(.page-actions, .form-inline, .input-group) .btn,
    body.bo.bo-admin .input-group-text { display: inline-flex; align-items: center; justify-content: center; }
    body.bo.bo-admin .select2-container .select2-selection--single {
        box-sizing: border-box;
        height: var(--field-height, var(--control-height)) !important;
        min-height: var(--field-height, var(--control-height)) !important;
        display: flex;
        align-items: center;
    }
    body.bo.bo-admin .select2-container .select2-selection--single .select2-selection__rendered {
        flex: 1;
        min-width: 0;
        line-height: calc(var(--field-height, var(--control-height)) - 2px) !important;
    }
    body.bo.bo-admin .select2-container .select2-selection--single .select2-selection__arrow { height: calc(var(--field-height, var(--control-height)) - 2px) !important; }
    body.bo.bo-admin .admin-select { min-width: 0; max-width: 100%; vertical-align: middle; }
    body.bo.bo-admin .admin-select-compact { --field-height: 34px; min-width: 80px; margin: 0 6px; }
    body.bo.bo-admin .input-group > .admin-select { flex: 1 1 0 !important; width: 1% !important; }
    body.bo.bo-admin :is(.page-actions form, form[method="get" i]) .input-group:has(select) > .input-group-prepend { margin-right: 0; }
    body.bo.bo-admin :is(.page-actions form, form[method="get" i]) .input-group > .input-group-prepend ~ .admin-select .select2-selection {
        border-left: 0 !important;
        border-radius: 0 8px 8px 0 !important;
    }
    body.bo.bo-admin .input-group:has(> .admin-select.select2-container--focus) > .input-group-prepend > .input-group-text { border-color: var(--primary) !important; }
    body.bo.bo-admin .input-group:has(> .admin-select) > .input-group-append { align-self: stretch; }
    body.bo.bo-admin select.is-invalid + .admin-select .select2-selection,
    body.bo.bo-admin .was-validated select:invalid + .admin-select .select2-selection { border-color: var(--bad) !important; }
}
@media screen and (max-width: 991.98px) {
    body.bo.bo-admin { --control-height: 44px; }
    body.bo.bo-admin .admin-select-compact { --field-height: 44px; }
}

/* All Orders is the shared reference for admin list pages and controls. */
@media screen {
    body.bo.bo-admin .bo-top {
        height: var(--top-h);
        padding-left: 20px;
        padding-right: 28px;
        gap: 10px;
        background: var(--panel);
    }
    body.bo.bo-admin .bo-top .top-title {
        font-family: var(--font) !important;
        font-size: 20px !important;
        font-weight: 600 !important;
        line-height: 1.2 !important;
        letter-spacing: -.025em;
        margin-left: 6px;
    }
    body.bo.bo-admin .page-body .card {
        border: 1px solid var(--rule-soft) !important;
        border-radius: 6px !important;
        box-shadow: 0 3px 14px rgba(23,36,59,.035) !important;
    }
    body.bo.bo-admin .page-body .card > .card-header { border-radius: 6px 6px 0 0 !important; }
    body.bo.bo-admin .page-body .card > .card-footer { border-radius: 0 0 6px 6px !important; }
    body.bo.bo-admin :is(.page-body, .page-actions) .btn { border-radius: 8px !important; }
    body.bo.bo-admin :is(.page-body, .page-actions) .input-group { border-radius: 8px !important; }
    body.bo.bo-admin :is(.page-body, .page-actions) :is(.form-control, .custom-select, .form-select) { border-radius: 8px; }
    body.bo.bo-admin .table .badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        border-radius: 6px !important;
        padding: 4px 9px !important;
        font-size: 11.5px !important;
        font-weight: 600 !important;
        line-height: 1.2;
        box-shadow: none !important;
    }
    body.bo.bo-admin .table :is(.btn-sm:not([class*="btn-outline"]), .btn-xs:not([class*="btn-outline"]), .action-circle, .btn-circle) {
        min-width: 32px;
        min-height: 32px;
        padding: 6px 8px !important;
        border: 1px solid var(--rule) !important;
        border-radius: 8px !important;
        background: var(--panel) !important;
        box-shadow: none !important;
    }
    body.bo.bo-admin .table :is(.btn-sm:not([class*="btn-outline"]), .btn-xs:not([class*="btn-outline"]), .action-circle, .btn-circle):hover { background: var(--primary-tint) !important; border-color: #BDCCE9 !important; }
    body.bo.bo-admin .table .btn-outline-primary:hover,
    body.bo.bo-admin .table .btn-outline-primary:focus { background: var(--primary) !important; border-color: var(--primary) !important; color: #fff !important; }
    body.bo.bo-admin .admin-row-actions { gap: 6px; flex-wrap: wrap; }
    body.bo.bo-admin .page-body .nav-tabs > .nav-link { flex: 0 0 auto; }
}
@media screen and (max-width: 991.98px) {
    body.bo.bo-admin .bo-top {
        height: calc(var(--appbar-h) + var(--safe-top));
        padding: var(--safe-top) 6px 0 14px;
    }
    body.bo.bo-admin .bo-top .top-title { font-size: 19px !important; margin-left: 0; }
}

/* Rounded feedback matches the fields, buttons and panels around it. */
body.bo #toast-container > .toast {
    border-radius: 10px !important;
    overflow: hidden;
    border-left: 0;
    max-width: calc(100vw - 32px);
    box-shadow: 0 8px 24px rgba(23, 36, 59, .16) !important;
}
body.bo #toast-container > .toast:hover { box-shadow: 0 10px 28px rgba(23, 36, 59, .2) !important; }
body.bo #toast-container .toast-close-button { border-radius: 4px; }
body.bo #toast-container .toast-close-button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
body.bo #toast-container .toast-progress { border-radius: 0 0 10px 10px; }
body.bo.bo-admin .alert, body.bo.auth .alert { border-radius: 8px !important; }
body.bo.bo-admin .swal2-popup { border-radius: 12px !important; }
body.bo.bo-admin .swal2-styled { border-radius: 8px !important; }

/* =====================================================================
   Fixed Backoffice Application Footer
   ===================================================================== */
.app-fixed-footer {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-w, 248px);
    right: 0;
    height: 30px;
    background: #ffffff;
    border-top: 1px solid var(--rule-soft, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    font-size: 11.5px;
    color: #64748b;
    z-index: 90;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.02);
    user-select: none;
    transition: left 0.15s ease;
}

.app-fixed-footer .footer-left,
.app-fixed-footer .footer-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-fixed-footer .footer-left b {
    font-weight: 600;
    color: #1e293b;
}

.app-fixed-footer .footer-right a {
    color: #1e293b;
    font-weight: 600;
    text-decoration: none;
}

.app-fixed-footer .footer-right a:hover {
    text-decoration: underline;
    color: var(--primary, #335CDE);
}

.app-fixed-footer .footer-short-text {
    display: none;
}

html.rail .app-fixed-footer {
    left: var(--rail-w, 56px);
}

body.auth .app-fixed-footer {
    left: 0;
}

@media screen and (max-width: 991.98px) {
    .app-fixed-footer {
        left: 0;
        bottom: calc(var(--tabbar-h, 56px) + var(--safe-bottom, 0px));
        padding: 0 16px;
    }
    .app-fixed-footer .footer-full-text {
        display: none;
    }
    .app-fixed-footer .footer-short-text {
        display: inline;
    }
    .bo-frame {
        padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 52px) !important;
    }
}

@media print {
    .app-fixed-footer {
        display: none !important;
    }
}

.bo-main {
    padding-bottom: 42px;
}

/* =====================================================================
   Modern Summernote Rich Text Editor Styling
   ===================================================================== */
body.bo .note-editor.note-frame {
    border: 1px solid #E2E8F0 !important;
    border-radius: 8px !important;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
    background: #FFFFFF !important;
}

body.bo .note-editor.note-frame.focus {
    border-color: var(--primary, #335CDE) !important;
    box-shadow: 0 0 0 3px rgba(51, 92, 222, 0.12) !important;
}

body.bo .note-editor .card-header.note-toolbar,
body.bo .note-toolbar {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 4px 6px !important;
    background: #F8FAFC !important;
    border-bottom: 1px solid #E2E8F0 !important;
    padding: 6px 10px !important;
    min-height: auto !important;
}

body.bo .note-editor .note-toolbar > .note-btn-group {
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
}

body.bo .note-editor .note-toolbar > .note-btn-group + .note-btn-group {
    margin-left: 2px !important;
}

body.bo .note-editor .note-btn {
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    color: #334155 !important;
    border-radius: 6px !important;
    padding: 4px 9px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
    transition: all 0.15s ease-in-out !important;
    cursor: pointer !important;
    height: 30px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

body.bo .note-editor .note-btn:hover {
    background: #F1F5F9 !important;
    border-color: #CBD5E1 !important;
    color: #0F172A !important;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06) !important;
}

body.bo .note-editor .note-btn.active,
body.bo .note-editor .note-btn:active,
body.bo .note-editor .note-btn:focus {
    background: #EEF2FF !important;
    border-color: #818CF8 !important;
    color: #4F46E5 !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15) !important;
}

body.bo .note-editor .note-btn-group > .note-btn:not(:first-child) {
    margin-left: -1px !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

body.bo .note-editor .note-btn-group > .note-btn:not(:last-child) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

body.bo .note-editor .note-btn-group > .note-btn:only-child {
    border-radius: 6px !important;
}

body.bo .note-editor .note-dropdown-menu {
    border-radius: 8px !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.1) !important;
    padding: 6px 0 !important;
    background: #FFFFFF !important;
}

body.bo .note-editor .note-dropdown-item {
    color: #334155 !important;
    padding: 6px 14px !important;
    font-size: 13px !important;
    transition: background 0.15s ease !important;
}

body.bo .note-editor .note-dropdown-item:hover {
    background: #F1F5F9 !important;
    color: #0F172A !important;
}

body.bo .note-editor .note-statusbar {
    background: #F8FAFC !important;
    border-top: 1px solid #E2E8F0 !important;
}

body.bo .note-editor .note-statusbar .note-resizebar {
    padding-top: 2px !important;
    height: 12px !important;
}
