/* ============================================================================
   BRAND — COD Solutions
   ============================================================================

   `--brand` is THE value to change if the exact hex differs. Everything else
   here is derived from it, so one line re-colours the whole sidebar accent.

   THE SIDEBAR IS WHITE; THE BRAND IS THE ACCENT
   The vendor theme paints the light-mode sidebar as a SOLID PANEL of
   `--theme-deafult` and then writes every label, icon, divider and pill on top
   of it in `#fff` / `rgba(255,255,255,x)`. That is the whole reason this block
   is long: flipping the panel to white makes ALL of that white-on-white, so
   every one of those declarations has to be answered.

   ⚠️ `deafult` is the vendor theme's own typo, and 391 rules depend on it — do
   not "fix" the spelling.

   HOW THIS BLOCK IS ORGANISED — read this before adding to it
   The rules below carry NO literal colours; every one reads a `--sidebar-*`
   variable, and light and dark differ ONLY in the two variable blocks at the top.
   That indirection is not decoration, it is what makes the block work at all:
   these selectors are the theme's own, repeated verbatim, so they are long enough
   (12 classes deep) that NO reasonably-written `body.dark-only` rule can outrank
   them. A dark override written as a rule would lose the specificity race; a dark
   override written as a variable cannot, because it is not racing.

   So: to change a colour, change a variable. Only add a rule here when the theme
   paints something this block does not cover yet — and then have it read a
   variable too.

   The one thing that is NOT a variable is the panel background, because the theme
   already has `body.dark-only … div.sidebar-wrapper { background-color: #262932 }`
   at a higher specificity and correctly keeps the dark panel dark.

   SCOPE
   Deliberately scoped to the sidebar, so `.btn-primary`, links and form focus
   rings keep the theme blue and stay distinct from `.btn-danger` (which is red,
   like the brand). See "GOING FURTHER" at the end of the block.
   ========================================================================= */

:root {
    --brand: #DA291C;
    /* The same colour as channels, for rgba() tints. Keep it in step with --brand. */
    --brand-rgb: 218, 41, 28;
    /* Hover / pressed — the brand darkened ~15%. */
    --brand-dark: #B31F15;
    /* For a tint on a light background (badges, subtle fills). */
    --brand-light: #F2402F;
    /* What text on top of the brand must be. */
    --brand-contrast: #ffffff;

    /* --- The light sidebar's ink: muted slate at rest, brand red for current --- */
    --sidebar-accent: var(--brand);
    /* The logo's black, so the menu reads as the same ink as the page and the mark.
       Was #52526C, a slate the theme shipped. */
    --sidebar-ink: #1A1A1A;
    --sidebar-ink-muted: rgba(26, 26, 26, 0.75);
    --sidebar-line: rgba(82, 82, 108, 0.18);
    --sidebar-hover-bg: rgba(var(--brand-rgb), 0.07);
    --sidebar-active-bg: rgba(var(--brand-rgb), 0.1);
    --sidebar-active-ink: var(--brand);

    /* Read by the inline <style> in layouts/master.blade.php, which colours the
       Font Awesome `<i>` icons this sidebar draws instead of the theme's svg. */
    /* The icons follow the labels: black at 65%, so they sit beside the words
       rather than in a colour of their own. */
    --sidebar-icon: rgba(26, 26, 26, 0.65);
}

/* Dark mode keeps the theme's dark panel (#22242B) — a solid red slab, or a white
   one, would defeat the point of dark mode — so the brand shows up as the ACCENT
   only, and the ink flips to white.

   `--sidebar-active-ink` is white rather than red here on purpose: red text on
   #22242B is muddy, and the red pill already reads as "current". The current
   link's icon and chevron use it too, so the whole link is white.

   `.dark-sidebar` is the theme's dark-panel-on-a-light-page variant. Nothing in
   this template sets it today, but it costs one selector to keep correct. */
body.dark-only,
body.dark-sidebar {
    --sidebar-accent: var(--brand-light);
    --sidebar-ink: rgba(255, 255, 255, 0.8);
    --sidebar-ink-muted: rgba(255, 255, 255, 0.7);
    --sidebar-line: rgba(255, 255, 255, 0.2);
    --sidebar-hover-bg: rgba(var(--brand-rgb), 0.12);
    /* The theme's own dark rule paints the current link rgba(255,255,255,.2) and wins
       over section 4, so this says the same: hover (section 3) reads it too. */
    --sidebar-active-bg: rgba(255, 255, 255, 0.2);
    --sidebar-active-ink: #fff;
    --sidebar-icon: rgba(255, 255, 255, 0.6);
}

/* --- 1. THE PANEL ---------------------------------------------------------
   White instead of `var(--theme-deafult)`. The hairline replaces the contrast
   the coloured panel used to give against the page body, which is only a hair
   greyer (`--light2`, #F5F6F9) than the sidebar now is. `--chart-border` is one
   of the theme's own variables and already flips to #1A1C23 in dark mode. */
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper {
    background: #fff;
    border-right: 1px solid var(--chart-border);
    /* The theme rounds the panel's outer edge (20px top/bottom-right, plus 15px
       on the logo block above it). With a flat hairline border instead of a
       coloured panel, the curve only leaves a gap of page showing through. */
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .logo-wrapper,
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .logo-icon-wrapper {
    border-top-right-radius: 0;
}

/* --- 2. LABELS AND SECTION TITLES AT REST --------------------------------- */
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links li a span {
    color: var(--sidebar-ink);
    /* A bit bolder than the theme's 500, so the links read easily. */
    font-weight: 600;
}

.page-wrapper .sidebar-main-title h6 {
    color: var(--sidebar-ink-muted);
}

/* The hairline the theme draws above each section heading. */
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links .simplebar-wrapper .simplebar-mask .simplebar-content-wrapper .simplebar-content>li.sidebar-main-title::before {
    background: var(--sidebar-line);
}

/* The collapse chevron on a group. */
.page-wrapper.compact-wrapper .page-body-wrapper .according-menu i {
    color: var(--sidebar-icon);
}

/* The fold toggle (« / ») in the logo header, which the theme strokes `var(--white)`.
   `!important` is needed only to beat `body.dark-only .toggle-sidebar svg`, which is
   itself `!important` and would otherwise rest this one icon at pure white while every
   other icon beside it sits at `--sidebar-icon`. Specificity (0,5,2) does the rest. */
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .toggle-sidebar svg {
    stroke: var(--sidebar-icon) !important;
}

/* --- 3. HOVER — the same look as the current link (section 4) ------------
   Background, label, icon (layouts/master.blade.php) and chevron all read the
   ACTIVE variables: a link you point at looks like the current one. */
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links .simplebar-wrapper .simplebar-mask .simplebar-content-wrapper .simplebar-content>li.sidebar-list:hover>a:hover {
    background-color: var(--sidebar-active-bg);
}

.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links .simplebar-wrapper .simplebar-mask .simplebar-content-wrapper .simplebar-content>li:hover .sidebar-link:not(.active):hover span,
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links .simplebar-wrapper .simplebar-mask .simplebar-content-wrapper .simplebar-content>li:hover .sidebar-link:not(.active):hover .according-menu i {
    color: var(--sidebar-active-ink);
}

/* Same weight on hover (the theme's hover rule sets it back to 500). */
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links .simplebar-wrapper .simplebar-mask .simplebar-content-wrapper .simplebar-content>li:hover .sidebar-link:not(.active):hover span {
    font-weight: 600;
}

/* --- 4. ACTIVE — the whole point of the change ----------------------------
   The label, the icon (layouts/master.blade.php) and the chevron all use
   `--sidebar-active-ink`: red in light mode, white in dark mode. */
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links .simplebar-wrapper .simplebar-mask .simplebar-content-wrapper .simplebar-content>li .sidebar-link.active {
    background-color: var(--sidebar-active-bg);
}

.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links .simplebar-wrapper .simplebar-mask .simplebar-content-wrapper .simplebar-content>li .sidebar-link.active span {
    color: var(--sidebar-active-ink);
    font-weight: 600;
}

.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links .simplebar-wrapper .simplebar-mask .simplebar-content-wrapper .simplebar-content>li .sidebar-link.active .according-menu i {
    color: var(--sidebar-active-ink);
}

/* The same small gap under every link, current or not: two highlighted links (the current one
   and the one under the mouse) never touch and read as one block, and the menu does not shift
   when you change page. The theme put 10px under the current link only — room for its open
   sub-links — so on a plain link (Product Statistics…) it pushed the next link down; a current
   link WITH a dropdown keeps those 10px. */
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links .simplebar-wrapper .simplebar-mask .simplebar-content-wrapper .simplebar-content>li > .sidebar-link,
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links .simplebar-wrapper .simplebar-mask .simplebar-content-wrapper .simplebar-content>li:not(:has(> .sidebar-submenu)) > .sidebar-link.active {
    margin-bottom: 4px;
}

/* --- 5. SUBMENU — links, and the tree lines the theme draws with ::before/::after
   The bullet, the elbow and the vertical spine are all decoration painted in white;
   they have to drop back to the hairline colour or the submenu looks unhooked
   from its parent. --------------------------------------------------------- */
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links .simplebar-wrapper .simplebar-mask .simplebar-content-wrapper .simplebar-content>li .sidebar-submenu li a {
    color: var(--sidebar-ink-muted);
    /* A label too long for the menu goes onto a second line instead of being cut short
       (the theme's nowrap + ellipsis showed "Classifications M…"). Short labels do not change. */
    white-space: normal;
}

/* Hover like the current one. The leading `body` (one element more) is what beats
   the theme's `body.dark-only … .sidebar-submenu li a` (60% white) in dark mode. */
body .page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links .simplebar-wrapper .simplebar-mask .simplebar-content-wrapper .simplebar-content>li .sidebar-submenu li:hover>a {
    color: var(--sidebar-active-ink);
}

.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links .simplebar-wrapper .simplebar-mask .simplebar-content-wrapper .simplebar-content>li .sidebar-submenu li a.active {
    color: var(--sidebar-active-ink);
}

/* The bullet in front of a submenu link — on the accent once that link is current. */
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links .simplebar-wrapper .simplebar-mask .simplebar-content-wrapper .simplebar-content>li .sidebar-submenu li a::before {
    background: var(--sidebar-line);
}

.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links .simplebar-wrapper .simplebar-mask .simplebar-content-wrapper .simplebar-content>li .sidebar-submenu li a.active::before,
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links .simplebar-wrapper .simplebar-mask .simplebar-content-wrapper .simplebar-content>li .sidebar-submenu li:hover>a::before {
    background: var(--sidebar-accent);
}

/* The elbow connecting each submenu link to the spine. */
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links .simplebar-wrapper .simplebar-mask .simplebar-content-wrapper .simplebar-content>li .sidebar-submenu li a:after {
    border-left-color: var(--sidebar-line);
    border-bottom-color: var(--sidebar-line);
}

/* The vertical spine down the left of an open submenu. */
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links .simplebar-wrapper .simplebar-mask .simplebar-content-wrapper .simplebar-content>li .sidebar-submenu::before {
    background: var(--sidebar-line);
}

/* --- 6. THE MOBILE CLOSE ARROW -------------------------------------------
   Below 992px responsive.css reveals a `<` in the logo header and paints it `#fff`
   — invisible on a white panel. That file is loaded AFTER custom.css, so a rule at
   the theme's own specificity would lose; the leading `body` is what wins it back
   (one element more), and the media query has to match responsive.css exactly or
   the override lands at the wrong widths. */
@media only screen and (max-width: 991.98px) {
    body .page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .logo-wrapper .back-btn {
        color: var(--sidebar-icon);
    }
}

/* GOING FURTHER — brand the WHOLE app, not just the sidebar.
   Move the declaration to :root and every one of the theme's 391 primary rules
   follows: buttons, links, tabs, form focus rings, pagination.

       :root { --theme-deafult: var(--brand); }

   ⚠️ Before you do: the brand IS red, and `.btn-danger` is red too, so a
   primary button and a delete button would become near-identical. Give danger
   its own darker crimson at the same time, e.g.

       .btn-danger, .bg-danger { background-color: #8B1A12 !important; }
*/

/* ============================================================================
   SIDEBAR LOGO SIZING & ALIGNMENT
   ============================================================================

   Both sidebar images are far larger than the slots they sit in, and `img-fluid`
   alone (`max-width: 100%`) only stops them at the CONTAINER edge — which is the
   wrong limit in both cases.

   THE WORDMARK (`logo.png` / `logo_dark.png`, 1000x141)
   The sidebar is 265px with 30px padding, so `img-fluid` let the wordmark run to
   204px wide, ending at x=234. The `grid` toggle is absolutely positioned starting
   at x=214 — so the last letters rendered UNDERNEATH it. 170px ends the logo at
   x=200 and leaves a 14px gap before the toggle.

   THE ICON (`logo-icon.png`, 4500x4500)
   This one was a real bug, not just tight spacing. The collapsed sidebar is
   `width: auto`, so with no cap the 4500px-wide icon DROVE that width: collapsing
   the sidebar expanded it to 1385px and covered the page, and because
   `sidebar-menu.js` persists the collapsed state in `localStorage`
   ("sidebar_collapsed"), it stayed broken on every later page load.
   30px is the width the theme is built around: it pairs with the wrapper's 30px
   padding to total the 90px that `style.css` reserves via
   `div.sidebar-wrapper.close_icon~.page-body { margin-left: 90px }`.

   `height: auto` is already in `.img-fluid`; it is repeated here so these rules
   still hold their aspect ratio if the class is ever dropped from the markup.
   ========================================================================= */

.page-wrapper .sidebar-wrapper .logo-wrapper img {
    max-width: 170px;
    height: auto;
}

/* The collapsed rail, and the mobile menu's header, both draw the square icon. */
.page-wrapper .sidebar-wrapper .logo-icon-wrapper img,
.page-wrapper .sidebar-wrapper li.back-btn img {
    max-width: 30px;
    height: auto;
}

/* --- The collapse toggle, on the logo's centreline -------------------------
   `.toggle-sidebar` is `position: absolute; top: 30px`, and with nothing between
   it and the fixed `.sidebar-wrapper` it was measuring that 30px from the top of
   the SIDEBAR rather than from the logo header. That put its centre at y=41.3
   against the logo's y=34 — the ~7px drop you can see.

   Making `.logo-wrapper` the positioning context fixes it without inventing a
   magic number: the wrapper's own centre is already exactly the logo's centre
   (both 33.98), so `top: 50%` + `translateY(-50%)` puts the two on one line and
   keeps them there if the logo's height ever changes.

   `line-height: 0` removes the ~1.3px of inline descender space under the svg,
   which would otherwise leave the icon half a pixel low inside its own box.

   Horizontal position is unaffected: the wrapper is 264px against the sidebar's
   265px, so the existing `right: 30px` still resolves to the same x. The RTL rule
   (`left: 30px`) rebases the same way. --------------------------------------- */
.page-wrapper .sidebar-wrapper .logo-wrapper {
    position: relative;
}

.page-wrapper .sidebar-wrapper .toggle-sidebar {
    top: 50%;
    transform: translateY(-50%);
    line-height: 0;
}

/* --- ...and its hover state ------------------------------------------------
   The theme hovers this icon to `var(--white)`, which is `#fff` in light mode —
   white on the white panel, i.e. the icon vanishes under the cursor. (Dark mode
   escapes it only because a separate `body.dark-only` rule re-states `#fff`,
   which does read on #22242B.)

   Both go to the accent instead, so the toggle hovers like every other item in
   the sidebar rather than being a special case.

   The theme's two rules are `!important`, so these have to be too.

   ⚠️ The selector below is deliberately the REST rule's selector plus `:hover`, not
   something shorter. Three `!important` declarations now compete for this icon's
   stroke, so length is what orders them: the rest rule above is (0,5,2), and an
   `!important` hover rule shorter than that — the obvious
   `.page-wrapper .sidebar-wrapper .toggle-sidebar:hover>svg`, (0,4,1) — LOSES to it
   and the hover silently stops working. `:hover` counts as a class, so matching the
   rest rule and adding it lands at (0,6,2): ahead of the rest rule, and still ahead
   of the theme's `.toggle-sidebar:hover>svg` (0,2,1) and
   `body.dark-only .toggle-sidebar:hover svg` (0,2,2).

   `:before` is the circle that scales up under the cursor. It was
   `rgba(255,255,255,.1)` — invisible on white — and reusing `--sidebar-hover-bg`
   makes it the same wash the nav links use. It needs no `!important`: (0,3,1)
   already outranks the theme's (0,1,1). ------------------------------------- */
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .toggle-sidebar:hover>svg {
    color: var(--sidebar-accent) !important;
    stroke: var(--sidebar-accent) !important;
}

.page-wrapper .sidebar-wrapper .toggle-sidebar:before {
    background-color: var(--sidebar-hover-bg);
}

/* --- ...and its two arrows ---------------------------------------------------
   « while the menu is open (a click folds it to the left), » while it is folded
   (the mouse over the folded menu shows it; a click keeps it open). The theme's
   script puts `.close_icon` on `.sidebar-wrapper` when it is folded. */
.page-wrapper .sidebar-wrapper .toggle-sidebar .sidebar-unfold-icon,
.page-wrapper .sidebar-wrapper.close_icon .toggle-sidebar .sidebar-fold-icon {
    display: none;
}

.page-wrapper .sidebar-wrapper.close_icon .toggle-sidebar .sidebar-unfold-icon {
    display: inline-block;
}

/* ============================================================================
   HEADER PROFILE DROPDOWN — the trigger, and opening it by tap
   ============================================================================

   THE TRIGGER
   The theme builds this dropdown around an avatar `<img>` inside `.profile-media`
   (`style.css` sizes it 32px, `responsive.css` 30px). This project has no avatar
   asset and no user field for one, so `.profile-media` held only the name block —
   and that is hidden below 1400px by BOTH Bootstrap's `d-xxl-block d-none` and
   `responsive.css`'s own `.profile-media .media-body { display: none }`.

   The `<li>` therefore measured 0x0 on a phone (20x12 on a 1300px desktop): the
   menu still existed and still worked, but there was nothing on screen to tap, so
   Log Out was unreachable. The icon below restores a trigger at every width.

   It is sized to the theme's own avatar dimensions so the header keeps its rhythm,
   and it sits inside the `li`'s existing padding, which carries the tap target
   past the icon's own 32px.

   ⚠️ The svg rule has to outrank `responsive.css`'s
   `.nav-right ul li svg { width: 24px; height: 24px }` — that file loads AFTER this
   one, so specificity is the only thing that decides it. (0,6,3) against (0,4,3).
   ========================================================================= */

.page-wrapper .page-header .header-wrapper .nav-right ul li.profile-nav .profile-trigger {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--sidebar-hover-bg);
    color: var(--sidebar-accent);
}

.page-wrapper .page-header .header-wrapper .nav-right ul li.profile-nav .profile-trigger svg {
    width: 18px;
    height: 18px;
}

/* OPENING IT WITHOUT A MOUSE
   `script.js` toggles `.active` on click, but every rule that reveals the panel is
   written as `.onhover-dropdown:hover .onhover-show-div…`, so on mobile the theme
   leans on a tap ALSO producing `:hover`. Phones mostly emulate that, but not
   reliably. This makes `.active` sufficient on its own wherever there is no real
   hover, and is scoped to `(hover: none)` so mouse behaviour is untouched — on a
   desktop the panel keeps opening and closing with the pointer rather than
   latching open after a click. */
@media (hover: none) {
    .onhover-dropdown .onhover-show-div.active {
        opacity: 1;
        transform: translateY(0);
        visibility: visible;
    }
}

/* KEEPING IT OPEN ON THE WAY DOWN
   The panel is hover-only: it is revealed by `.onhover-dropdown:hover
   .onhover-show-div`, so it survives exactly as long as the pointer stays inside
   the `li`. The `li` is the name; the panel is a child positioned below it. A
   child counts as being inside the parent for `:hover` — but only where the two
   actually TOUCH.

   They did not. The theme pins the panel with a hardcoded pixel offset that has
   nothing to do with how tall the trigger is, and it picks a different number at
   each breakpoint:

       style.css:50940       top: 57px
       responsive.css:772    top: 50px    (<= 991.98px)
       responsive.css:3000   top: 70px    (<= 575.98px)

   Whatever the trigger measures, the leftover is a dead strip between the two
   where neither is hovered. Crossing it drops `:hover`, and the panel starts its
   0.3s fade — so it closed under a normal, unhurried downward movement, and only
   a fast one got there before the fade finished.

   `top: 100%` anchors the panel to the BOTTOM OF THE TRIGGER instead, so the gap
   is zero by construction — at every breakpoint, whatever the trigger's height
   turns out to be. The old visual separation is kept as a transparent top border
   rather than empty space: it is part of the panel's box, so it is hoverable,
   while `background-clip: padding-box` keeps the white body from painting behind
   it and the panel looks unchanged.

   The delay is the second half. Closing waits before it starts, so a pointer that
   slips out of the panel for a moment finds it still there on the way back;
   opening keeps the theme's immediate response. `all linear .3s` is inherited
   from `.onhover-show-div`, so only the delay is restated here.

   Specificity is deliberate: `responsive.css` loads AFTER this file, so the two
   media-query rules above can only be beaten on weight, not order. Those are
   (0,5,0); the `li` and `.profile-nav` here make it (0,6,1). */

.page-wrapper .page-header .header-wrapper .nav-right li.profile-nav .profile-dropdown {
    top: 100%;
    border-top: 12px solid transparent;
    background-clip: padding-box;
    /* The theme rounds the panel 5px and clips it with `overflow: hidden`, both of
       which follow the BORDER box — so the white body's own top corners would come
       out square behind a 12px border. 12 + 5 puts the inner radius back at 5. */
    border-top-left-radius: 17px;
    border-top-right-radius: 17px;
    transition-delay: .25s;
}

.page-wrapper .page-header .header-wrapper .nav-right li.profile-nav:hover .profile-dropdown {
    transition-delay: 0s;
}

/* ============================================================================
   TINTED ICON TILES — `.icon-tile` + `.tint-*`
   ============================================================================

   The soft coloured square behind an icon (dashboard stats, invoice totals, the
   profile activity feed, product thumbnails).

   ⚠️ Bootstrap's `bg-primary bg-opacity-10` CANNOT do this here. `style.css`
   redefines the tone classes as a flat colour with `!important` —

       .bg-primary { background-color: var(--theme-deafult) !important; }
       .bg-success { background-color: #00AC46 !important; color: #fff; }

   — which throws away the `rgba(var(--bs-primary-rgb), var(--bs-bg-opacity))`
   mechanism that `bg-opacity-*` drives. The utility then does nothing, the chip
   renders at FULL strength, and a `text-primary` icon on top of it is
   near-invisible. These classes set the tint directly instead.

   Every pair below was measured against the surface it actually sits on (#fff,
   and #262932 for the dark card). Icons are graphical objects, so the bar is
   3:1; the light steps land 4.6–9.0:1 and the dark steps 4.9–5.8:1. The dark
   foregrounds are lighter hues, not the same ones — the light-mode values
   measured 1.2–2.7:1 on the dark tint, i.e. unreadable.
   ========================================================================= */

.icon-tile {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.tint-primary   { background-color: rgba(68, 102, 242, .12); color: #3550c8; }
.tint-success   { background-color: rgba(0, 172, 70, .12);   color: #007a32; }
.tint-warning   { background-color: rgba(255, 174, 26, .12); color: #9a6500; }
.tint-danger    { background-color: rgba(220, 53, 69, .12);  color: #b02a37; }
.tint-info      { background-color: rgba(23, 56, 120, .12);  color: #173878; }
.tint-secondary { background-color: rgba(108, 117, 125, .12); color: #565e64; }

body.dark-only .tint-primary   { background-color: rgba(68, 102, 242, .22); color: #94a8ff; }
body.dark-only .tint-success   { background-color: rgba(0, 172, 70, .22);   color: #3fd67f; }
body.dark-only .tint-warning   { background-color: rgba(255, 174, 26, .22); color: #FFAE1A; }
body.dark-only .tint-danger    { background-color: rgba(220, 53, 69, .22);  color: #f4909a; }
body.dark-only .tint-info      { background-color: rgba(23, 56, 120, .22);  color: #8fa8dd; }
body.dark-only .tint-secondary { background-color: rgba(108, 117, 125, .22); color: #aeb5bc; }

/* COD Solutions' own red (--brand), for what WE did, e.g. a COD Solutions follow-up agent. */
.tint-brand { background-color: rgba(var(--brand-rgb), .1); color: var(--brand); }
.text-brand { color: var(--brand); }
body.dark-only .tint-brand { background-color: rgba(var(--brand-rgb), .22); color: var(--brand-light); }
body.dark-only .text-brand { color: var(--brand-light); }

/* ============================================================================
   DARK MODE — BOOTSTRAP'S OWN COLOUR VARIABLES
   ============================================================================

   The theme's dark mode is the `body.dark-only` class. Bootstrap's own dark values
   only come with `data-bs-theme="dark"`, which this app never sets — so Bootstrap's
   colour variables stayed LIGHT in dark mode, on the ~50 pages that use them:
   borders (--bs-border-color, #dee2e6) were bright lines, tiles
   (--bs-tertiary-bg, #f8f9fa) were light boxes under white text, and muted labels
   (--bs-secondary-color, #5a6472) were dim grey on the dark cards. The order
   detail tiles, the totals boxes, the profile boxes, the `.border` boxes in the
   Service Fees window... Dark values here, as strong as the theme's own dark
   borders and texts. */
body.dark-only {
    --bs-border-color: rgba(255, 255, 255, 0.1);
    --bs-border-color-translucent: rgba(255, 255, 255, 0.1);
    --bs-tertiary-bg: rgba(255, 255, 255, 0.04);
    --bs-secondary-bg: rgba(255, 255, 255, 0.08);
    --bs-secondary-color: rgba(255, 255, 255, 0.55);
}

/* The plain light alert (`.alert-light`): the theme keeps it a bright grey box with
   dark text in dark mode (!important). A soft dark box with light text instead. */
body.dark-only .alert.alert-light {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.7) !important;
}

/* ============================================================================
   DARK MODE — MODALS AND LIGHT ALERTS
   ============================================================================

   Modals: the theme (style.css, `body.dark-only .modal`) sets the window's text
   to 20% white, so any plain text in a modal (not a heading, not a span, which
   have their own colour) was nearly invisible — the account manager's name in
   the seller's Service Fees window, for one. 70% white, like the theme's other
   dark text.

   Light alerts (`.alert-light-*`): the theme only gives them a 30% background
   and lets the text inherit — a muddy box with grey text on the dark panel. They
   take the tinted tiles' palette above instead: a softer background, and the
   text in the alert's own colour. The theme paints the light "secondary" alert
   red, so it gets the danger colours. */
body.dark-only .modal {
    --bs-modal-color: rgba(255, 255, 255, 0.7);
}

body.dark-only .alert-light-primary   { background-color: rgba(68, 102, 242, .22); color: #94a8ff; }
body.dark-only .alert-light-success   { background-color: rgba(0, 172, 70, .22);   color: #3fd67f; }
body.dark-only .alert-light-warning   { background-color: rgba(255, 174, 26, .22); color: #FFAE1A; }
body.dark-only .alert-light-danger    { background-color: rgba(220, 53, 69, .22);  color: #f4909a; }
body.dark-only .alert-light-info      { background-color: rgba(23, 56, 120, .22);  color: #8fa8dd; }
body.dark-only .alert-light-secondary { background-color: rgba(220, 53, 69, .22);  color: #f4909a; }

/* ============================================================================
   DASHBOARD FUNNEL TILES — `<x-stat-tile>`
   ============================================================================

   The coloured tiles on the COD dashboard (call centre → fulfilment → shipping).

   THE TEXT IS WHITE ON EVERY TILE, and the fills are set so that it can be.

   White was not safe on the source palette: measured against white those colours
   ran from 1.63:1 (the yellow) to 4.76:1, and eleven of sixteen fell short of the
   4.5:1 the small label and the MAD figure need. So each fill that could not carry
   white was darkened along its own hue — saturation nudged up as lightness comes
   down, so the colour keeps its identity — until white cleared 4.6:1.

   ⚠️ The cost lands on the two yellows: a yellow dark enough for white text is a
   deep amber (#8e6d03), not the bright gold it started as. That is colour science,
   not a choice — a bright yellow cannot carry white text at any readable contrast.
   If the bright fills matter more than legibility, revert the fills below and drop
   the small text to dark; the pairs are kept in git history.

   Measured, all white-on-fill: total-leads 4.61, valid-leads 4.62, confirmed 4.77,
   to-call 4.78, no-answer 4.70, unreached 4.76, canceled 4.77, expired 4.68,
   warehouse 4.84, picked-up 4.64, prepared 4.70, fulfil-canceled 4.77,
   out-for-delivery 4.66, delivered 4.61, returned 12.28, refunded 4.68.
   ========================================================================= */

:root {
    --t-total-leads: #266cf6;       --t-total-leads-fg: #ffffff;
    --t-valid-leads: #268277;       --t-valid-leads-fg: #ffffff;
    --t-confirmed: #268341;         --t-confirmed-fg: #ffffff;
    --t-to-call: #916d0b;           --t-to-call-fg: #ffffff;
    --t-no-answer: #bd5507;         --t-no-answer-fg: #ffffff;
    --t-unreached: #64748B;         --t-unreached-fg: #ffffff;
    --t-canceled: #dc2b19;          --t-canceled-fg: #ffffff;
    --t-expired: #79736d;           --t-expired-fg: #ffffff;
    --t-warehouse: #8e6d03;         --t-warehouse-fg: #ffffff;
    --t-picked-up: #964aef;         --t-picked-up-fg: #ffffff;
    --t-prepared: #3179ad;          --t-prepared-fg: #ffffff;
    --t-fulfil-canceled: #dc2b19;   --t-fulfil-canceled-fg: #ffffff;
    --t-out-for-delivery: #c514dc;  --t-out-for-delivery-fg: #ffffff;
    --t-delivered: #348534;         --t-delivered-fg: #ffffff;
    --t-returned: #5E1F2D;          --t-returned-fg: #ffffff;
    --t-refunded: #e51436;          --t-refunded-fg: #ffffff;
}

.stat-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    height: 100%;
    color: var(--tile-fg);
    background-color: var(--tile-bg);
}

/* The icon plate: a 16% wash of the tile's OWN text colour, so it reads on a light
   fill and a dark one without a third colour being chosen per tone.

   Done with `currentColor` on a pseudo-element rather than `rgb(from var(--tile-fg) …)`
   — the relative-colour syntax is recent, and where it is unsupported the declaration
   is simply dropped and the plate disappears. `currentColor` is universal, and the
   icon is lifted above the wash so it stays at full strength. */
.stat-tile-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    position: relative;
}

.stat-tile-icon::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-color: currentColor;
    opacity: .16;
}

.stat-tile-icon > i { position: relative; }

.stat-tile-body { min-width: 0; flex-grow: 1; }

.stat-tile-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

/* The percentage must never be the thing that gives way. Without `flex-shrink: 0` the
   flex row shrinks it before the label, and at six tiles across "77.78%" was rendering
   clipped to "77.78" — a wrong number rather than a wrapped one. The label takes the
   squeeze instead, which it can absorb by wrapping. */
.stat-tile-percent { flex-shrink: 0; }
.stat-tile-head .stat-tile-label { min-width: 0; }

/* Six across only where there is genuinely room for it. Bootstrap's widest breakpoint is
   1400px, and at that width six tiles are ~175px — too narrow for a label and a
   percentage side by side. Below this the grid stays at four. */
@media (min-width: 1750px) {
    .funnel-grid > [class*="col-"] {
        flex: 0 0 auto;
        width: 16.6667%;
    }
}

/* The label is the one part allowed to wrap — at six tiles across, "Sent to Warehouse"
   and "Fulfillment Canceled" do not fit on one line, and truncating them would hide
   which figure the tile is. The value and the amount stay on one line. */
.stat-tile-label   { font-size: 13px; font-weight: 600; opacity: .92; line-height: 1.25; }
.stat-tile-percent { font-size: 12px; font-weight: 700; white-space: nowrap; }
.stat-tile-value   { font-size: 26px; font-weight: 700; line-height: 1.15; }
.stat-tile-amount  { font-size: 12px; opacity: .92; white-space: nowrap; }

/* A tile with a breakdown (x-stat-tile `details`): the list opens under it while the mouse is
   over the tile, or while it has the keyboard focus. */
.stat-tile.has-details { position: relative; cursor: help; }
/* While open, the tile (and so its list) sits above the tiles around it — without this the
   next row of tiles covered the list. */
.stat-tile.has-details:hover,
.stat-tile.has-details:focus-within { z-index: 30; }
.stat-tile.has-details:focus-visible { outline: 2px solid rgba(var(--brand-rgb), .5); outline-offset: 2px; }
.stat-tile-details-hint { font-size: 12px; opacity: .8; }
.stat-tile-details {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 20;
    min-width: 280px;
    padding: 6px;
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    background: #fff;
    color: #1A1A1A;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
}
.stat-tile.has-details:hover .stat-tile-details,
.stat-tile.has-details:focus-within .stat-tile-details { display: block; }
.stat-tile-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 6px 8px;
    font-size: 12.5px;
}
.stat-tile-detail-row + .stat-tile-detail-row { border-top: 1px solid var(--bs-border-color); }
.stat-tile-detail-row small { opacity: .7; }
/* A row with its state colour: a dot in the exact colour, the name and the count in it too. In
   dark mode the text is a lighter mix (a near-black state, like Client Blacklisted, would vanish)
   and the dot gets a faint ring for the same reason. */
.stat-tile-detail-label { display: inline-flex; align-items: center; gap: 8px; }
.stat-tile-detail-dot { width: 9px; height: 9px; flex-shrink: 0; border-radius: 50%; background: var(--detail-color); }
.stat-tile-detail-row.has-color .stat-tile-detail-label,
.stat-tile-detail-row.has-color strong { color: var(--detail-color); font-weight: 600; }
body.dark-only .stat-tile-detail-row.has-color .stat-tile-detail-label,
body.dark-only .stat-tile-detail-row.has-color strong { color: color-mix(in srgb, var(--detail-color) 50%, #fff); }
body.dark-only .stat-tile-detail-dot { box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); }
body.dark-only .stat-tile-details { background: #262932; color: rgba(255, 255, 255, .85); }

.stat-tile-total-leads      { --tile-bg: var(--t-total-leads);      --tile-fg: var(--t-total-leads-fg); }
.stat-tile-valid-leads      { --tile-bg: var(--t-valid-leads);      --tile-fg: var(--t-valid-leads-fg); }
.stat-tile-confirmed        { --tile-bg: var(--t-confirmed);        --tile-fg: var(--t-confirmed-fg); }
.stat-tile-to-call          { --tile-bg: var(--t-to-call);          --tile-fg: var(--t-to-call-fg); }
.stat-tile-no-answer        { --tile-bg: var(--t-no-answer);        --tile-fg: var(--t-no-answer-fg); }
.stat-tile-unreached        { --tile-bg: var(--t-unreached);        --tile-fg: var(--t-unreached-fg); }
.stat-tile-canceled         { --tile-bg: var(--t-canceled);         --tile-fg: var(--t-canceled-fg); }
.stat-tile-expired          { --tile-bg: var(--t-expired);          --tile-fg: var(--t-expired-fg); }
.stat-tile-warehouse        { --tile-bg: var(--t-warehouse);        --tile-fg: var(--t-warehouse-fg); }
.stat-tile-picked-up        { --tile-bg: var(--t-picked-up);        --tile-fg: var(--t-picked-up-fg); }
.stat-tile-prepared         { --tile-bg: var(--t-prepared);         --tile-fg: var(--t-prepared-fg); }
.stat-tile-fulfil-canceled  { --tile-bg: var(--t-fulfil-canceled);  --tile-fg: var(--t-fulfil-canceled-fg); }
.stat-tile-out-for-delivery { --tile-bg: var(--t-out-for-delivery); --tile-fg: var(--t-out-for-delivery-fg); }
.stat-tile-delivered        { --tile-bg: var(--t-delivered);        --tile-fg: var(--t-delivered-fg); }
.stat-tile-returned         { --tile-bg: var(--t-returned);         --tile-fg: var(--t-returned-fg); }
.stat-tile-refunded         { --tile-bg: var(--t-refunded);         --tile-fg: var(--t-refunded-fg); }

/* The "Track By Event Date" switch, styled as one bordered control so it reads as a
   filter alongside the selects rather than a stray checkbox. */
.track-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border: 1px solid var(--chart-border);
    border-radius: 8px;
    background-color: var(--bs-card-bg, #fff);
    min-height: 40px;
}

body.dark-only .track-toggle { background-color: #262932; }

/* --- Phones: the dashboard filter bar ------------------------------------
   The fields carry fixed pixel widths so they line up in a row on a desktop.
   On a narrow screen those widths leave ragged half-empty gaps, so on a phone
   every part of the bar gets its own full-width row instead. */
@media (max-width: 767.98px) {
    /* Each filter field fills the row. */
    #dashboardFilters .filter-field {
        width: 100% !important;
    }

    /* Reset / Apply get their own row and share it equally. */
    #dashboardFilters > .d-flex.gap-2 {
        width: 100%;
    }
    #dashboardFilters > .d-flex.gap-2 .btn {
        flex: 1 1 0;
    }

    /* The switch drops under the buttons instead of being pushed to the right
       edge, and `margin-left: 0` cancels the `ms-auto` that pushes it there. */
    #dashboardFilters .track-toggle {
        width: 100%;
        margin-left: 0 !important;
        justify-content: space-between;
    }
}

/* --- The red "Today's Overview" banner ------------------------------------ */
.today-banner {
    background: linear-gradient(120deg, var(--brand) 0%, #c8291f 100%);
    border-radius: 14px;
    color: #fff;
    padding: 22px 24px;
}

.today-banner-pill {
    background-color: rgba(255, 255, 255, 0.18);
    border: 0;
    color: #fff;
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.today-stat {
    background-color: rgba(255, 255, 255, 0.13);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 100%;
}

.today-stat .today-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    background-color: rgba(255, 255, 255, 0.18);
}

.today-stat-label { font-size: 13px; opacity: .92; }
.today-stat-value { font-size: 24px; font-weight: 700; line-height: 1.15; white-space: nowrap; }

/* Dark Mode Footer Fix */
body.dark-only .footer {
    background-color: #262932 !important;
}

/* Reduce Toast Margins */
.toast-container .toast {
    margin-bottom: 0.3rem !important;
    margin-top: 0 !important;
}

/* Dark Mode Input Fix */
body.dark-only input,
body.dark-only textarea,
body.dark-only select,
body.dark-only .form-control,
body.dark-only .form-select {
    color: #b2b2b2 !important;
}

/* Fix for placeholder visibility in dark mode */
.dark-only .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
    opacity: 1;
}

/* Dark Mode Light-Badge Fix
   In dark mode the theme repaints `.bg-light` to a dark color (#1A1C23) inside
   `.page-body`, but leaves `.text-dark` dark — so light badges (e.g. the dashboard
   state-count badges) end up dark text on a dark background. Flip the text light. */
body.dark-only .page-body .badge.bg-light {
    color: #fff !important;
}

/* Info-Badge Text Fix
   The theme repaints `--bs-info` from Bootstrap's light cyan (#0dcaf0) to a DARK NAVY
   (rgb(23, 56, 120)). Markup written against stock Bootstrap therefore pairs `bg-info`
   with `text-dark`, which lands near-black text (rgb(33, 37, 41)) on that navy — about
   1.2:1 contrast, effectively unreadable.
   A bare `.badge.bg-info` is already white (Bootstrap's `--bs-badge-color`); this pins it
   so an added `.text-dark` cannot undo it. `.badge.bg-info` (0,2,0) outranks `.text-dark`
   (0,1,0), and both carry !important, so specificity decides and this wins.
   Scoped to `.badge` on purpose: `.card-header.bg-info.bg-opacity-10` is a pale 10% wash
   that still needs dark text. */
.badge.bg-info {
    color: #fff !important;
}


/* Bootstrap Offcanvas Restore — `.offcanvas.bs-offcanvas`
   ⚠️ The template NEUTERS Bootstrap's offcanvas. `style.css` carries

       .offcanvas { position: unset; visibility: visible; background: unset; z-index: 2; }

   for its own `.offcanvas-bookmark` feature, and it loads AFTER vendors/bootstrap.css, so a
   real Bootstrap offcanvas renders inline in the page flow and is permanently visible — it
   never slides, never overlays, and shows through before it is opened.

   This restores the four declarations that rule takes away, and ONLY for an element that opts
   in with `bs-offcanvas`, so the template's own bookmark bar keeps its behaviour. Specificity
   (0,2,0) beats the theme's (0,1,0); the rest of Bootstrap's offcanvas CSS — `.offcanvas-end`,
   the transforms, `.showing`/`.hiding` — is untouched by the theme and still applies.

   This is the same class-collision trap the task board hit with `.kanban-*`: check style.css
   before relying on a generic Bootstrap class name. */
.offcanvas.bs-offcanvas {
    position: fixed;
    visibility: hidden;
    background-color: var(--bs-offcanvas-bg, #fff);
    z-index: var(--bs-offcanvas-zindex, 1045);
}

.offcanvas.bs-offcanvas.showing,
.offcanvas.bs-offcanvas.hiding,
.offcanvas.bs-offcanvas.show {
    visibility: visible;
}

/* The dark tooltip of the app: a near-black box with white words.

   Any element can ask for it with:

       data-bs-toggle="tooltip" data-bs-custom-class="ui-table-tooltip" title="..."

   and that is the whole contract: the initialiser at the bottom of layouts/master.blade.php
   turns the markup into real tooltips on every page, so nothing else has to be asked for. */
.ui-table-tooltip {
    --bs-tooltip-bg: #1f2937;
    --bs-tooltip-color: #f8fafc;
    --bs-tooltip-opacity: 1;
}

.ui-table-tooltip .tooltip-inner {
    background-color: #1f2937;
    color: #f8fafc;
    max-width: 280px;
    padding: 8px 11px;
    font-size: 12px;
    line-height: 1.5;
    text-align: left;
    border-radius: 7px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .3);
}

/* Every tooltip's arrow, in the whole app, takes the colour of its box.

   The arrow is a border triangle: the side it points from is coloured, the two slanted sides
   must stay transparent. The theme paints arrows a pale teal (style.css), and also the top side
   of every arrow, with rules stronger than Bootstrap's, so these need !important. Bootstrap 5.3
   says where the tooltip sits with `data-popper-placement`, not with `.bs-tooltip-top`. */
.tooltip { --ui-tooltip-box: #F5F5F5; }                  /* the theme's light tooltip */
.tooltip.ui-table-tooltip { --ui-tooltip-box: #1f2937; } /* the app's dark tooltip */
body.dark-only .tooltip { --ui-tooltip-box: #323846; }   /* dark mode: the theme gives every box this colour */

.tooltip .tooltip-arrow::before { border-color: transparent !important; }
.tooltip[data-popper-placement^=top] .tooltip-arrow::before { border-top-color: var(--ui-tooltip-box) !important; }
.tooltip[data-popper-placement^=bottom] .tooltip-arrow::before { border-bottom-color: var(--ui-tooltip-box) !important; }
.tooltip[data-popper-placement^=left] .tooltip-arrow::before { border-left-color: var(--ui-tooltip-box) !important; }
.tooltip[data-popper-placement^=right] .tooltip-arrow::before { border-right-color: var(--ui-tooltip-box) !important; }

/* A table header that carries a tooltip: hint that it can be hovered, without an icon. */
th.ui-th-tooltip {
    cursor: help;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   MONEY

   Amounts are what these screens are read for, so they carry more weight than the
   counts beside them. `tabular-nums` gives every digit the same width, which is what
   makes a column of amounts line up on the decimal point instead of drifting.
   ───────────────────────────────────────────────────────────────────────────── */
.money {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ═════════════════════════════════════════════════════════════════════════════
   BUTTONS

   One colour system for every button, built on the COD Solutions red.

   How it works:
   1. The colour tokens (--color-*) are defined once, below.
   2. Each button type (.btn-primary, .btn-outline-danger…) only picks its colours,
      as 4 small variables: --btn-color, --btn-hover, --btn-active, --btn-contrast.
   3. A few shared rules paint ALL buttons from those variables, so rest, hover,
      pressed, focus and disabled look the same everywhere.

   To change a colour, change a token. To add a button type, add one line in step 2.

   The theme (style.css) paints buttons with !important, so these rules need it too.
   It is only used on background, border and text colour.
   ───────────────────────────────────────────────────────────────────────────── */

/* 1. Colour tokens. Named for reuse: badges, alerts and links can use them later. */
:root {
    --color-primary: var(--brand);          /* the logo red */
    --color-primary-hover: var(--brand-dark);
    --color-primary-active: #961A11;
    --color-primary-rgb: var(--brand-rgb);

    --color-secondary: #52526C;             /* slate, like the sidebar text */
    --color-secondary-hover: #45455B;
    --color-secondary-active: #3A3A4D;
    --color-secondary-rgb: 82, 82, 108;

    --color-success: #15803D;
    --color-success-hover: #126B34;
    --color-success-active: #0F5A2B;
    --color-success-rgb: 21, 128, 61;

    /* Darker and pinker than the brand red, so "Delete" never looks like "Save". */
    --color-danger: #BE123C;
    --color-danger-hover: #9F1239;
    --color-danger-active: #881337;
    --color-danger-rgb: 190, 18, 60;

    /* Amber takes dark text: white on amber cannot be read. */
    --color-warning: #FFAE1A;
    --color-warning-hover: #F09C00;
    --color-warning-active: #D98C00;
    --color-warning-rgb: 255, 174, 26;
    --color-warning-text: #9A6500;          /* amber text on a white page */

    --color-info: #4466F2;                  /* the theme's old blue */
    --color-info-hover: #3452D1;
    --color-info-active: #2A43B0;
    --color-info-rgb: 68, 102, 242;

    --color-dark: #2C323F;
    --color-dark-hover: #1F2430;
    --color-dark-active: #161A23;
    --color-dark-rgb: 44, 50, 63;

    --color-light: #F1F3F5;
    --color-light-hover: #E4E7EB;
    --color-light-active: #D8DCE1;

    --color-ink: #2C323F;                   /* dark text on light or amber buttons */
}

/* Dark mode: the neutral buttons get lighter so they still show on the dark page. */
body.dark-only {
    --color-secondary: #62627E;
    --color-dark: #454C5C;
    --color-dark-hover: #525A6B;
    --color-dark-active: #5F687A;
}

/* 2. Each button type picks its colours. Solid and outline share the same line. */
.btn-primary,   .btn-outline-primary   { --btn-color: var(--color-primary);   --btn-hover: var(--color-primary-hover);   --btn-active: var(--color-primary-active);   --btn-contrast: #fff; --btn-ring: rgba(var(--color-primary-rgb), .5); }
.btn-secondary, .btn-outline-secondary { --btn-color: var(--color-secondary); --btn-hover: var(--color-secondary-hover); --btn-active: var(--color-secondary-active); --btn-contrast: #fff; --btn-ring: rgba(var(--color-secondary-rgb), .5); }
.btn-success,   .btn-outline-success   { --btn-color: var(--color-success);   --btn-hover: var(--color-success-hover);   --btn-active: var(--color-success-active);   --btn-contrast: #fff; --btn-ring: rgba(var(--color-success-rgb), .5); }
.btn-danger,    .btn-outline-danger    { --btn-color: var(--color-danger);    --btn-hover: var(--color-danger-hover);    --btn-active: var(--color-danger-active);    --btn-contrast: #fff; --btn-ring: rgba(var(--color-danger-rgb), .5); }
.btn-warning,   .btn-outline-warning   { --btn-color: var(--color-warning);   --btn-hover: var(--color-warning-hover);   --btn-active: var(--color-warning-active);   --btn-contrast: var(--color-ink); --btn-ring: rgba(var(--color-warning-rgb), .6); --btn-outline-text: var(--color-warning-text); }
.btn-info,      .btn-outline-info      { --btn-color: var(--color-info);      --btn-hover: var(--color-info-hover);      --btn-active: var(--color-info-active);      --btn-contrast: #fff; --btn-ring: rgba(var(--color-info-rgb), .5); }
.btn-dark,      .btn-outline-dark      { --btn-color: var(--color-dark);      --btn-hover: var(--color-dark-hover);      --btn-active: var(--color-dark-active);      --btn-contrast: #fff; --btn-ring: rgba(var(--color-dark-rgb), .5); }
.btn-light                             { --btn-color: var(--color-light);     --btn-hover: var(--color-light-hover);     --btn-active: var(--color-light-active);     --btn-contrast: var(--color-ink); --btn-ring: rgba(var(--color-dark-rgb), .35); }

/* Dark mode: outline text is mixed with white, or dark green / red text on the dark page
   cannot be read. The border and the hover fill keep the real colour. */
body.dark-only :is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info) {
    --btn-outline-text: color-mix(in srgb, var(--btn-color) 55%, #fff);
}
/* Dark mode: outline-dark (the Filters button) would be dark on dark, so it turns light. */
body.dark-only .btn-outline-dark { --btn-color: #C9CDD6; --btn-hover: #DDE0E6; --btn-contrast: #1F2430; --btn-ring: rgba(255, 255, 255, .45); }
body.dark-only .btn-light        { --btn-color: rgba(255, 255, 255, .08); --btn-hover: rgba(255, 255, 255, .14); --btn-active: rgba(255, 255, 255, .2); --btn-contrast: rgba(255, 255, 255, .85); }
/* The theme sets this text colour with a stronger selector, so it is answered the same way. */
body.dark-only .btn-light        { color: var(--btn-contrast) !important; }

/* The Reset button in every filter bar. Plain `btn-light` is nearly the same colour as the
   white card behind it, so Reset gets a darker grey of its own: still clearly the quiet
   button next to the red Apply, but you can see where it starts and ends. */
.btn-reset { --btn-color: #DDE1E6; --btn-hover: #CDD2D9; --btn-active: #BFC5CD; --btn-contrast: var(--color-ink); }
body.dark-only .btn-reset { --btn-color: rgba(255, 255, 255, .16); --btn-hover: rgba(255, 255, 255, .24); --btn-active: rgba(255, 255, 255, .3); --btn-contrast: rgba(255, 255, 255, .9); }
body.dark-only .btn-reset { color: var(--btn-contrast) !important; }

/* 3. The shared rules. */

/* Size and shape: the same for every button. The theme sets padding directly
   (0.375rem 1.75rem — very wide), so padding is set directly here too.

   The label is semibold. White on the brand red reads lighter than it measures, so at 500 a
   button looked washed out; 700 thickened the letters enough to widen the button and crowd
   whatever sits beside it. 600 is the one in between. */
.btn {
    --bs-btn-font-weight: 600;
    --bs-btn-disabled-opacity: .5;
    padding: 7px 16px;
    font-size: 14px;
    line-height: 1.4;
    border-radius: 6px;
}
.btn-lg { padding: 10px 22px; font-size: 16px; border-radius: 8px; }
.btn-sm { padding: 4px 12px; font-size: 13px; }
.btn-xs { padding: 2px 8px; font-size: 12px; }
.btn-pill { border-radius: 50rem; }

/* Solid buttons: rest → hover (darker) → pressed (darkest). Disabled keeps the rest
   colour and fades (Bootstrap's opacity above). */
:is(.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning, .btn-info, .btn-dark, .btn-light) {
    color: var(--btn-contrast) !important;
    background-color: var(--btn-color) !important;
    border-color: var(--btn-color) !important;
}
:is(.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning, .btn-info, .btn-dark, .btn-light):hover {
    background-color: var(--btn-hover) !important;
    border-color: var(--btn-hover) !important;
}
:is(.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning, .btn-info, .btn-dark, .btn-light):is(:active, .active, .show) {
    background-color: var(--btn-active) !important;
    border-color: var(--btn-active) !important;
}
/* The theme paints disabled buttons in its old colours (blue, purple…) with a stronger
   selector, so disabled needs its own rule to keep the button's colour. */
:is(.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning, .btn-info, .btn-dark, .btn-light):is(:disabled, .disabled) {
    background-color: var(--btn-color) !important;
    border-color: var(--btn-color) !important;
}
/* Dark mode: the theme also paints the light button's disabled text and pressed state.
   These use the theme's own selectors, so they win by coming later. */
body.dark-only .btn-light:disabled,
body.dark-only .btn-light.disabled { color: var(--btn-contrast) !important; }
body.dark-only .btn-light:not([disabled]):not(.disabled).active.active {
    background-color: var(--btn-active) !important;
    color: var(--btn-contrast) !important;
}

/* Outline buttons: coloured border and text at rest, filled on hover. */
:is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info, .btn-outline-dark) {
    color: var(--btn-outline-text, var(--btn-color)) !important;
    background-color: transparent !important;
    border-color: var(--btn-color) !important;
}
:is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info, .btn-outline-dark):is(:hover, :active, .active, .show) {
    color: var(--btn-contrast) !important;
    background-color: var(--btn-color) !important;
    border-color: var(--btn-color) !important;
}
:is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info, .btn-outline-dark):is(:active, .active) {
    background-color: var(--btn-hover) !important;
    border-color: var(--btn-hover) !important;
}
/* Focused, but not hovered or pressed: the rest look. A button keeps the focus after a click,
   and Bootstrap gives it back when the window it opened closes — the theme then filled it
   (blue for the red buttons) until the user clicked somewhere else. */
:is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info, .btn-outline-dark):focus:not(:hover):not(:active):not(.active):not(.show) {
    color: var(--btn-outline-text, var(--btn-color)) !important;
    background-color: transparent !important;
    border-color: var(--btn-color) !important;
}
/* Radio buttons drawn as outline buttons (.btn-check + .btn-outline-*, e.g. the All / Yes / No
   filters): the theme paints them in its old colours (blue, purple…) with selectors as strong
   as these. Same look as the other outline buttons: coloured at rest, filled when chosen or
   hovered. These come later, so they win. */
.btn-check + :is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info, .btn-outline-dark) {
    color: var(--btn-outline-text, var(--btn-color)) !important;
    background-color: transparent !important;
    border-color: var(--btn-color) !important;
}
.btn-check:checked + :is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info, .btn-outline-dark),
.btn-check + :is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info, .btn-outline-dark):is(:hover, :active) {
    color: var(--btn-contrast) !important;
    background-color: var(--btn-color) !important;
    border-color: var(--btn-color) !important;
}
/* Dark mode, in a card: the theme writes the dark outline button in white even when it is
   filled (light grey) on hover — white on light grey. Its own selector, plus the state, wins. */
body.dark-only .page-wrapper .page-body-wrapper .page-body .card:not(.email-body) .btn-outline-dark:is(:hover, :active, .active, .show) {
    color: var(--btn-contrast) !important;
}

/* Keyboard focus: a clear ring in the button's own colour. The theme removes
   Bootstrap's shadow ring with !important, so an outline is used instead — with
   !important too, or the theme's `button:focus { outline: none !important }` hides it
   on every <button>. Only for the keyboard (:focus-visible), never after a click. */
.btn:focus-visible {
    outline: 2px solid var(--btn-ring, rgba(var(--brand-rgb), .5)) !important;
    outline-offset: 2px;
}

/* Loading: put <span class="spinner-border spinner-border-sm me-1"></span> inside the
   button and disable it. This sizes the spinner to the button text. */
.btn .spinner-border-sm {
    width: 1em;
    height: 1em;
    border-width: .15em;
    vertical-align: -0.125em;
}

/* Icon-only buttons (edit, delete, print, table actions). They keep their meaning
   colour (text-danger, text-success…) and all react the same way. */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    line-height: 1;
    cursor: pointer;
    transition: opacity .15s ease, transform .15s ease;
}
.btn-icon:hover { opacity: .7; }
.btn-icon:active { transform: scale(.9); }
.btn-icon:focus-visible { outline: 2px solid rgba(var(--brand-rgb), .5); outline-offset: 3px; border-radius: 4px; }
.btn-icon:disabled,
.btn-icon.disabled { opacity: .4; pointer-events: none; }
/* A black icon button (text-dark, e.g. Impersonate) would vanish on the dark panel: there it
   takes the dark mode text colour (style.css, body.dark-only). `!important` because
   Bootstrap's .text-dark is !important. */
body.dark-only .btn-icon.text-dark { color: rgba(255, 255, 255, 0.6) !important; }

/* The scroll-to-top button (bottom right, shown after scrolling): a round primary button.
   The theme drew it in its old blue, half see-through, with a white border. */
.tap-top {
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), .35);
    opacity: 1;
}
.tap-top:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

/* ═════════════════════════════════════════════════════════════════════════════
   COMPONENTS — links, forms, select2, pagination, dropdowns, pills, alerts

   Same idea as BUTTONS: everything reads the --color-* tokens, so the brand red is
   the one "interactive" colour — what you can click, what has focus, what is chosen.

   NOT changed on purpose: status and statistic colours (badges, .tint-*, stat tiles,
   tones, summary cards, the bg-* / text-* utilities). They carry meaning.
   Cards, tables, the sidebar and the header were already consistent.
   ───────────────────────────────────────────────────────────────────────────── */

/* Tokens for this section. Dark mode needs a lighter red so text stays readable. */
:root {
    --color-link: var(--color-primary);
    --color-link-hover: var(--color-primary-hover);
    --color-focus-ring: rgba(var(--color-primary-rgb), .18);  /* glow around a focused field */
    --color-selected-bg: rgba(var(--color-primary-rgb), .08); /* hovered / chosen rows */
}
body.dark-only {
    --color-link: #FF6B5E;
    --color-link-hover: #FF8A80;
    --color-focus-ring: rgba(var(--color-primary-rgb), .35);
    --color-selected-bg: rgba(var(--color-primary-rgb), .18);
}

/* Links. The sidebar and header have their own, stronger rules and are not affected. */
a { color: var(--color-link); }
a:hover { color: var(--color-link-hover); }
/* The "show / hide" of the sign-in password is a link too (the theme drew it in its old blue). */
.show-hide span { color: var(--color-link); }
/* The theme colours link buttons directly, so the colour is set directly too. */
.btn-link { color: var(--color-link); }
.btn-link:hover { color: var(--color-link-hover); }

/* The header's profile menu (Profile link): the theme turns it blue on hover (`--theme-deafult`).
   Same selectors as style.css, so this later file wins; red like every other link. */
.page-wrapper .page-header .header-wrapper .nav-right .profile-dropdown li:hover a span,
body.dark-only .page-wrapper .page-header .header-wrapper .nav-right .profile-dropdown li a:hover {
    color: var(--color-link-hover);
}
.page-wrapper .page-header .header-wrapper .nav-right .profile-dropdown li:hover a svg,
.page-wrapper .page-header .header-wrapper .nav-right .profile-dropdown li:hover a svg path {
    stroke: var(--color-link-hover);
}

/* Inputs and selects: a red border and a soft red glow when focused.
   Fields with an error or success state keep their own colours. */
.form-control:not(.is-invalid):not(.is-valid):focus,
.form-select:not(.is-invalid):not(.is-valid):focus {
    border-color: rgba(var(--color-primary-rgb), .6);
    box-shadow: 0 0 0 .2rem var(--color-focus-ring);
}

/* The box beside a field in an input group ("MAD" of the money input, a prefix or a suffix).
   Bootstrap gives it 16px text while the field has 14px, which made the whole group 3px taller
   than the other fields. The small and large groups keep Bootstrap's own sizes (their rule is
   more specific). */
.input-group > .input-group-text {
    font-size: 14px;
}

/* ...and its border: the field and the box beside it read as ONE field ("MAD" of the money
   input, a prefix or a suffix) — the same border at rest, red together while typing, red
   together on an error (like the password field and its eye button below).
   Dark mode: the theme gives the box a #1A1C23 border, unlike the field's; the field's here. */
body.dark-only .page-wrapper .input-group > .input-group-text,
body.dark-only .modal .input-group > .input-group-text {
    border-color: rgba(255, 255, 255, 0.1);
}

.input-group:focus-within > .input-group-text,
body.dark-only .page-wrapper .input-group:focus-within > .input-group-text,
body.dark-only .modal .input-group:focus-within > .input-group-text {
    border-color: rgba(var(--color-primary-rgb), .6);
}

/* While typing, the soft focus glow goes around the whole group, not the field alone (the
   same as the password field below). */
.input-group:has(> .input-group-text):focus-within {
    border-radius: var(--bs-border-radius);
    box-shadow: 0 0 0 .2rem var(--color-focus-ring);
}
.input-group:has(> .input-group-text) > .form-control:focus { box-shadow: none; }

/* No line between the field and the box: the field has no border on the box's side, the box
   none on the field's side, so the two read as one field (like the password field and its eye
   button). Their outer border, and the red outline while typing, still go all the way round. */
.input-group > .form-control:has(+ .input-group-text) { border-right: 0; }
.input-group > .input-group-text + .form-control { border-left: 0; margin-left: 0; }
.input-group > .form-control + .input-group-text { border-left: 0; margin-left: 0; }
.input-group > .input-group-text:has(+ .form-control) { border-right: 0; }
/* Dark mode: the theme redraws the box's whole border (`body.dark-only .page-wrapper
   .input-group-text { border: … }`), more specific than the two rules above. */
body.dark-only .page-wrapper .input-group > .form-control + .input-group-text,
body.dark-only .modal .input-group > .form-control + .input-group-text { border-left-width: 0; }
body.dark-only .page-wrapper .input-group > .input-group-text:has(+ .form-control),
body.dark-only .modal .input-group > .input-group-text:has(+ .form-control) { border-right-width: 0; }

/* The money input's field is narrow (100px): its group takes only the field + currency's width
   (not the whole column), so the glow above wraps exactly those two. */
.input-group.money-input-group {
    width: fit-content;
    max-width: 100%;
}

.input-group:has(> .is-invalid) > .input-group-text,
body.dark-only .page-wrapper .input-group:has(> .is-invalid) > .input-group-text,
body.dark-only .modal .input-group:has(> .is-invalid) > .input-group-text {
    border-color: var(--bs-form-invalid-border-color, #dc3545);
}

/* Password field with an eye button (x-ui.form-inputs.password-input with `toggle`).
   The eye sits inside the field's border, so the two look like one box: the input has no
   right border, the button has no left border, and both change colour together. */
/* Square corners where the two meet. Bootstrap only squares them when an error message follows
   the button, so without an error the input kept its round right corners. */
.password-group > .form-control {
    border-right: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.password-group > .password-toggle,
.password-group > .password-toggle:is(:hover, :focus, :active) {
    /* No padding above and below: the button takes the field's height (35px) instead of
       making the group a little taller. */
    padding-top: 0;
    padding-bottom: 0;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-left: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    background-color: var(--bs-body-bg);
    color: var(--bs-secondary-color);
    box-shadow: none;
}
.password-group > .password-toggle:hover { color: var(--bs-body-color); }

/* Focused: one red border and one glow around the whole field, not only the input. */
.password-group:focus-within {
    border-radius: var(--bs-border-radius);
    box-shadow: 0 0 0 .2rem var(--color-focus-ring);
}
.password-group > .form-control:not(.is-invalid):not(.is-valid):focus,
.password-group > .form-control.is-invalid:focus { box-shadow: none; }
.password-group:focus-within > .form-control:not(.is-invalid),
.password-group:focus-within > .password-toggle { border-color: rgba(var(--color-primary-rgb), .6); }

/* An error makes the whole field red, the eye included. */
.password-group > .form-control.is-invalid ~ .password-toggle { border-color: var(--bs-form-invalid-border-color, #dc3545); }
.password-group:focus-within:has(.is-invalid) { box-shadow: 0 0 0 .2rem rgba(var(--bs-danger-rgb), .25); }

/* Dark mode: the same background and border as the theme's dark inputs. */
body.dark-only .password-group > .password-toggle,
body.dark-only .password-group > .password-toggle:is(:hover, :focus, :active) {
    background-color: #22242B;
    border-color: rgba(255, 255, 255, .1);
}
body.dark-only .password-group:focus-within > .password-toggle { border-color: rgba(var(--color-primary-rgb), .6); }
body.dark-only .password-group > .form-control.is-invalid ~ .password-toggle { border-color: var(--bs-form-invalid-border-color, #dc3545); }

/* Dark mode: the theme's input border hid the red border of a field with an error. */
body.dark-only .form-control.is-invalid,
body.dark-only .form-select.is-invalid {
    border-color: var(--bs-form-invalid-border-color, #dc3545);
}

/* Checkboxes, radios and switches. The dark theme paints them with a stronger
   selector, so it is listed too. */
.form-check-input:checked,
.form-switch .form-check-input:checked,
body.dark-only .form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}
.form-check-input:focus {
    border-color: rgba(var(--color-primary-rgb), .6);
    box-shadow: 0 0 0 .2rem var(--color-focus-ring);
}
/* The switch knob is an image; Bootstrap draws it light blue while focused. */
.form-switch .form-check-input:focus:not(:checked) {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ec8a82'/%3e%3c/svg%3e");
}

/* select2 (the searchable selects): red border when open, red highlighted option,
   soft red chips for the chosen values. */
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: rgba(var(--color-primary-rgb), .6) !important;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--color-primary);
    color: #fff;
}
/* The option already chosen, while the mouse is on another one: a soft red, so it reads as
   "chosen" next to the solid red of the one under the mouse. (Select2's own is a light grey,
   which in dark mode held white text.) Under the mouse it turns solid red like any option. */
.select2-container--default .select2-results__option[aria-selected=true]:not(.select2-results__option--highlighted) {
    background-color: rgba(var(--color-primary-rgb), .1);
}
/* Dark mode: the theme paints the option under the mouse #22242B (barely different from the
   list) with grey text, !important. Solid red with white text instead, as in light mode. */
body.dark-only .select2-container--default .select2-results .select2-results__option--highlighted[aria-selected] {
    background-color: var(--color-primary) !important;
    color: #fff !important;
}
body.dark-only .select2-container--default .select2-results__option[aria-selected=true]:not(.select2-results__option--highlighted) {
    background-color: rgba(var(--color-primary-rgb), .25);
    color: #fff;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--color-selected-bg);
    border-color: rgba(var(--color-primary-rgb), .25);
    color: var(--color-link);
}

/* Choosing a long value must not widen the select (or the table column it sits in). `width: 0`
   keeps the chosen text out of the width the layout measures, `min-width: 100%` still fills the
   box, and what does not fit is cut with "…" — the full text stays readable in the list. */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    width: 0;
    min-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dark mode: the theme draws these borders in the same colour as their background, so they
   disappear. They get the same border as the other inputs (.form-control) instead. */
body.dark-only .select2-container--default .select2-selection--single,
body.dark-only .select2-container--default .select2-selection--multiple {
    border: 1px solid rgba(255, 255, 255, .1) !important;
}
body.dark-only .select2-container--default.select2-container--open .select2-selection--single,
body.dark-only .select2-container--default.select2-container--focus .select2-selection--single,
body.dark-only .select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: rgba(var(--color-primary-rgb), .6) !important;
}
body.dark-only .form-select,
body.dark-only .select2-dropdown,
body.dark-only .select2-container--default .select2-search--dropdown .select2-search__field {
    border-color: rgba(255, 255, 255, .1);
}

/* Pagination: red for the current page, the hover and the focus ring. */
.pagination {
    --bs-pagination-color: var(--color-link);
    --bs-pagination-hover-color: var(--color-link-hover);
    --bs-pagination-hover-bg: var(--color-selected-bg);
    --bs-pagination-focus-color: var(--color-link-hover);
    --bs-pagination-focus-bg: var(--color-selected-bg);
    --bs-pagination-focus-box-shadow: 0 0 0 .2rem var(--color-focus-ring);
    --bs-pagination-active-bg: var(--color-primary);
    --bs-pagination-active-border-color: var(--color-primary);
}
/* The dark theme paints every page link #1A1C23, current page included. */
body.dark-only .page-link:hover { background-color: var(--color-selected-bg); }
body.dark-only .active > .page-link,
body.dark-only .page-link.active {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* ⚠️ The theme renders EVERY dropdown item at `opacity: .6` (style.css), which washes the
   words out — they read as soft or blurred rather than as text, and only the row under the
   cursor came back to full strength. An item is either there to be read or it is not; the
   hover tint below is what marks the one under the cursor. */
.dropdown-menu .dropdown-item {
    opacity: 1;
}

/* Dropdown menus and list groups: a soft red row on hover, solid red when chosen.
   The theme paints dropdown items directly (faded, white on hover), so these do too. */
.dropdown-menu .dropdown-item:is(:hover, :focus),
body.dark-only .dropdown-menu .dropdown-item:is(:hover, :focus) {
    background-color: var(--color-selected-bg);
    opacity: 1;
}
.dropdown-menu .dropdown-item:is(.active, :active),
body.dark-only .dropdown-menu .dropdown-item:is(.active, :active) {
    background-color: var(--color-primary);
    color: #fff;
    opacity: 1;
}
.list-group {
    --bs-list-group-action-hover-bg: var(--color-selected-bg);
    --bs-list-group-active-bg: var(--color-primary);
    --bs-list-group-active-border-color: var(--color-primary);
}

/* Pills (tabs drawn as buttons): red for the open one. */
.nav-pills {
    --bs-nav-link-color: var(--color-link);
    --bs-nav-link-hover-color: var(--color-link-hover);
}
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: var(--color-primary);
    color: #fff;
}

/* Alerts: a soft tint of their colour with dark text, instead of the theme's solid
   fills (teal for primary, full red for danger). Each alert type only picks a colour. */
.alert-primary   { --alert-rgb: var(--color-primary-rgb);   --alert-text: var(--color-primary-active); }
.alert-secondary { --alert-rgb: var(--color-secondary-rgb); --alert-text: var(--color-secondary-active); }
.alert-success   { --alert-rgb: var(--color-success-rgb);   --alert-text: var(--color-success-active); }
.alert-danger    { --alert-rgb: var(--color-danger-rgb);    --alert-text: var(--color-danger-active); }
.alert-warning   { --alert-rgb: var(--color-warning-rgb);   --alert-text: #7A5000; }
.alert-info      { --alert-rgb: var(--color-info-rgb);      --alert-text: var(--color-info-active); }

:is(.alert-primary, .alert-secondary, .alert-success, .alert-danger, .alert-warning, .alert-info) {
    background-color: rgba(var(--alert-rgb), .08) !important;
    border-color: rgba(var(--alert-rgb), .25) !important;
    color: var(--alert-text) !important;
}
/* The theme makes the close "x" white for its solid alerts; on a tint it must be dark. */
:is(.alert-primary, .alert-secondary, .alert-success, .alert-danger, .alert-warning, .alert-info) .btn-close {
    filter: none !important;
}
body.dark-only :is(.alert-primary, .alert-secondary, .alert-success, .alert-danger, .alert-warning, .alert-info) {
    background-color: rgba(var(--alert-rgb), .16) !important;
    border-color: rgba(var(--alert-rgb), .35) !important;
    color: rgba(255, 255, 255, .88) !important;
}
body.dark-only :is(.alert-primary, .alert-secondary, .alert-success, .alert-danger, .alert-warning, .alert-info) .btn-close {
    filter: brightness(.8) invert(1) !important;
}

/* ═════════════════════════════════════════════════════════════════════════════
   TYPOGRAPHY

   The template ships Montserrat at weight 400, which is a geometric face and reads
   noticeably thin at 12–14px — the sizes this app is almost entirely built from. That,
   plus a handful of one-off sizes, is what made the screens look inconsistent.

   Everything below is the base layer: change it here, not on a page.

   The scale, and nothing else:
     12px  supporting detail (muted lines, badges, small buttons)
     13px  dense labels
     14px  body, tables, inputs, sidebar     ← the default
     16px  card titles (h5)
     20px+ headings and figures

   Weights: 500 body · 600 headings, table headers, badges · 700 figures and money.
   ═════════════════════════════════════════════════════════════════════════════ */

body {
    /* The single biggest legibility win: 400 Montserrat at 14px is the "thin" text.
       Everything that does not set its own weight inherits this. */
    font-weight: 500;
}

/* Bootstrap sizes <small> relatively (0.875em), so a 14px parent gives 12.25px and a
   12px parent 10.5px — the same element ends up a different size in each place it is
   used. Pin it to the scale. */
small,
.small {
    font-size: 12px;
}

/* Muted text was rgba(33, 37, 41, .75): transparency, so it also picked up whatever it
   sat on and dropped below a comfortable contrast on tinted rows. A solid grey holds
   ~5.7:1 on white and stays the same colour everywhere. */
:root {
    --bs-secondary-color: #5a6472;
}

/* Headings: the theme leaves h5 — which is every card title in this app — at 500, the
   same weight as the body text under it, so a card had no visible title. */
h5 {
    font-weight: 600;
}

/* A table header should read as a header. The theme left it at the row weight. */
.table > thead th,
table > thead th {
    font-weight: 600;
}

/* Button weight lives in the BUTTONS section above. */

/* The theme sizes badges relatively too (0.75em), so they came out at 10.5px — below the
   scale and hard to read on a saturated fill. Size and weight are set outright because the
   theme writes both directly on `.badge`, not through Bootstrap's variables. */
.badge {
    font-size: 12px;
    font-weight: 600;
}

/* Inputs were 1rem (16px) while their labels were 14px, so a filter panel mixed two sizes
   in the same column. The weight is restated because a form control does not inherit the
   page's font at all — the browser gives it its own. */
.form-control,
.form-select {
    font-size: 14px;
    font-weight: 500;
}

/* The muted grey is fixed above for light mode; dark mode keeps the theme's own
   white-on-dark value, which already has the contrast it needs. */

/* ApexCharts draws its own labels and ships them at weight 400, so the legends and axes
   under a chart were the last thin text on the page. `!important` because the library
   sets these on the elements it creates. */
.apexcharts-legend-text,
.apexcharts-text tspan,
.apexcharts-title-text,
.apexcharts-datalabel {
    font-family: "Montserrat", sans-serif !important;
    font-weight: 500 !important;
}

/* ── DATE PICKERS ─────────────────────────────────────────────────────────────────────────
   Two libraries draw the calendars in this app: bootstrap-daterangepicker behind the filter
   panels' range fields (sized in that component), and air-datepicker behind the single
   date/time fields. Both ship days around 32px, which is small for a control that is opened
   dozens of times a day — these bring the second one up to match the first. */
.datepicker { width: 320px; }
.datepicker--cell { height: 42px; }
.datepicker--cell-day { height: 42px; font-size: 15px; }
.datepicker--day-name { font-size: 13px; }

/* air-datepicker ships its own blue (#5cc4ef / #4EB5E6) for the chosen day, today and the
   buttons under the calendar, so a single date field did not look like the range field beside
   it. These are the same colours the range picker uses (see the date-range-input component):
   the brand red for what is chosen, a 10% tint for a range, and the red for today's number.
   The month title, the arrows and the day names come from the theme's blue `--theme-deafult`,
   which is NOT remapped here, so they are set below as well. */
/* `!important` because style.css paints the chosen day with `var(--theme-deafult) !important`,
   and that variable is the theme's blue (it is NOT remapped — the :root line further up this
   file sits inside a comment on purpose, so the rest of the app keeps its own colours). */
.datepicker--cell.-selected-,
.datepicker--cell.-selected-.-current- {
    background: var(--brand) !important;
    color: var(--brand-contrast) !important;
}
.datepicker--cell.-selected-.-focus- { background: var(--brand-dark) !important; }
/* Hovering any other day also paints blue in style.css (`.datepicker--cell.-focus-`). */
.datepicker--cell.-focus- {
    background: rgba(var(--brand-rgb), .12) !important;
    color: var(--brand) !important;
}

/* The month title, the arrows either side of it, and the S M T W T F S row: all blue from the
   theme (`--theme-deafult`, and #4466f2 for the day names). */
.datepicker--nav-title,
.datepicker--nav-title i { color: var(--brand); }
.datepicker--nav-action { background: var(--brand); }
.datepicker--nav-action:hover { background: var(--brand-dark); }
.datepicker--nav-action path { stroke: var(--brand-contrast); }
.datepicker--day-name { color: var(--brand); }
/* On a very small screen, responsive.css (loaded after this file) drops the arrow's background
   and paints the glyph with the theme blue. Same width as that file, so the arrows stay red. */
@media only screen and (max-width: 360px) {
    .datepicker--nav-action path { stroke: var(--brand); }
}
.datepicker--cell.-current- {
    color: var(--brand);
    border-color: var(--brand);
}
.datepicker--cell.-current-.-in-range- { color: var(--brand); }
.datepicker--cell.-in-range- { background: rgba(var(--brand-rgb), .10); }
.datepicker--cell.-range-from-,
.datepicker--cell.-range-to- {
    border-color: rgba(var(--brand-rgb), .5);
    background-color: rgba(var(--brand-rgb), .10);
}
/* "Today" and "Clear" under the calendar. */
.datepicker--button { color: var(--brand); }
.datepicker--button:hover {
    color: var(--brand);
    background: rgba(var(--brand-rgb), .10);
}
/* A day that cannot be picked: the days before today in a "from now on" field (a call back).
   Only those fields have such days. Faded and crossed out, with no hover colour, so they do
   not look clickable — they looked like any other day before, and a click did nothing. */
.datepicker--cell.-disabled- {
    opacity: .35;
    text-decoration: line-through;
    cursor: not-allowed;
}
.datepicker--cell.-disabled-.-focus- {
    background: none !important;
    color: inherit !important;
}

/* ── PAGE LOADER ─────────────────────────────────────────────────────────────────────────
   The spinner shown while a page loads. Its dots are box-shadows, so they take this colour.
   The theme sets it to blue; we use the logo red. */
.loader-wrapper .loader4 { color: var(--brand); }

/* ── SIDEBAR SUB-LINK ICONS ──────────────────────────────────────────────────────────────
   A link inside a sidebar dropdown can have an icon (`icon` in config/admin_sidebar.php).
   The icon replaces the theme's small dot in front of the link, so the dot is hidden on those
   links. The theme's selector for the dot is very long, so `!important` is needed to win. */
.sidebar-submenu li a.has-icon::before { display: none !important; }
/* Without the dot the link needs less room on the left (the theme gives 50px). Starts from the
   sidebar's id, so it beats the theme's long `!important` selector. */
/* 38px for the icon, written as 58px − 20px: a label long enough for a second line starts that
   line under the text, not under the icon. The first line stays where it was. */
#sidebar-menu .sidebar-submenu > li > a.has-icon { padding-left: 58px !important; text-indent: -20px; }
.sidebar-child-icon {
    width: 14px;
    margin-right: 2px;
    font-size: 12px;
    text-align: center;
}

/* ═════════════════════════════════════════════════════════════════════════════
   FILTER DRAWER — <x-ui.filter-drawer>
   The filters as a panel sliding in from the right, opened either from the card
   header or from a tab stuck to the edge of the screen.
   ═════════════════════════════════════════════════════════════════════════════ */

/* The tab on the right edge. Fixed, so it is still there at the foot of a long
   table; under the offcanvas (1045) and its backdrop (1040), so it is not drawn
   on top of the panel it opens. */
.fd-tab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1035;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 9px;
    border: 0;
    border-radius: 8px 0 0 8px;
    background: #fff;
    color: var(--brand);
    box-shadow: 0 3px 14px rgba(0, 0, 0, .18);
    transition: background-color .15s ease, color .15s ease, padding-right .15s ease;
}
.fd-tab:hover,
.fd-tab:focus-visible {
    background: var(--brand);
    color: var(--brand-contrast);
    padding-right: 13px;
    outline: none;
}
.fd-tab i { font-size: 15px; }

/* Filters are on: the tab wears the brand colour so it reads from across the page. */
.fd-tab.is-on { background: var(--brand); color: var(--brand-contrast); }
.fd-tab.is-on:hover, .fd-tab.is-on:focus-visible { background: var(--brand-dark); }

.fd-tab-count {
    min-width: 18px;
    padding: 1px 4px;
    border-radius: 9px;
    background: rgba(0, 0, 0, .18);
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
}
.fd-tab:not(.is-on) .fd-tab-count { background: rgba(var(--brand-rgb), .14); }

body.dark-only .fd-tab { background: #262932; }
body.dark-only .fd-tab:hover, body.dark-only .fd-tab.is-on { background: var(--brand); }

/* How many filters are on, on the header button. */
.fd-count {
    display: inline-block;
    min-width: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--brand);
    color: var(--brand-contrast);
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
}

/* The panel. Never wider than the screen on a phone. The background is written out rather
   than left to --bs-body-bg, which this theme sets to `auto` — not a colour, so the panel
   would come out see-through over the table. */
.offcanvas.fd-panel {
    width: min(var(--fd-width, 400px), 92vw);
    background-color: #fff;
}
body.dark-only .offcanvas.fd-panel { background-color: #262932; color: #cfd4da; }

/* The form fills what is left under the header, so the fields scroll and the
   buttons do not. */
.fd-panel .fd-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}
.fd-panel .offcanvas-body { overflow-y: auto; }

.fd-panel .fd-actions {
    flex: 0 0 auto;
    padding: 14px 1rem;
    border-top: 1px solid var(--bs-border-color, #e6e6e6);
    background: #fff;
}
body.dark-only .fd-panel .fd-actions { background: #262932; border-top-color: #374558; }

/* A dropdown opened inside the panel has to sit above it. */
.fd-panel .select2-container { z-index: 1046; }

/* Bootstrap Dropdown background — `.dropdown-menu`
   ⚠️ The template leaves `--bs-body-bg` without a usable colour, and Bootstrap builds the menu
   background out of it:

       .dropdown-menu { --bs-dropdown-bg: var(--bs-body-bg); background-color: var(--bs-dropdown-bg); }

   so every dropdown menu in the app computes to `rgba(0, 0, 0, 0)` — fully see-through, with
   the page showing straight through the words. Measured, not guessed: with this block removed
   the menu's computed `background-color` is transparent; with it, white.

   Only `--bs-dropdown-bg` is pinned, never `--bs-body-bg` itself: the theme paints the page and
   its panels with its own colours, so redefining the body token would move things that are not
   broken. Same trap as the offcanvas above — check style.css before trusting a Bootstrap
   variable. */
.dropdown-menu {
    --bs-dropdown-bg: #fff;
    --bs-dropdown-border-color: var(--bs-border-color, #e6e6e6);
    border: 1px solid var(--bs-dropdown-border-color);
}

body.dark-only .dropdown-menu {
    --bs-dropdown-bg: #262932;
    --bs-dropdown-color: #cfd4da;
    --bs-dropdown-link-color: #cfd4da;
    --bs-dropdown-link-hover-bg: #323846;
    --bs-dropdown-link-hover-color: #fff;
    --bs-dropdown-border-color: #374558;
}

/* ═════════════════════════════════════════════════════════════════════════════
   TEXT COLOUR — the black of the logo
   The wordmark in assets/images/logo/logo.png is one flat colour, #1A1A1A
   (sampled from the file: 29,800 pixels of it and nothing else), so the words on
   the screen are that same black and the page reads as one piece with the mark.

   The theme painted its text in four different near-blacks, none of them the
   logo's: #051A1A on the body, the tables and the cards, #222222 on a sidebar
   link, #52526C on its label, and Bootstrap's own #212529 on form labels.

   ⚠️ SCOPE: only text the theme left plain. Anything given a colour by a class —
   .text-muted, .text-primary, .text-danger, a badge, a button — keeps it, because
   Bootstrap writes those with !important and they outrank everything here. That is
   deliberate: this changes the default, not the decisions.

   ⚠️ LIGHT MODE ONLY (`body:not(.dark-only)`). On the dark theme the text is white
   on a dark panel; this black would be unreadable there, so none of it applies.
   ═════════════════════════════════════════════════════════════════════════════ */
:root {
    --color-logo-ink: #1A1A1A;
    --color-logo-ink-rgb: 26, 26, 26;
}

/* What Bootstrap hands to anything reading the body colour — light mode only. */
body:not(.dark-only) {
    --bs-body-color: var(--color-logo-ink);
    --bs-body-color-rgb: var(--color-logo-ink-rgb);
    --bs-heading-color: var(--color-logo-ink);
}

body:not(.dark-only),
body:not(.dark-only) :is(h1, h2, h3, h4, h5, h6),
body:not(.dark-only) :is(.h1, .h2, .h3, .h4, .h5, .h6),
body:not(.dark-only) .card-header h5,
body:not(.dark-only) .form-label,
body:not(.dark-only) label,
body:not(.dark-only) .breadcrumb-item.active,
body:not(.dark-only) .list-group-item {
    color: var(--color-logo-ink);
}

/* Paragraphs keep the softness the theme gave them — 70% — so the page keeps its
   hierarchy; only the colour underneath changes. */
body:not(.dark-only) p {
    color: rgba(var(--color-logo-ink-rgb), .7);
}

/* Tables. The theme writes the colour on `.table th` and `.table td`, so a rule on
   `.table` alone loses to it — the cells have to be named. */
body:not(.dark-only) .table {
    --bs-table-color: var(--color-logo-ink);
}
body:not(.dark-only) .table th,
body:not(.dark-only) .table td {
    color: var(--color-logo-ink);
}

/* The side menu is NOT set here: it already has its own ink token at the top of
   this file (`--sidebar-ink`), which is the one place the theme's very long
   sidebar selectors are answered. It points at this same black. */

/* What a Select2 box shows once something is chosen — the theme left it at #444.
   The highlighted row is skipped: it sits on the red brand background, so its text
   stays white (set further up in this file). */
body:not(.dark-only) .select2-container--default .select2-selection--single .select2-selection__rendered,
body:not(.dark-only) .select2-container--default .select2-results__option:not(.select2-results__option--highlighted) {
    color: var(--color-logo-ink);
}

/* The day numbers in the date picker, which the theme drew at #4A4A4A. A day from
   the month either side stays faded, and a chosen day keeps the brand colour it is
   given elsewhere in this file. */
body:not(.dark-only) .datepicker--cell.datepicker--cell-day:not(.-other-month-):not(.-selected-):not(.-current-) {
    color: var(--color-logo-ink);
}

/* The line under the name in the header's profile card. The theme reaches it with a
   very long selector, so this one has to be just as long to answer it. */
body:not(.dark-only) .page-wrapper .page-header .header-wrapper .nav-right.right-header ul li .profile-media .media-body p {
    color: rgba(var(--color-logo-ink-rgb), .7);
}

/* ═════════════════════════════════════════════════════════════════════════════
   SELLER — THE ACCOUNT MANAGER (top bar button + its window)
   In admin/layout.blade.php. The button sits in the middle of the top bar on wide
   screens (an icon next to Service Fees on small ones) and opens
   #accountManagerModal: photo, name, email, phone, WhatsApp.

   Colours are variables, redeclared for dark mode, like the sidebar block. Two are
   fixed on purpose: WhatsApp's own green, and the white of its logo.
   ═════════════════════════════════════════════════════════════════════════════ */
:root {
    --am-ink: #1A1A1A;
    --am-muted: rgba(26, 26, 26, 0.6);
    --am-line: rgba(82, 82, 108, 0.18);
    --am-surface: #fff;
    --am-row-bg: #F7F8FA;
    --am-row-hover: rgba(var(--brand-rgb), 0.07);
    --whatsapp-green: #25D366;
    --whatsapp-green-dark: #1EBE5A;
}

body.dark-only {
    --am-ink: rgba(255, 255, 255, 0.88);
    --am-muted: rgba(255, 255, 255, 0.55);
    --am-line: rgba(255, 255, 255, 0.15);
    --am-surface: rgba(255, 255, 255, 0.04);
    --am-row-bg: rgba(255, 255, 255, 0.05);
    --am-row-hover: rgba(255, 255, 255, 0.1);
}

/* The middle of the top bar (the bar is the button's positioned parent). */
.page-header .header-wrapper { position: relative; }

/* The top bar is a Bootstrap .row, which makes every child full width: this one keeps the
   width of its button, so the 50% / -50% pair really centres it. */
.page-header .header-wrapper > .header-account-manager {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: auto;
    max-width: none;
    padding: 0;
    transform: translate(-50%, -50%);
}

/* The button: WhatsApp's icon, then the words, in a pill. */
.am-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 16px 4px 4px;
    border: 1px solid var(--am-line);
    border-radius: 50rem;
    background: var(--am-surface);
    color: var(--am-ink);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.am-header-btn:hover {
    border-color: var(--whatsapp-green);
    box-shadow: 0 2px 10px rgba(37, 211, 102, 0.25);
}

/* Only for the keyboard; nothing stays lit after a click. */
.am-header-btn:focus { outline: none; }
.am-header-btn:focus-visible { outline: 2px solid rgba(37, 211, 102, 0.5) !important; outline-offset: 2px; }

/* The theme colours the spans of the top bar; the label keeps the button's ink. */
.am-header-btn .am-header-label { color: var(--am-ink); }

/* Below 1200px the words are hidden: the WhatsApp icon alone, in a round button. */
@media only screen and (max-width: 1199.98px) {
    .am-header-btn { padding: 3px; }
}

/* On a phone: Service Fees is a smaller button, words kept, no icon (room for the logo). */
@media only screen and (max-width: 575.98px) {
    .page-header .header-fees-btn { padding: 3px 8px; font-size: 11.5px; }
    .page-header .header-fees-btn .header-fees-icon { display: none; }
}

/* On a phone (below 768px) the account manager button leaves the top bar and floats at the
   bottom left of the screen, over the page, as WhatsApp buttons usually do. It stays inside
   the top bar's layer, so the opened menu (above the bar) still covers it. The page gets room
   at the bottom, so the button never hides the last line (the footer). */
@media only screen and (max-width: 767.98px) {
    .page-wrapper .page-header .header-wrapper > .header-account-manager {
        position: fixed;
        top: auto;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        left: 16px;
        transform: none;
    }

    .header-account-manager .am-header-btn {
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .header-account-manager .am-wa-icon {
        width: 54px;
        height: 54px;
        font-size: 30px;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    }

    .page-wrapper:has(.header-account-manager) .page-body-wrapper {
        padding-bottom: 80px;
    }
}

.am-wa-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--whatsapp-green);
    color: #fff;
    font-size: 17px;
}

/* The window. */
.am-modal .am-person {
    margin-bottom: 18px;
    text-align: center;
}

/* The photo sits on top of the initials (the same idea as <x-user-card>). */
.am-modal .am-avatar {
    position: relative;
    display: inline-block;
    width: 72px;
    height: 72px;
    margin-bottom: 10px;
}

.am-modal .am-avatar > * {
    position: absolute;
    inset: 0;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
}

.am-modal .am-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand);
    color: #fff;
    font-size: 24px;
    font-weight: 700;
}

.am-modal .am-name {
    color: var(--am-ink);
    font-size: 18px;
    font-weight: 700;
}

.am-modal .am-role {
    color: var(--am-muted);
    font-size: 13px;
}

/* A row: Email (only shown), Phone and WhatsApp (links). */
.am-modal .am-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid var(--am-line);
    border-radius: 10px;
    background: var(--am-row-bg);
    color: var(--am-ink);
    text-decoration: none;
    transition: background-color .15s ease;
}

/* Only the rows you can click (Phone, WhatsApp) react to the mouse. */
.am-modal a.am-row:hover { background: var(--am-row-hover); }

.am-modal .am-row-icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 16px;
}

.am-modal .am-row-icon-email { background: rgba(var(--brand-rgb), 0.12); color: var(--brand); }
.am-modal .am-row-icon-phone { background: rgba(68, 102, 242, 0.12); color: #4466F2; }
.am-modal .am-row-icon-whatsapp { background: var(--whatsapp-green); color: #fff; font-size: 20px; }

/* Dark mode: brighter icons on stronger circles, or they fade into the dark rows. */
body.dark-only .am-modal .am-row-icon-email { background: rgba(var(--brand-rgb), 0.25); color: var(--brand-light); }
body.dark-only .am-modal .am-row-icon-phone { background: rgba(68, 102, 242, 0.25); color: #94a8ff; }

.am-modal .am-row-text { min-width: 0; line-height: 1.3; }

.am-modal .am-row-label {
    display: block;
    color: var(--am-muted);
    font-size: 12px;
}

/* The whole value is shown: a long email goes on to a second line. */
.am-modal .am-row-value {
    display: block;
    color: var(--am-ink);
    font-size: 14px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* "Chat on WhatsApp": WhatsApp's green, in every state. */
.am-modal .am-whatsapp-btn,
.am-modal .am-whatsapp-btn:focus {
    background-color: var(--whatsapp-green) !important;
    border-color: var(--whatsapp-green) !important;
    color: #fff !important;
    font-weight: 600;
}

.am-modal .am-whatsapp-btn:hover,
.am-modal .am-whatsapp-btn:active {
    background-color: var(--whatsapp-green-dark) !important;
    border-color: var(--whatsapp-green-dark) !important;
}

/* ─── TOP BAR: THE DARK MODE BUTTON (the moon) ───────────────────────────────
   A moon drawn in admin/layout.blade.php: a silver crescent (lighter top left, as
   if lit), a few faint craters, a thin grey edge — neutral greys, like the rest of
   the template. Brighter with a soft glow in dark mode.

   The theme colours `li svg` in the top bar (stroke, and fill in dark mode). That
   is set on the <svg> itself, so each part below sets its own fill and stroke. */
:root {
    --moon-light: #FFFFFF;
    --moon-dark: #B4BAC4;
    --moon-crater: rgba(105, 113, 126, 0.35);
    --moon-edge: #8A919C;
    --moon-glow: rgba(0, 0, 0, 0);
}

body.dark-only {
    --moon-light: #FFFFFF;
    --moon-dark: #C9CDD6;
    --moon-crater: rgba(120, 128, 142, 0.45);
    --moon-edge: rgba(255, 255, 255, 0.6);
    --moon-glow: rgba(255, 255, 255, 0.35);
}

.page-wrapper .page-header .header-wrapper .nav-right > ul > li .mode svg.moon-real {
    filter: drop-shadow(0 0 3px var(--moon-glow));
    transition: filter .2s ease, transform .2s ease;
}

.mode svg.moon-real .moon-body { fill: url(#moonShade); stroke: none; }
.mode svg.moon-real .moon-craters circle { fill: var(--moon-crater); stroke: none; }
.mode svg.moon-real .moon-edge { fill: none; stroke: var(--moon-edge); stroke-width: 1; }

/* Under the mouse: a slight turn, like the moon tilting. */
.page-wrapper .page-header .header-wrapper .nav-right > ul > li .mode:hover svg.moon-real {
    transform: rotate(-15deg);
}

/* ─── TOP BAR: THE TASKS ICON (beside the moon) ──────────────────────────────
   Admin only, for users with can_manage_tasks = 1 (admin/layout.blade.php). A
   checkbox icon the size of the moon; a red number on its corner when some tasks
   have something new. */
.page-header .header-tasks-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #8A919C;
    font-size: 22px;
    line-height: 1;
    transition: color .15s ease, transform .15s ease;
}

.page-header .header-tasks-link:hover,
.page-header .header-tasks-link.is-active { color: var(--brand); }

.page-header .header-tasks-link:hover { transform: translateY(-1px); }

body.dark-only .page-header .header-tasks-link { color: rgba(255, 255, 255, 0.75); }
body.dark-only .page-header .header-tasks-link:hover,
body.dark-only .page-header .header-tasks-link.is-active { color: #FF6B5F; }

.page-header .header-tasks-link .header-tasks-badge {
    position: absolute;
    top: -7px;
    right: -10px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    border: 2px solid #FFFFFF;
    background: var(--brand);
    color: #FFFFFF;
    font-size: 9.5px;
    font-weight: 700;
    line-height: 13px;
    text-align: center;
    font-family: inherit;
}

body.dark-only .page-header .header-tasks-link .header-tasks-badge { border-color: #1A1C23; }

/* ─── TOP BAR: THE SLOGAN (under "Welcome …") ────────────────────────────────
   Our logo mark, small, then "The smart way to sell". The mark fills about two
   thirds of logo-icon.png (the rest is transparent), so a 22px image shows a
   ~14px mark, as tall as the text. */
.page-wrapper .page-header .header-wrapper .left-header .header-slogan {
    align-items: center;
    gap: 6px;
}

/* No margin: the theme pulls the images of this area up (the hand gif cancels it with mt-0). */
.page-wrapper .page-header .header-wrapper .left-header .header-slogan img {
    width: 22px;
    height: 22px;
    margin: 0;
}

/* ═════════════════════════════════════════════════════════════════════════════
   PHONES — SPACE ON THE SIDES OF EVERY PAGE
   Below 576px the theme (responsive.css) removes the page's side padding
   (`.page-body { padding: 0 !important }`) and expects each page to wrap its
   content in a .container-fluid (12px). Many pages do not, so their cards,
   filters and buttons touched both edges of the screen.

   Instead, on a phone: the page keeps 12px on each side, and a .container-fluid
   placed directly in it (the title's, or a page's own) adds nothing more. Every
   page gets the same 12px, with or without one, and the title lines up with the
   cards. The leading `body` beats the theme's rule, which loads after this file.
   ═════════════════════════════════════════════════════════════════════════════ */
@media only screen and (max-width: 575.98px) {
    body .page-wrapper .page-body-wrapper .page-body {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    body .page-wrapper .page-body-wrapper .page-body > .container-fluid {
        padding-left: 0;
        padding-right: 0;
    }
}

/* ─── PHONES AND TABLETS: THE LOGO IN THE TOP BAR ────────────────────────────
   Below 992px the menu (and its logo) is hidden until the menu button is used,
   so the top bar showed no logo at all. Next to the menu button now
   (admin/layout.blade.php, `.header-mobile-logo`, hidden from 992px up): the full
   logo, black or white to match the mode.

   On a phone it takes the room left between the menu button and the buttons on
   the right — the right group is ~190px wide and the logo starts 62px in, so the
   room is the screen width minus ~262px — at most 156px (its tablet size). Below
   360px that room is too small to read the words, so the logo mark shows instead. */
.page-wrapper .page-header .header-wrapper .header-logo-wrapper {
    align-items: center;
}

.page-wrapper .page-header .header-wrapper .header-logo-wrapper .header-mobile-logo {
    align-items: center;
    margin-left: 12px;
    line-height: 0;
}

.header-mobile-logo .logo-mark { width: 34px; height: 34px; }
.header-mobile-logo .logo-full { display: none; width: clamp(96px, calc(100vw - 262px), 156px); height: auto; }

@media only screen and (min-width: 360px) {
    .header-mobile-logo .logo-mark { display: none; }
    .header-mobile-logo .logo-full-light { display: inline; }
    body.dark-only .header-mobile-logo .logo-full-light { display: none; }
    body.dark-only .header-mobile-logo .logo-full-dark { display: inline; }
}

/* While this logo shows (below 992px), the bar is: menu button, logo, buttons on the right.
   - "Welcome …" (which the theme shows again from ~900px) is hidden, as on a phone: next to
     the logo it crowded the bar.
   - The right group is only as wide as its buttons (the theme gives it a fixed 2/3 of the
     bar), so with the full logo it never drops to a second line. */
@media only screen and (max-width: 991.98px) {
    .page-wrapper .page-header .header-wrapper > .left-header {
        display: none;
    }

    .page-wrapper .page-header .header-wrapper > .nav-right {
        flex: 0 0 auto;
        width: auto;
    }
}

/* A classification's icon: the SVG code saved in classifications.icon_svg (cleaned before it is
   saved — App\Support\Services\SvgIconService), printed inside this span. It is as big as the text
   next to it, and an icon drawn in "currentColor" takes that text's colour (white on a red button,
   red on an outline one). Used on Settings → Classifications, Drop → Classificating and Drop Offers. */
.classification-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.15em;
    height: 1.15em;
    vertical-align: -0.2em;
}

.classification-icon svg {
    width: 100%;
    height: 100%;
}

/* Dark mode: the theme greys every span (`body.dark-only span`), which would make a "currentColor"
   icon grey on a red button too. The icon takes the colour of the text around it instead. */
body.dark-only .classification-icon {
    color: inherit;
}

/* On a red background (a chosen button on Drop Offers, the chosen pill on Classificating) a
   coloured icon would be lost in the red: there it sits on a small white disc. The negative margin
   keeps the button as tall as the others. */
.btn-primary .classification-icon,
.nav-pills .nav-link.active .classification-icon {
    width: 1.5em;
    height: 1.5em;
    padding: .2em;
    margin-block: -.2em;
    background: #fff;
    border-radius: 50%;
}

/* Product search boxes with pictures (assets/js/product-select-with-image.js), in every portal.
   The open list: the picture, then three lines on its right: the SKU on one line, the name on
   two. A longer name stops at the end of the second line with "…". The colours are inherited, so
   the row under the mouse (white on red) stays readable. */
.product-select-with-image-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.product-select-with-image-picture { flex-shrink: 0; width: 56px; height: 56px; object-fit: cover; border-radius: 6px; background: var(--bs-secondary-bg); }
.product-select-with-image-text { min-width: 0; line-height: 1.35; }
.product-select-with-image-sku { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* dir="auto" keeps Arabic words in order; every name still starts on the left. */
.product-select-with-image-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
                                  overflow: hidden; overflow-wrap: anywhere; opacity: .85; text-align: left; }

/* The closed box has room for one line of text (21px): a small picture and "SKU - name". In a
   box that takes several products, each chosen one is a small picture and its SKU. */
.product-select-with-image-row.is-chosen { gap: 8px; }
.product-select-with-image-row.is-chosen .product-select-with-image-picture { width: 21px; height: 21px; border-radius: 4px; }
.product-select-with-image-chosen-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.select2-selection--multiple .product-select-with-image-row.is-chosen { display: inline-flex; gap: 5px; vertical-align: middle; }
.select2-selection--multiple .product-select-with-image-row.is-chosen .product-select-with-image-picture { width: 18px; height: 18px; border-radius: 3px; }

/* The rows are taller, so the open list is too (Select2's own is 200px): about five products. */
.product-select-with-image-dropdown .select2-results > .select2-results__options { max-height: 360px; }

/* Product lists: the row under the mouse takes the soft red of the chosen row (not the solid red
   of the other lists), so the picture and the text stay easy to read. Both look the same. Dark
   mode has to beat the theme's own !important colours (see the select2 rules further up). */
.product-select-with-image-dropdown .select2-results__option--highlighted[aria-selected],
.product-select-with-image-dropdown .select2-results__option[aria-selected=true] {
    background-color: rgba(var(--color-primary-rgb), .1);
    color: var(--color-logo-ink);
}
body.dark-only .product-select-with-image-dropdown .select2-results .select2-results__option--highlighted[aria-selected],
body.dark-only .product-select-with-image-dropdown .select2-results .select2-results__option[aria-selected=true] {
    background-color: rgba(var(--color-primary-rgb), .25) !important;
    color: #fff !important;
}
/* A narrow field (a filter in the side drawer) still opens a list wide enough for the SKU and
   two lines of name. A list that would pass the screen's edge is moved left by the script. */
.product-select-with-image-dropdown { min-width: 300px; }

/* A "New" label next to a sidebar link ('badge' => 'New' in config/app-role-modules.php, hidden
   after 'badge_until'). White on the brand red, also on a hovered or current link: the sidebar
   paints every span of a link with long selectors, so color, background and font-weight (bold, on
   request 2026-11-10: the theme made it 600) need !important. */
.page-wrapper .sidebar-wrapper .sidebar-links .sidebar-link .sidebar-new-badge {
    background: var(--brand) !important;
    color: #fff !important;
    font-size: 10px;
    font-weight: 800 !important;
    line-height: 1;
    padding: 4px 7px;
    border-radius: 10px;
    margin-left: auto;
}
