/* =====================================================================
   WeCourier Theme System  â€”  Glass-morphism + Dark/Light mode
   ---------------------------------------------------------------------
   - Scoped via the [data-we-theme] attribute on <html> (set early in
     header.blade.php to prevent a flash of the wrong theme).
   - Light mode keeps the existing look and layers tasteful frosted glass
     on key surfaces (navbar, sidebar, cards, modals, dropdowns).
   - Dark mode is fully additive: every rule is scoped under
     html[data-we-theme="dark"] so it never affects light mode.
   - Data tables are kept crisp/solid for readability.
   - Pure presentation. No markup/structure assumptions beyond classes
     already present in the Bootstrap admin theme.
   ===================================================================== */

:root {
    --we-glass-blur: 14px;
    --we-radius: 16px;

    /* Light-mode glass tokens */
    --we-glass-bg: rgba(255, 255, 255, 0.62);
    --we-glass-border: rgba(15, 23, 42, 0.08);
    --we-glass-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

/* Smooth the transition when the user flips themes */
html[data-we-theme] body,
html[data-we-theme] .card,
html[data-we-theme] .modal-content,
html[data-we-theme] .nav-left-sidebar,
html[data-we-theme] .dropdown-menu {
    transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

/* =====================================================================
   1. GLASS-MORPHISM (applies in BOTH light and dark)
   ===================================================================== */

/* Cards.
   IMPORTANT: exclude cards that intentionally carry their own colored
   background (dashboard gradient stat tiles). Otherwise this rule's higher
   specificity would overwrite their gradients with plain glass. */
html[data-we-theme] .card:not(.cm-metric-card) {
    background: var(--we-glass-bg);
    -webkit-backdrop-filter: blur(var(--we-glass-blur));
    backdrop-filter: blur(var(--we-glass-blur));
    border: 1px solid var(--we-glass-border);
    border-radius: var(--we-radius);
    box-shadow: var(--we-glass-shadow);
}
html[data-we-theme] .card:not(.cm-metric-card) > .card-header {
    background: transparent;
    border-bottom: 1px solid var(--we-glass-border);
}

/* Sidebar */
html[data-we-theme] .nav-left-sidebar {
    -webkit-backdrop-filter: blur(var(--we-glass-blur));
    backdrop-filter: blur(var(--we-glass-blur));
    background: var(--we-glass-bg);
    border-right: 1px solid var(--we-glass-border);
}

/* Dropdown menus */
html[data-we-theme] .dropdown-menu {
    -webkit-backdrop-filter: blur(var(--we-glass-blur));
    backdrop-filter: blur(var(--we-glass-blur));
    background: var(--we-glass-bg);
    border: 1px solid var(--we-glass-border);
    border-radius: 12px;
    box-shadow: var(--we-glass-shadow);
}

/* Modals.
   Keep the frosted aesthetic but use a near-solid panel so form fields stay
   readable over busy page content (the 0.62 glass bg is too transparent for
   modals and reads as "broken"). Dark mode sets its own opaque value below. */
html[data-we-theme] .modal-content {
    -webkit-backdrop-filter: blur(var(--we-glass-blur));
    backdrop-filter: blur(var(--we-glass-blur));
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid var(--we-glass-border);
    border-radius: var(--we-radius);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

/* =====================================================================
   2. DARK MODE
   ===================================================================== */

html[data-we-theme="dark"] {
    /* Dark glass tokens override the light ones */
    --we-glass-bg: rgba(22, 32, 50, 0.55);
    --we-glass-border: rgba(255, 255, 255, 0.08);
    --we-glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);

    --we-dark-bg: #0b1220;
    --we-dark-surface: #131c2e;
    --we-dark-text: #ffffff;        /* primary text = pure white in dark mode */
    --we-dark-muted: #cbd5e1;       /* "muted" text = slate-300, still light/legible */
    --we-dark-border: rgba(255, 255, 255, 0.14);
}

/* Base canvas. NOTE on `.dashboard-content`: a few pages (Tickets, etc.)
   override it to a light cream `background-color: var(--surface)` â€”
   adding it here keeps that override dark in dark mode without us
   having to touch each blade. */
html[data-we-theme="dark"] body,
html[data-we-theme="dark"] .dashboard-main-wrapper,
html[data-we-theme="dark"] .dashboard-ecommerce,
html[data-we-theme="dark"] .main-content,
html[data-we-theme="dark"] .dashboard-content {
    background-color: var(--we-dark-bg) !important;
    color: var(--we-dark-text);
}

/* General text */
html[data-we-theme="dark"] body,
html[data-we-theme="dark"] p,
html[data-we-theme="dark"] span,
html[data-we-theme="dark"] label,
html[data-we-theme="dark"] li,
html[data-we-theme="dark"] td,
html[data-we-theme="dark"] th,
html[data-we-theme="dark"] h1,
html[data-we-theme="dark"] h2,
html[data-we-theme="dark"] h3,
html[data-we-theme="dark"] h4,
html[data-we-theme="dark"] h5,
html[data-we-theme="dark"] h6,
html[data-we-theme="dark"] .page-header,
html[data-we-theme="dark"] .breadcrumb-item {
    color: var(--we-dark-text);
}
html[data-we-theme="dark"] .text-muted,
html[data-we-theme="dark"] .text-dark,
html[data-we-theme="dark"] small.text-muted {
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .text-black,
html[data-we-theme="dark"] .text-body {
    color: var(--we-dark-text) !important;
}

/* Cards / panels in dark (gradient stat tiles keep their own colors) */
html[data-we-theme="dark"] .card:not(.cm-metric-card) {
    background: var(--we-glass-bg);
    border-color: var(--we-glass-border);
    color: var(--we-dark-text);
}
html[data-we-theme="dark"] .card:not(.cm-metric-card) > .card-header,
html[data-we-theme="dark"] .card:not(.cm-metric-card) .card-title,
html[data-we-theme="dark"] .card:not(.cm-metric-card) > .card-footer {
    background-color: transparent !important; /* beats inline background:#fff on some headers */
    color: var(--we-dark-text);
    border-color: var(--we-glass-border) !important;
}
/* =====================================================================
   Dashboard "Cargo Summary" metric tiles (`.cm-metric-card`)
   ---------------------------------------------------------------------
   In light mode, dashboard.blade.php intentionally FLATTENS every
   gradient variant (.cm-metric-card--indigo / --teal / --orange / ...)
   to a plain white card with dark text, via this rule (inline in the
   blade template):

       .we-dashboard .cm-metric-card,
       .we-dashboard .cm-metric-card--indigo,
       ... {
           background: #fff !important;
           color: var(--we-dark) !important;
       }

   That `background: #fff !important` survives into dark mode because
   our generic `html[data-we-theme="dark"] .card` recolor explicitly
   excludes `.cm-metric-card` (the original intention was to preserve
   gradient stat tiles on other pages). Result: white card + the white
   text we were forcing â†’ the entire label/value/sub-text disappears
   in dark mode while only the icon remains visible. That's exactly
   the bug in the user's screenshot.

   Fix: scope a dark-surface override to `.we-dashboard .cm-metric-card`
   (specificity 0,3,1 â€” beats the inline `.we-dashboard .cm-metric-card`
   at 0,2,0 even though both have `!important`). Then use a soft
   light-on-dark palette for the text instead of pure #fff so the
   numbers don't glare. Selector includes every gradient modifier so
   merchant + admin dashboards are covered with one block.
   ===================================================================== */
html[data-we-theme="dark"] .we-dashboard .cm-metric-card,
html[data-we-theme="dark"] .we-dashboard .cm-metric-card--indigo,
html[data-we-theme="dark"] .we-dashboard .cm-metric-card--teal,
html[data-we-theme="dark"] .we-dashboard .cm-metric-card--orange,
html[data-we-theme="dark"] .we-dashboard .cm-metric-card--blue,
html[data-we-theme="dark"] .we-dashboard .cm-metric-card--purple,
html[data-we-theme="dark"] .we-dashboard .cm-metric-card--slate {
    background: var(--we-dark-surface) !important;
    color: var(--we-dark-text) !important;
    border: 1px solid var(--we-dark-border) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35) !important;
}
/* Subtle hover lift kept, but recoloured for the dark surface */
html[data-we-theme="dark"] .we-dashboard .cm-metric-card:hover {
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.50) !important;
    border-color: rgba(0, 168, 232, 0.35) !important;
}
/* Icon chip: switch the light-mode `rgba(0,0,0,0.06)` tint to a
   matching light tint on the dark surface, and tint the glyph with
   the accent colour for a touch of brand. */
html[data-we-theme="dark"] .we-dashboard .cm-metric-card .cm-metric-icon {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: var(--we-accent, #00a8e8) !important;
}
html[data-we-theme="dark"] .we-dashboard .cm-metric-card .cm-metric-icon i {
    color: var(--we-accent, #00a8e8) !important;
}
/* Text palette: label = muted, value = strong, sub = muted */
html[data-we-theme="dark"] .we-dashboard .cm-metric-card .cm-metric-label {
    color: var(--we-dark-muted) !important;
    opacity: 1;
}
html[data-we-theme="dark"] .we-dashboard .cm-metric-card .cm-metric-value {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .we-dashboard .cm-metric-card .cm-metric-sub {
    color: var(--we-dark-muted) !important;
    opacity: 1;
}

/* Fallback for any `.cm-metric-card` that ISN'T inside a `.we-dashboard`
   wrapper (in case the same tile is reused on a future page). Keep the
   text light and visible on whatever surface it ends up on. */
html[data-we-theme="dark"] .cm-metric-card .cm-metric-label,
html[data-we-theme="dark"] .cm-metric-card .cm-metric-sub {
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .cm-metric-card .cm-metric-value {
    color: var(--we-dark-text) !important;
}

/* =====================================================================
   Dashboard "Transiting Cargoes" card + "Shipping Rates" panel
   ---------------------------------------------------------------------
   Both panels live inside `.we-dashboard` and hardcode light colours
   (inline `style="color:#0f172a"` for the card titles, inline
   `style="background:#fff"` on the card-header and table rows,
   `.we-dashboard table.table thead th { color: rgba(0,0,0,0.84)!important }`
   for the column headers, and `.we-dashboard .cm-rate-item { background:
   #fff }` + `.we-dashboard .cm-rate-title { color: var(--we-dark) }` for
   the rate list). In dark mode all of that lands on the dark canvas and
   reads as invisible text on white chips or invisible dark text on dark
   surfaces (exactly the two screenshots).

   The fix is one block scoped under `html[data-we-theme="dark"]
   .we-dashboard`, which beats every `.we-dashboard <â€¦>` rule on
   specificity (+1 attribute). Inline `style="color:#0f172a"` and
   `color: rgba(15,23,42â€¦)` are caught with substring attribute
   selectors so we don't have to touch the blade markup.
   ===================================================================== */

/* --- Transiting Cargoes: card title + table headers --- */
/* Inline `style="color:#0f172a"` titles in the card header */
html[data-we-theme="dark"] .we-dashboard [style*="color:#0f172a"],
html[data-we-theme="dark"] .we-dashboard [style*="color: #0f172a"],
html[data-we-theme="dark"] .we-dashboard [style*="color:rgb(15,23,42)"],
html[data-we-theme="dark"] .we-dashboard [style*="color: rgb(15, 23, 42)"],
html[data-we-theme="dark"] .we-dashboard [style*="color: rgba(15,23,42"],
html[data-we-theme="dark"] .we-dashboard [style*="color: rgba(15, 23, 42"] {
    color: var(--we-dark-text) !important;
}
/* Inline `style="background:#fff"` chips inside .we-dashboard cards
   already get our generic dark-surface recolor higher up in this file
   (search for `[style*="background:#fff"]`), so card headers + table
   thead/tbody rows pick up the dark surface automatically. */

/* Dashboard table column headers: the blade rule forces them to
   `rgba(0,0,0,0.84) !important` on a `rgba(0,0,0,0.04)` chip â€” invisible
   on dark. Force light text + a faint white tint chip instead. */
html[data-we-theme="dark"] .we-dashboard table.table thead th,
html[data-we-theme="dark"] .we-dashboard table.table thead td {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: var(--we-dark-text) !important;
    border-color: var(--we-dark-border) !important;
}
html[data-we-theme="dark"] .we-dashboard table.table tbody td,
html[data-we-theme="dark"] .we-dashboard table.table tbody th {
    border-color: var(--we-dark-border) !important;
}
/* The 1px row-separator divs in the transiting-cargoes table use
   inline `style="height:1px; background: rgba(15,23,42,0.06)"` â€”
   substring-match the rgba and recolor as a hairline on dark. */
html[data-we-theme="dark"] .we-dashboard [style*="background: rgba(15,23,42,0.06)"],
html[data-we-theme="dark"] .we-dashboard [style*="background: rgba(15, 23, 42, 0.06)"],
html[data-we-theme="dark"] .we-dashboard [style*="background:rgba(15,23,42,0.06)"] {
    background-color: var(--we-dark-border) !important;
}

/* --- Shipping Rates panel --- */
/* Panel container: the blade rule sets `.cm-rates-panel .card-header
   { background:#fff }` directly (no `!important`), our card-header
   recolor in section 2 catches it. Reinforce the body too. */
html[data-we-theme="dark"] .we-dashboard .cm-rates-panel,
html[data-we-theme="dark"] .we-dashboard .cm-rates-panel .card-header,
html[data-we-theme="dark"] .we-dashboard .cm-rates-panel .card-body {
    background-color: transparent !important;
    color: var(--we-dark-text) !important;
}
/* Search input inside the panel */
html[data-we-theme="dark"] .we-dashboard .cm-rates-search {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: var(--we-dark-text) !important;
    border-color: var(--we-dark-border) !important;
}
html[data-we-theme="dark"] .we-dashboard .cm-rates-search::placeholder {
    color: var(--we-dark-muted) !important;
}
/* Section headers ("EXCHANGE RATES", "SEA SHIPPING RATES", "AIR
   SHIPPING RATES"). Blade rule forces them to `var(--we-dark)`
   (near-black) â€” make them muted-light instead. */
html[data-we-theme="dark"] .we-dashboard .cm-rate-section-title h6 {
    color: var(--we-dark-muted) !important;
}

/* Rate items: blade rule paints them `background:#fff` with a near-
   black title/amount. Repaint as a dark surface with light text. */
html[data-we-theme="dark"] .we-dashboard .cm-rate-item {
    background: var(--we-dark-surface) !important;
    border: 1px solid var(--we-dark-border) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.30) !important;
}
html[data-we-theme="dark"] .we-dashboard .cm-rate-item:hover {
    border-color: rgba(0, 168, 232, 0.35) !important;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45) !important;
}
html[data-we-theme="dark"] .we-dashboard .cm-rate-title,
html[data-we-theme="dark"] .we-dashboard .cm-rate-amount {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .we-dashboard .cm-rate-meta {
    color: var(--we-dark-muted) !important;
}

/* --- View All / Manage outline buttons in the panel headers ---
   These are `.btn-outline-primary` and are already styled by the
   global outline-primary dark rules elsewhere; no extra work needed. */

/* =====================================================================
   Supplier Tracking Numbers â€” `.tracking-status-badge` (pending /
   received / shipped) pills
   ---------------------------------------------------------------------
   In `tracking_numbers/index.blade.php` the pills are defined for
   light mode as dark-text-on-pastel-bg:
       .tracking-status-badge--pending  { color:#8a6d3b; background:#fff7df; }
       .tracking-status-badge--received { color:#0f6f62; background:#e4fbf5; }
       .tracking-status-badge--shipped  { color:#0a4f94; background:#e8f3ff; }

   In dark mode, the badge `<span>` gets retinted to `var(--we-dark-text)`
   by our generic text rule `html[data-we-theme="dark"] span { color:â€¦ }`
   (specificity 0,1,2) which beats the per-badge class rule (0,1,0). The
   pastel background survives, the dark foreground does not â€” so the
   text appears as a near-white wash on a cream pill (the "ghost" badges
   in the user's screenshot).

   Fix: give each variant a dark-mode-native palette â€” tinted translucent
   background of the same hue, a brighter coloured foreground, matching
   border â€” at specificity (0,2,1) which beats the generic span rule.
   The `__dot` uses `background: currentColor`, so it picks up the new
   foreground colour automatically.
   ===================================================================== */
html[data-we-theme="dark"] .tracking-status-badge--pending {
    color: #fbbf24 !important;                       /* amber-400 */
    background: rgba(251, 191, 36, 0.14) !important;
    border-color: rgba(251, 191, 36, 0.32) !important;
}
html[data-we-theme="dark"] .tracking-status-badge--received {
    color: #34d399 !important;                       /* emerald-400 */
    background: rgba(52, 211, 153, 0.14) !important;
    border-color: rgba(52, 211, 153, 0.32) !important;
}
html[data-we-theme="dark"] .tracking-status-badge--shipped {
    color: #60a5fa !important;                       /* sky-400 */
    background: rgba(96, 165, 250, 0.14) !important;
    border-color: rgba(96, 165, 250, 0.32) !important;
}
/* The dot already inherits `currentColor`, but re-assert for safety in
   case any other rule paints the dot directly. */
html[data-we-theme="dark"] .tracking-status-badge .tracking-status-badge__dot {
    background: currentColor !important;
}

/* =====================================================================
   Sidebar in dark (desktop)
   ---------------------------------------------------------------------
   header.blade.php contains an inline rule
     .sidebar-dark.nav-left-sidebar .navbar-nav .nav-link {
         color: var(--we-dark) !important;   /* near-black */
     }
   that bleeds into dark mode. We re-assert the dark palette at
   matching specificity (also class-level, !important) but loaded LATER
   in the cascade (this file is appended last in header.blade.php) so
   it wins without needing markup changes.

   We also bump the panel background opacity so the sidebar reads as a
   clearly framed surface rather than a faint wash over the body, and
   theme the profile card + language dropdown that live inside it.
   ===================================================================== */
html[data-we-theme="dark"] .nav-left-sidebar,
html[data-we-theme="dark"] .sidebar-dark.nav-left-sidebar {
    background: rgba(13, 20, 34, 0.92) !important;
    border-right: 1px solid var(--we-dark-border) !important;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.25);
}
/* Link text + icons: force light palette over the inline near-black */
html[data-we-theme="dark"] .sidebar-dark.nav-left-sidebar .navbar-nav .nav-link,
html[data-we-theme="dark"] .nav-left-sidebar .navbar-nav .nav-link {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .sidebar-dark.nav-left-sidebar .navbar-nav .nav-link i,
html[data-we-theme="dark"] .nav-left-sidebar .navbar-nav .nav-link i {
    color: var(--we-accent, #00a8e8) !important;
}
/* Hover/focus: subtle white tint, brighter text */
html[data-we-theme="dark"] .sidebar-dark.nav-left-sidebar .navbar-nav .nav-link:hover,
html[data-we-theme="dark"] .sidebar-dark.nav-left-sidebar .navbar-nav .nav-link:focus {
    background-color: rgba(255, 255, 255, 0.07) !important;
    color: #fff !important;
}
html[data-we-theme="dark"] .sidebar-dark.nav-left-sidebar .navbar-nav .nav-link:hover i,
html[data-we-theme="dark"] .sidebar-dark.nav-left-sidebar .navbar-nav .nav-link:focus i {
    color: #fff !important;
}
/* Active / expanded: accent fill, white fg */
html[data-we-theme="dark"] .sidebar-dark.nav-left-sidebar .navbar-nav .nav-link.active,
html[data-we-theme="dark"] .sidebar-dark.nav-left-sidebar .navbar-nav .nav-link[aria-expanded="true"] {
    background-color: var(--we-accent, #00a8e8) !important;
    color: #fff !important;
}
html[data-we-theme="dark"] .sidebar-dark.nav-left-sidebar .navbar-nav .nav-link.active i,
html[data-we-theme="dark"] .sidebar-dark.nav-left-sidebar .navbar-nav .nav-link[aria-expanded="true"] i {
    color: #fff !important;
}
/* Submenu items â€” the user complained the "Air"/"Sea" subitems read as
   faint blue-grey (`--we-dark-muted`) in dark mode and the inline
   header.blade.php rule paints the .active subitem in
   `var(--we-selection)` (sky-blue, same as the active background) â†’
   invisible. Repaint everything LIGHT so all sidebar text is clearly
   readable in dark mode. Light mode is untouched. */
html[data-we-theme="dark"] .nav-left-sidebar .submenu .nav .nav-item .nav-link {
    color: var(--we-dark-text) !important;   /* off-white, NOT muted */
}
html[data-we-theme="dark"] .nav-left-sidebar .submenu .nav .nav-item .nav-link i {
    color: var(--we-accent, #00a8e8) !important; /* keep brand-coloured icon glyph */
}
html[data-we-theme="dark"] .nav-left-sidebar .submenu .nav .nav-item .nav-link:hover,
html[data-we-theme="dark"] .nav-left-sidebar .submenu .nav .nav-item .nav-link:focus {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: #fff !important;
}
html[data-we-theme="dark"] .nav-left-sidebar .submenu .nav .nav-item .nav-link:hover i,
html[data-we-theme="dark"] .nav-left-sidebar .submenu .nav .nav-item .nav-link:focus i {
    color: #fff !important;
}
/* Active submenu item â€” high-specificity override that beats the
   inline header.blade.php rule
       .sidebar-dark.nav-left-sidebar .submenu .nav .nav-item .nav-link.active {
           color: var(--we-selection) !important;
       }
   (specificity 0,7,0). Ours is 0,8,1 so wins, plus we re-paint the
   icon glyph from sky-blue to white for matching contrast against the
   subtle white-tint background highlight. */
html[data-we-theme="dark"] .sidebar-dark.nav-left-sidebar .submenu .nav .nav-item .nav-link.active,
html[data-we-theme="dark"] .nav-left-sidebar .submenu .nav .nav-item .nav-link.active {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
    border-right-color: var(--we-accent, #00a8e8) !important;
}
html[data-we-theme="dark"] .sidebar-dark.nav-left-sidebar .submenu .nav .nav-item .nav-link.active i,
html[data-we-theme="dark"] .nav-left-sidebar .submenu .nav .nav-item .nav-link.active i {
    color: #fff !important;
}
html[data-we-theme="dark"] .nav-left-sidebar .navbar-heading,
html[data-we-theme="dark"] .nav-left-sidebar .nav-divider {
    color: var(--we-dark-muted) !important;
}

/* Sidebar header card: greeting + role */
html[data-we-theme="dark"] .nav-left-sidebar .we-sidebar-profile,
html[data-we-theme="dark"] .nav-left-sidebar .we-sidebar-profile.card {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .nav-left-sidebar .we-sidebar-profile .font-weight-bold {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .nav-left-sidebar .we-sidebar-profile .text-muted {
    color: var(--we-dark-muted) !important;
}

/* Language dropdown trigger inside the sidebar */
html[data-we-theme="dark"] .nav-left-sidebar .lang-dropdown .dropdown-toggle,
html[data-we-theme="dark"] .nav-left-sidebar .lang-dropdown .btn {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}

/* Offcanvas wrapper that hosts the desktop sidebar carries .bg-white;
   make sure it adopts the dark panel surface so no white halo leaks
   around the fixed sidebar on first paint. */
html[data-we-theme="dark"] .navbar-collapse.offcanvas-nav.bg-white,
html[data-we-theme="dark"] .navbar-collapse.offcanvas.bg-white {
    background-color: transparent !important;
}

/* Belt-and-suspenders: some pages also rely on .offcanvas-header / border
   utilities inside the sidebar â€” keep them dark-friendly. */
html[data-we-theme="dark"] #offcanvasDarkNavbar .offcanvas-header.border-bottom {
    border-bottom-color: var(--we-dark-border) !important;
}
/* The submenu wrapper sits in a collapse div with white default bg; reset */
html[data-we-theme="dark"] .nav-left-sidebar .submenu,
html[data-we-theme="dark"] .nav-left-sidebar .submenu .nav {
    background-color: transparent !important;
}
/* In case any global rule (e.g. table dark theme) leaks color:#fff onto
   sidebar text, re-affirm on the highest-specificity selector we can use. */
html[data-we-theme="dark"] .nav-left-sidebar .navbar-nav > li > .nav-link,
html[data-we-theme="dark"] .nav-left-sidebar .navbar-nav .nav-divider,
html[data-we-theme="dark"] .nav-left-sidebar .nav-link i {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .nav-left-sidebar .navbar-nav > li > .nav-link i {
    color: var(--we-accent, #00a8e8) !important;
}

/* =====================================================================
   Top navbar / header bar in dark
   ---------------------------------------------------------------------
   The desktop topbar in navber.blade.php is wrapped in a div with
   `.text-bg-dark` (Bootstrap util forcing solid black + white text). On
   top of that sits the inner `.admin-topbar-inner` and the outer
   `.navbar.transparent` fixed bar. Without overrides we end up with two
   competing dark surfaces (one almost-black chip + one weak rgba bar),
   so the bar reads as fragmented and the search/profile float without a
   clear frame. The rules below give the topbar ONE clear dark surface
   and theme the controls that sit on it.
   ===================================================================== */
/* --- Single, clearly framed dark surface for the whole topbar ---
   CRITICAL: do NOT apply `backdrop-filter` to any ANCESTOR of
   `.admin-topbar-inner`. The inner bar is `position: fixed` and is meant
   to span the full viewport; per CSS spec, an ancestor with
   `backdrop-filter` (or `transform`/`filter`/`perspective`/`will-change`
   for those) becomes the new containing block for fixed descendants â€”
   which would trap the topbar inside `.dashboard-header` (which lives
   inside `.w-90` inside `.container`, max-width ~1140px) and squeeze
   every item into a narrow strip on the left of the screen. That was
   the dark-mode breakage we were debugging.

   We therefore:
   - Apply the dark BACKGROUND to every layer (so any visible chip is
     dark, no matter which actually paints first).
   - Apply the BACKDROP-FILTER blur only to `.admin-topbar-inner` itself
     (which is already fixed, so creating a containing block on itself
     doesn't change its own positioning).                              */
html[data-we-theme="dark"] .navbar.transparent,
html[data-we-theme="dark"] .dashboard-header,
html[data-we-theme="dark"] .dashboard-header .navbar,
html[data-we-theme="dark"] .admin-topbar-inner {
    background: rgba(11, 18, 32, 0.96) !important;
    color: var(--we-dark-text);
}
/* Backdrop blur ONLY on the fixed topbar itself â€” safe because it has
   no fixed descendants whose containing block we'd be redefining. */
html[data-we-theme="dark"] .admin-topbar-inner {
    -webkit-backdrop-filter: blur(var(--we-glass-blur));
    backdrop-filter: blur(var(--we-glass-blur));
}
/* Bottom hairline on the visible inner bar (which is what the user
   actually sees on the page). */
html[data-we-theme="dark"] .admin-topbar-inner {
    border-bottom: 1px solid var(--we-dark-border) !important;
}
/* Neutralise Bootstrap's `.text-bg-dark` forced palette inside the
   topbar so it inherits our theme surface instead of painting a hard
   black chip. */
html[data-we-theme="dark"] .navbar.transparent .text-bg-dark {
    background-color: transparent !important;
    color: var(--we-dark-text) !important;
}

/* --- LAYOUT: keep the desktop topbar on a single nowrap row ---
   Root cause of the "stacked / broken topbar" we saw in dark mode:
   `.admin-topbar-inner` is `display:flex` but inherits Bootstrap's
   `.navbar { flex-wrap: wrap }` from its parent class. Any child
   widening by even a couple of pixels (e.g. a border we previously
   added to `.admin-top-gs-input-wrap`) pushes the row past 100% and
   the children wrap onto separate lines. Pinning the row to nowrap
   with sane flex bases fixes it without touching markup.
   Scoped to lg+ so the intended mobile stacked layout is preserved. */
@media (min-width: 992px) {
    html[data-we-theme="dark"] .admin-topbar-inner {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 14px;
        width: 100%;
        min-height: 60px;
        padding: 8px 18px;
        box-sizing: border-box;
    }
    /* Logo: fixed pillar on the left */
    html[data-we-theme="dark"] .admin-topbar-inner .navbar-brand {
        flex: 0 0 auto;
        margin: 0;
        padding: 0;
        display: inline-flex;
        align-items: center;
    }
    html[data-we-theme="dark"] .admin-topbar-inner .navbar-brand img.logo {
        max-height: 36px;
        width: auto;
    }
    /* Search holder: takes remaining space, allowed to shrink */
    html[data-we-theme="dark"] .admin-topbar-inner .admin-top-gs-holder {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        margin: 0 !important;
    }
    /* Right nav (To Do + profile): natural width, no wrap */
    html[data-we-theme="dark"] .admin-topbar-inner #navbarSupportedContent {
        flex: 0 0 auto !important;
        width: auto !important;
    }
    html[data-we-theme="dark"] .admin-topbar-inner .navbar-right-top {
        flex-wrap: nowrap !important;
        gap: 10px;
        margin: 0 !important;
    }
    html[data-we-theme="dark"] .admin-topbar-inner .navbar-right-top .nav-item {
        border-right: 0 !important;
    }
}

/* --- Topbar text + profile menu (link colours) --- */
html[data-we-theme="dark"] .navbar.transparent .navbar-right-top .nav-link,
html[data-we-theme="dark"] .navbar.transparent .nav-user .nav-link,
html[data-we-theme="dark"] .navbar.transparent .navbar-right-top .nav-item {
    color: var(--we-dark-text) !important;
    border-color: var(--we-dark-border) !important;
}

/* --- Topbar general-search input + submit pill ---
   IMPORTANT: do NOT add a border to `.admin-top-gs-input-wrap`. The
   wrap is `position: relative` and its icon/button children use
   `position: absolute` against it; adding a border was widening the
   pill and was a contributor to the row overflowing on dark mode. The
   `.admin-top-gs-input` itself already carries the visible pill border. */
html[data-we-theme="dark"] .admin-top-gs-input-wrap {
    background: transparent !important;
    border: 0 !important;
    box-sizing: border-box;
}
html[data-we-theme="dark"] .admin-top-gs-input {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: var(--we-dark-text) !important;
    border: 1px solid var(--we-dark-border) !important;
    box-shadow: none !important;
}
html[data-we-theme="dark"] .admin-top-gs-input:hover,
html[data-we-theme="dark"] .admin-top-gs-input:focus {
    background-color: rgba(255, 255, 255, 0.09) !important;
    border-color: var(--we-accent, #00a8e8) !important;
    box-shadow: 0 0 0 .15rem rgba(0, 168, 232, 0.18) !important;
}
html[data-we-theme="dark"] .admin-top-gs-input::placeholder {
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .admin-top-gs-icon {
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .admin-top-gs-btn,
html[data-we-theme="dark"] .admin-top-gs-btn:hover,
html[data-we-theme="dark"] .admin-top-gs-btn:focus {
    background-color: var(--we-accent, #00a8e8) !important;
    border-color: var(--we-accent, #00a8e8) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(0, 168, 232, 0.25) !important;
}

/* --- Mobile (< lg) topbar polish ---
   The mobile layout intentionally stacks (logo row â†’ search row â†’
   actions row). We just need to make sure each row reads well on the
   dark surface and the controls (hamburger / profile / To-Do) have
   matching weight. */
@media (max-width: 991.98px) {
    html[data-we-theme="dark"] .navbar.transparent {
        padding: 10px 12px !important;
    }
    html[data-we-theme="dark"] .navbar.transparent .navbar-other {
        gap: 8px;
    }
    html[data-we-theme="dark"] .navbar.transparent .navbar-other .navbar-nav.flex-row {
        gap: 8px;
        flex-wrap: nowrap;
    }
    html[data-we-theme="dark"] .admin-top-gs-mobile-row .admin-top-gs-input {
        background-color: rgba(255, 255, 255, 0.06) !important;
        color: var(--we-dark-text) !important;
        border-color: var(--we-dark-border) !important;
    }
    html[data-we-theme="dark"] .offcanvas-nav-btn {
        background-color: rgba(255, 255, 255, 0.06);
        border: 1px solid var(--we-dark-border);
        border-radius: 10px;
        padding: 6px 10px;
    }
}

/* Tables â€” kept crisp/solid for readability; only recolor for dark */
html[data-we-theme="dark"] table.table {
    color: var(--we-dark-text);
    background-color: transparent;
}
html[data-we-theme="dark"] table.table tbody td,
html[data-we-theme="dark"] table.table tbody th {
    background-color: var(--we-dark-surface) !important;
    color: var(--we-dark-text) !important;
    border-color: var(--we-dark-border) !important;
}
/* Keep the strong dark header from the existing theme (#00171f) â€” it already
   reads well in dark mode, so only ensure the hover stays subtle. */
html[data-we-theme="dark"] table.table.table-hover tbody tr:hover > *,
html[data-we-theme="dark"] table.table tbody tr:hover > * {
    background-color: rgba(255, 255, 255, 0.05) !important;
}
html[data-we-theme="dark"] .table-bordered,
html[data-we-theme="dark"] .table-bordered td,
html[data-we-theme="dark"] .table-bordered th {
    border-color: var(--we-dark-border) !important;
}

/* Forms in dark */
html[data-we-theme="dark"] .form-control,
html[data-we-theme="dark"] .custom-select,
html[data-we-theme="dark"] select.form-control,
html[data-we-theme="dark"] textarea.form-control,
html[data-we-theme="dark"] .input-group-text,
html[data-we-theme="dark"] .select2-container--default .select2-selection--single,
html[data-we-theme="dark"] .select2-container--default .select2-selection--multiple {
    background-color: rgba(255, 255, 255, 0.04) !important;
    color: var(--we-dark-text) !important;
    border-color: var(--we-dark-border) !important;
}
html[data-we-theme="dark"] .form-control::placeholder,
html[data-we-theme="dark"] input::placeholder,
html[data-we-theme="dark"] textarea::placeholder {
    color: var(--we-dark-muted) !important;
    opacity: 1;
}
html[data-we-theme="dark"] .form-control:focus {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border-color: var(--we-accent, #00a8e8) !important;
    box-shadow: 0 0 0 .2rem rgba(0, 168, 232, 0.22) !important;
}
/* Select2 dropdown panel + rendered text */
html[data-we-theme="dark"] .select2-dropdown {
    background-color: var(--we-dark-surface) !important;
    border-color: var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered,
html[data-we-theme="dark"] .select2-results__option {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .select2-results__option--highlighted {
    background-color: var(--we-accent, #00a8e8) !important;
}

/* Dropdown menus in dark */
html[data-we-theme="dark"] .dropdown-menu {
    background: rgba(19, 28, 46, 0.92);
    border-color: var(--we-dark-border);
}
html[data-we-theme="dark"] .dropdown-menu .dropdown-item {
    color: var(--we-dark-text);
}
html[data-we-theme="dark"] .dropdown-divider {
    border-color: var(--we-dark-border);
}

/* =====================================================================
   Modals in dark mode â€” clean opaque panel
   ---------------------------------------------------------------------
   The base `.modal-content` rule (section 1) layers a `backdrop-filter:
   blur(â€¦)` + a soft `box-shadow: 0 24px 60px rgba(15,23,42,0.22)` and
   uses a near-transparent background â€” designed for light mode where
   the modal sits over white content and the blur reads as frosted
   glass.

   On the dark canvas, that combo produces the "halo / shadow" the user
   screenshotted on the Bulk SMS modal: the semi-transparent panel
   (rgba(â€¦,0.92)) lets the bright sidebar / topbar / accent pills leak
   through and tint the modal teal/cyan, the backdrop blur swirls those
   leaks into a glow, and the soft shadow extends the halo further.

   Fix in dark mode:
   - Make the panel FULLY OPAQUE (`var(--we-dark-surface)`) so nothing
     bleeds through.
   - Drop the backdrop blur (no longer needed when the panel is solid;
     also avoids creating a new containing block that could trap any
     fixed children inside the modal).
   - Use a tight, neutral drop shadow instead of the soft halo.
   - Darken the modal backdrop a notch so the modal pops cleanly off
     the page behind it.                                                */
html[data-we-theme="dark"] .modal-content {
    background: var(--we-dark-surface) !important;
    border: 1px solid var(--we-dark-border) !important;
    color: var(--we-dark-text);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55) !important;
    -webkit-backdrop-filter: none !important;
            backdrop-filter: none !important;
}
html[data-we-theme="dark"] .modal-header,
html[data-we-theme="dark"] .modal-footer {
    border-color: var(--we-dark-border) !important;
    background: transparent !important;
}
/* The Bootstrap 5 backdrop is `background:#000; opacity:.5` by default,
   which on a dark page lifts the modal only weakly. Push it darker so
   the page behind reads as out-of-focus and the modal stands out. */
html[data-we-theme="dark"] .modal-backdrop,
html[data-we-theme="dark"] .modal-backdrop.show {
    background-color: #000 !important;
    opacity: 0.72 !important;
}

/* =====================================================================
   Bulk SMS modal (#bulkSmsModal) â€” dark mode
   ---------------------------------------------------------------------
   The modal nests several Bootstrap utility classes (`.card.bg-light`,
   `.bg-white` location tiles, `.badge-light`, `.alert-success`, a
   `border-dashed` wrapper, a nav-pills tab strip, etc.). Our generic
   dark rules recolor `.bg-light` and `.bg-white` to `--we-dark-surface`
   â€” the same shade as the modal panel â€” so every card edge disappears
   and the modal reads as a flat washed-out block with no input
   boundaries (exactly what's in the user's screenshot, where it
   looks like "I can't input anything"). Fix: scope a slightly
   LIFTED surface (`rgba(255,255,255,0.04)`) to the modal's nested
   cards / tiles so each region is visibly separated from the
   modal background, and brighten + outline the form controls.
   ===================================================================== */

/* Modal header text â€” force high contrast against the dark surface */
html[data-we-theme="dark"] #bulkSmsModal .modal-header,
html[data-we-theme="dark"] #bulkSmsModal .modal-header * {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] #bulkSmsModal .modal-title {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] #bulkSmsModal .modal-header .text-muted {
    color: var(--we-dark-muted) !important;
}

/* Inner cards (Bulk SMS Campaign, Target Locations, Personalize, Compose
   pane, etc.) â€” give them a SLIGHTLY lifted background so they stand
   apart from the modal surface and have visible edges. */
html[data-we-theme="dark"] #bulkSmsModal .card,
html[data-we-theme="dark"] #bulkSmsModal .card.bg-light,
html[data-we-theme="dark"] #bulkSmsModal .card.border-dashed,
html[data-we-theme="dark"] #bulkSmsModal .card.border {
    background-color: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] #bulkSmsModal .border-dashed {
    border-style: dashed !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
}
html[data-we-theme="dark"] #bulkSmsModal .card .card-body,
html[data-we-theme="dark"] #bulkSmsModal .card .font-weight-bold {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] #bulkSmsModal .card .text-muted,
html[data-we-theme="dark"] #bulkSmsModal .card .small.text-muted,
html[data-we-theme="dark"] #bulkSmsModal .text-muted {
    color: var(--we-dark-muted) !important;
}

/* Round icon chips (`rounded-circle.bg-white` and `.bg-light`) inside
   the modal â€” give them a subtle white tint so they read as a chip and
   the icon stays visible. */
html[data-we-theme="dark"] #bulkSmsModal .rounded-circle.bg-white,
html[data-we-theme="dark"] #bulkSmsModal .rounded-circle.bg-light {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--we-dark-border) !important;
}
html[data-we-theme="dark"] #bulkSmsModal .rounded-circle.bg-white i,
html[data-we-theme="dark"] #bulkSmsModal .rounded-circle.bg-light i {
    color: var(--we-dark-muted) !important;
}

/* SMS-count / segment badges (badge-light with border) */
html[data-we-theme="dark"] #bulkSmsModal .bulk-sms-badge,
html[data-we-theme="dark"] #bulkSmsModal .badge-light.border {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border-color: var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}

/* Location tiles: blade renders them as `.location-tile.border.bg-white`
   â€” make each tile a distinct lifted card, with a brand-accent state for
   the currently selected tile. */
html[data-we-theme="dark"] #bulkSmsModal .location-tile.bg-white,
html[data-we-theme="dark"] #bulkSmsModal .location-tile {
    background-color: rgba(255, 255, 255, 0.04) !important;
    border-color: var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] #bulkSmsModal .location-tile.bg-light,
html[data-we-theme="dark"] #bulkSmsModal .location-tile.border-primary {
    background-color: rgba(0, 168, 232, 0.10) !important;
    border-color: var(--we-accent, #00a8e8) !important;
}
html[data-we-theme="dark"] #bulkSmsModal .location-tile .text-muted {
    color: var(--we-dark-muted) !important;
}

/* Tabs strip (Compose / Templates): the active pill keeps the brand
   accent; the inactive one becomes a subtle outlined chip on dark. */
html[data-we-theme="dark"] #bulkSmsModal .nav-pills .nav-link {
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] #bulkSmsModal .nav-pills .nav-link.active {
    background-color: var(--we-accent, #00a8e8) !important;
    color: #fff !important;
}

/* Form controls inside the modal (textarea, search, etc.) */
html[data-we-theme="dark"] #bulkSmsModal textarea.form-control,
html[data-we-theme="dark"] #bulkSmsModal input.form-control,
html[data-we-theme="dark"] #bulkSmsModal select.form-control {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: var(--we-dark-text) !important;
    border-color: var(--we-dark-border) !important;
}
html[data-we-theme="dark"] #bulkSmsModal textarea.form-control::placeholder,
html[data-we-theme="dark"] #bulkSmsModal input.form-control::placeholder {
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] #bulkSmsModal textarea.form-control:focus,
html[data-we-theme="dark"] #bulkSmsModal input.form-control:focus {
    background-color: rgba(255, 255, 255, 0.09) !important;
    border-color: var(--we-accent, #00a8e8) !important;
    box-shadow: 0 0 0 .15rem rgba(0, 168, 232, 0.18) !important;
}

/* Token / placeholder buttons */
html[data-we-theme="dark"] #bulkSmsModal .token-btn {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] #bulkSmsModal .token-btn:hover {
    background-color: rgba(255, 255, 255, 0.10) !important;
    color: #fff !important;
}

/* Success alert at the bottom of the locations panel */
html[data-we-theme="dark"] #bulkSmsModal .alert-success {
    background-color: rgba(34, 197, 94, 0.10) !important;
    border-color: rgba(34, 197, 94, 0.30) !important;
    color: #86efac !important;
}
html[data-we-theme="dark"] #bulkSmsModal .alert-success * {
    color: #86efac !important;
}

/* btn-light controls (the chevron toggle on the Locations row) */
html[data-we-theme="dark"] #bulkSmsModal .btn-light {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border-color: var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] #bulkSmsModal .btn-light:hover,
html[data-we-theme="dark"] #bulkSmsModal .btn-light:focus {
    background-color: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
}
/* =====================================================================
   Modal close button (Ã— in the top-right) â€” dark mode
   ---------------------------------------------------------------------
   Two flavours exist in this codebase, and they need DIFFERENT
   treatment in dark mode:

   - Bootstrap 4 `.close` is a `<button>` containing a `&times;` text
     glyph. The default Bootstrap rule is `color:#000; opacity:.5;
     text-shadow:0 1px 0 #fff;` â€” invisible on dark. The fix is to
     paint the glyph LIGHT and ditch the white text-shadow + opacity.
     A `filter: invert()` here would re-invert our light glyph back to
     dark, so it must NOT be applied to this variant.

   - Bootstrap 5 `.btn-close` is a `<button>` with a background-image
     SVG of the Ã— glyph. The SVG is black by default. Here `filter:
     invert(1)` IS the right fix â€” it flips the SVG to white.

   Previously both variants shared a single rule that applied
   `invert(1)` to both, which is why the Bootstrap-4 close button (used
   by the Add Tracking Number modal) ended up dark on dark.
   ===================================================================== */
/* Bootstrap 4 text-glyph close */
html[data-we-theme="dark"] .modal-header .close,
html[data-we-theme="dark"] .modal-header .close span,
html[data-we-theme="dark"] .close {
    color: var(--we-dark-text) !important;
    opacity: 1 !important;
    text-shadow: none !important;
}
html[data-we-theme="dark"] .modal-header .close:hover,
html[data-we-theme="dark"] .modal-header .close:focus {
    color: #fff !important;
    opacity: 1 !important;
}

/* Bootstrap 5 SVG icon close */
html[data-we-theme="dark"] .modal-header .btn-close,
html[data-we-theme="dark"] .btn-close {
    filter: invert(1) grayscale(1);
    opacity: .9;
}
html[data-we-theme="dark"] .modal-header .btn-close:hover,
html[data-we-theme="dark"] .modal-header .btn-close:focus {
    opacity: 1;
}

/* List groups, borders, hr */
html[data-we-theme="dark"] .list-group-item {
    background-color: var(--we-dark-surface);
    color: var(--we-dark-text);
    border-color: var(--we-dark-border);
}
html[data-we-theme="dark"] hr {
    border-color: var(--we-dark-border);
}
html[data-we-theme="dark"] .border,
html[data-we-theme="dark"] .border-top,
html[data-we-theme="dark"] .border-bottom,
html[data-we-theme="dark"] .border-left,
html[data-we-theme="dark"] .border-right {
    border-color: var(--we-dark-border) !important;
}

/* Nav tabs / pills */
html[data-we-theme="dark"] .nav-tabs {
    border-color: var(--we-dark-border);
}
html[data-we-theme="dark"] .nav-tabs .nav-link {
    color: var(--we-dark-muted);
}
html[data-we-theme="dark"] .nav-tabs .nav-link.active {
    background-color: var(--we-dark-surface);
    border-color: var(--we-dark-border) var(--we-dark-border) transparent;
    color: var(--we-dark-text);
}

/* Pagination */
html[data-we-theme="dark"] .page-link {
    background-color: var(--we-dark-surface);
    border-color: var(--we-dark-border);
    color: var(--we-dark-text);
}

/* Light backgrounds frequently used as section wrappers */
html[data-we-theme="dark"] .bg-white,
html[data-we-theme="dark"] .bg-light {
    background-color: var(--we-dark-surface) !important;
    color: var(--we-dark-text) !important;
}

/* Alerts: soften so dark text isn't on dark */
html[data-we-theme="dark"] .alert-info,
html[data-we-theme="dark"] .alert-success {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .alert-warning {
    background-color: rgba(234, 179, 8, 0.14) !important;
    border-color: rgba(234, 179, 8, 0.30) !important;
    color: #fde68a !important;
}

/* Footer bar (fixed-bottom copyright strip) */
html[data-we-theme="dark"] .footer {
    background-color: rgba(13, 20, 34, 0.92) !important;
    border-top: 1px solid var(--we-dark-border);
    -webkit-backdrop-filter: blur(var(--we-glass-blur));
    backdrop-filter: blur(var(--we-glass-blur));
}
html[data-we-theme="dark"] .footer,
html[data-we-theme="dark"] .footer-text,
html[data-we-theme="dark"] .footer a {
    color: var(--we-dark-muted) !important;
}

/* Breadcrumb / page header links stay legible */
html[data-we-theme="dark"] .breadcrumb {
    background-color: transparent;
}
html[data-we-theme="dark"] .breadcrumb-item.active,
html[data-we-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
    color: var(--we-dark-muted);
}

/* General Search panel labels inside dark cards */
html[data-we-theme="dark"] .gs-subtitle,
html[data-we-theme="dark"] .gs-mark,
html[data-we-theme="dark"] .gs-date-label {
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .gs-tracking,
html[data-we-theme="dark"] .gs-date-val {
    color: var(--we-dark-text) !important;
}

/* Logo: many brand logos are dark-on-transparent and lose contrast on a dark
   bar. Give the navbar logos a subtle light chip so they stay legible. */
html[data-we-theme="dark"] .navbar-brand img.logo,
html[data-we-theme="dark"] .navbar-brand > img,
html[data-we-theme="dark"] .navbar-other .d-lg-none img {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 8px;
    padding: 4px 8px;
}

/* Page loader card (defined in footer) should be dark too */
html[data-we-theme="dark"] #we-loader-card {
    background: #131c2e !important;
}
html[data-we-theme="dark"] #we-loader-label {
    color: var(--we-dark-text) !important;
}

/* =====================================================================
   2b. DARK MODE â€” custom pages (cargo / warehouse / dashboards)
   ---------------------------------------------------------------------
   Many bespoke pages hardcode light surfaces â€” either as inline
   style="background:#fff" / rgba(0,0,0,0.02) panels, via Bootstrap
   light utilities (.btn-light, .badge-light, .thead-light), or through
   per-page .cm-* component classes. None of those go through the
   Bootstrap classes section 2 recolors, so they stay near-white on the
   dark canvas. The rules below recolor them generically.
   ===================================================================== */

/* --- Bootstrap light utilities used across the app --- */
html[data-we-theme="dark"] .btn-light {
    background-color: var(--we-dark-surface) !important;
    border-color: var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .btn-light:hover,
html[data-we-theme="dark"] .btn-light:focus,
html[data-we-theme="dark"] .btn-light:active {
    background-color: rgba(255, 255, 255, 0.10) !important;
    color: #fff !important;
}
html[data-we-theme="dark"] .badge-light {
    background-color: rgba(255, 255, 255, 0.10) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .thead-light th,
html[data-we-theme="dark"] thead.thead-light th,
html[data-we-theme="dark"] .table-light,
html[data-we-theme="dark"] .table-light > td,
html[data-we-theme="dark"] .table-light > th {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: var(--we-dark-text) !important;
    border-color: var(--we-dark-border) !important;
}
html[data-we-theme="dark"] .btn-outline-secondary {
    color: var(--we-dark-text) !important;
    border-color: var(--we-dark-border) !important;
}
html[data-we-theme="dark"] .btn-outline-secondary:hover,
html[data-we-theme="dark"] .btn-outline-secondary:focus {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
}

/* --- Inline light backgrounds (style="...") â€” !important beats inline ---
   Substring selectors target the exact `background:` declarations so we
   don't accidentally recolor borders/box-shadows that share the rgba.   */
html[data-we-theme="dark"] [style*="background:#fff"],
html[data-we-theme="dark"] [style*="background: #fff"],
html[data-we-theme="dark"] [style*="background:#ffffff"],
html[data-we-theme="dark"] [style*="background: #ffffff"],
html[data-we-theme="dark"] [style*="background:white"],
html[data-we-theme="dark"] [style*="background: white"],
html[data-we-theme="dark"] [style*="background:#f8f9fa"],
html[data-we-theme="dark"] [style*="background: #f8f9fa"],
html[data-we-theme="dark"] [style*="background:#f5f5f5"],
html[data-we-theme="dark"] [style*="background: #f5f5f5"],
html[data-we-theme="dark"] [style*="background:#fafbfc"],
html[data-we-theme="dark"] [style*="background: #fafbfc"],
html[data-we-theme="dark"] [style*="background:#fafbfd"],
html[data-we-theme="dark"] [style*="background: #fafbfd"],
html[data-we-theme="dark"] [style*="background:#e9ecef"],
html[data-we-theme="dark"] [style*="background: #e9ecef"],
html[data-we-theme="dark"] [style*="background:#dee2e6"],
html[data-we-theme="dark"] [style*="background: #dee2e6"],
/* `#f3f4f6` (Tailwind gray-100) used inline on the Goods Received
   Bulk SMS modal body wrapper. `#f1f3f5` is another common variant. */
html[data-we-theme="dark"] [style*="background:#f3f4f6"],
html[data-we-theme="dark"] [style*="background: #f3f4f6"],
html[data-we-theme="dark"] [style*="background:#f1f3f5"],
html[data-we-theme="dark"] [style*="background: #f1f3f5"],
/* `rgba(248,249,250,â€¦)` â€” Bootstrap gray-100, used inline on the SMS
   Management "Quick View" card with .7 alpha. Add all common spacing
   variants since substring matching is exact. */
html[data-we-theme="dark"] [style*="background:rgba(248,249,250"],
html[data-we-theme="dark"] [style*="background: rgba(248,249,250"],
html[data-we-theme="dark"] [style*="background: rgba(248, 249, 250"],
/* `rgba(241,243,245â€¦)` / `rgba(243,244,246â€¦)` â€” common Tailwind / cool-grey
   panel tints */
html[data-we-theme="dark"] [style*="background:rgba(241,243,245"],
html[data-we-theme="dark"] [style*="background: rgba(241, 243, 245"],
html[data-we-theme="dark"] [style*="background:rgba(243,244,246"],
html[data-we-theme="dark"] [style*="background: rgba(243, 244, 246"],
/* `rgba(0,0,0,0.02 / 0.04)` light overlays */
html[data-we-theme="dark"] [style*="background: rgba(0,0,0,0.02)"],
html[data-we-theme="dark"] [style*="background: rgba(0, 0, 0, 0.02)"],
html[data-we-theme="dark"] [style*="background:rgba(0,0,0,0.02)"],
html[data-we-theme="dark"] [style*="background: rgba(0,0,0,0.04)"],
html[data-we-theme="dark"] [style*="background: rgba(0, 0, 0, 0.04)"],
html[data-we-theme="dark"] [style*="background:rgba(0,0,0,0.04)"] {
    background-color: var(--we-dark-surface) !important;
    color: var(--we-dark-text);
}
/* Thin 1px separators (height:1px; background: rgba(0,0,0,0.06/0.08)) read
   as a faint light hairline instead of a dark block. */
html[data-we-theme="dark"] [style*="background: rgba(0,0,0,0.06)"],
html[data-we-theme="dark"] [style*="background: rgba(0, 0, 0, 0.06)"],
html[data-we-theme="dark"] [style*="background:rgba(0,0,0,0.06)"],
html[data-we-theme="dark"] [style*="background: rgba(0,0,0,0.08)"],
html[data-we-theme="dark"] [style*="background:rgba(0,0,0,0.08)"] {
    background-color: var(--we-dark-border) !important;
}

/* =====================================================================
   Inline near-black text colours
   ---------------------------------------------------------------------
   Lots of legacy admin pages hardcode `style="color:#000"` /
   `color:#0f172a` / `color: rgba(0,0,0,â€¦)` on labels, titles and table
   cells. In dark mode those land on the dark canvas and read as
   invisible. Catch the common variants and retint them to the dark
   text palette. Substring selectors target the `color:` declaration
   exactly so we don't touch other rgba uses (border-color, fill, etc.).
   ===================================================================== */
html[data-we-theme="dark"] [style*="color:#000"],
html[data-we-theme="dark"] [style*="color: #000"],
html[data-we-theme="dark"] [style*="color:#0f172a"],
html[data-we-theme="dark"] [style*="color: #0f172a"],
html[data-we-theme="dark"] [style*="color:#111827"],
html[data-we-theme="dark"] [style*="color: #111827"],
html[data-we-theme="dark"] [style*="color:#1f2937"],
html[data-we-theme="dark"] [style*="color: #1f2937"],
html[data-we-theme="dark"] [style*="color:#212529"],
html[data-we-theme="dark"] [style*="color: #212529"],
html[data-we-theme="dark"] [style*="color:black"],
html[data-we-theme="dark"] [style*="color: black"],
html[data-we-theme="dark"] [style*="color: rgba(0,0,0"],
html[data-we-theme="dark"] [style*="color: rgba(0, 0, 0"],
html[data-we-theme="dark"] [style*="color:rgba(0,0,0"],
html[data-we-theme="dark"] [style*="color: rgb(0,0,0)"],
html[data-we-theme="dark"] [style*="color: rgb(0, 0, 0)"],
html[data-we-theme="dark"] [style*="color:rgb(0,0,0)"],
html[data-we-theme="dark"] [style*="color: rgba(15,23,42"],
html[data-we-theme="dark"] [style*="color: rgba(15, 23, 42"],
html[data-we-theme="dark"] [style*="color:rgba(15,23,42"] {
    color: var(--we-dark-text) !important;
}

/* =====================================================================
   Browser autofill (Chrome / Edge / Safari)
   ---------------------------------------------------------------------
   When the user types or the browser auto-fills an input, Chrome paints
   a hardcoded light-yellow / lavender background + near-black text via
   `:-webkit-autofill`. Plain `background-color` overrides DON'T work â€”
   the spec forces it. The canonical workaround is to spray the inside
   of the input with a huge inset box-shadow and to set
   `-webkit-text-fill-color` (which DOES override autofill text).
   `transition` delay defangs the brief yellow flash on focus change.
   This is the immediate cause of the cream-input + black-text the user
   screenshotted on the "Supplier Tracking No." field.
   ===================================================================== */
html[data-we-theme="dark"] input:-webkit-autofill,
html[data-we-theme="dark"] input:-webkit-autofill:hover,
html[data-we-theme="dark"] input:-webkit-autofill:focus,
html[data-we-theme="dark"] input:-webkit-autofill:active,
html[data-we-theme="dark"] textarea:-webkit-autofill,
html[data-we-theme="dark"] textarea:-webkit-autofill:hover,
html[data-we-theme="dark"] textarea:-webkit-autofill:focus,
html[data-we-theme="dark"] select:-webkit-autofill,
html[data-we-theme="dark"] select:-webkit-autofill:hover,
html[data-we-theme="dark"] select:-webkit-autofill:focus {
    /* 1000px inset shadow simulates the input background */
    -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.04) inset !important;
            box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.04) inset !important;
    -webkit-text-fill-color: var(--we-dark-text) !important;
            color: var(--we-dark-text) !important;
    caret-color: var(--we-dark-text);
    border-color: var(--we-dark-border) !important;
    /* Defer the yellow flash effectively forever */
    transition: background-color 9999s ease-out 0s,
                color           9999s ease-out 0s;
}

/* --- Cargo .cm-* components (container-manifest sea/air pages) --- */
html[data-we-theme="dark"] .cm-actions-menu,
html[data-we-theme="dark"] .cm-row-actions-menu,
html[data-we-theme="dark"] .cm-action-item,
html[data-we-theme="dark"] .cm-claim-dropzone,
html[data-we-theme="dark"] .cm-dropzone,
html[data-we-theme="dark"] .cm-msg-card,
html[data-we-theme="dark"] .cm-msg-recipients,
html[data-we-theme="dark"] .cm-msg-tab,
html[data-we-theme="dark"] .cm-msg-template-plus,
html[data-we-theme="dark"] .cm-msg-template,
html[data-we-theme="dark"] .cm-view-toggle,
html[data-we-theme="dark"] .cm-scroll-btn {
    background-color: var(--we-dark-surface) !important;
    border-color: var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
/* Subtle tinted surfaces within the cargo UI */
html[data-we-theme="dark"] .cm-msg-icon,
html[data-we-theme="dark"] .cm-msg-spark,
html[data-we-theme="dark"] .cm-msg-footer,
html[data-we-theme="dark"] .cm-msg-dashed,
html[data-we-theme="dark"] .cm-msg-template-tile,
html[data-we-theme="dark"] .cm-msg-recipient,
html[data-we-theme="dark"] .cm-view-btn {
    background-color: rgba(255, 255, 255, 0.04) !important;
    border-color: var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
/* Hover / active states */
html[data-we-theme="dark"] .cm-action-item:hover,
html[data-we-theme="dark"] .cm-action-item:focus,
html[data-we-theme="dark"] .cm-action-item:active,
html[data-we-theme="dark"] .cm-row-action-item:hover,
html[data-we-theme="dark"] .cm-row-action-item:focus,
html[data-we-theme="dark"] .cm-msg-recipient:hover,
html[data-we-theme="dark"] .cm-view-btn:hover,
html[data-we-theme="dark"] .cm-view-btn.is-active,
html[data-we-theme="dark"] .cm-dropzone.is-dragover {
    background-color: rgba(255, 255, 255, 0.10) !important;
    color: #fff !important;
}
html[data-we-theme="dark"] .cm-msg-tab.is-active {
    border-color: var(--we-accent, #00a8e8) !important;
    color: #fff !important;
}
html[data-we-theme="dark"] .cm-dropzone-icon,
html[data-we-theme="dark"] .cm-location-icon {
    color: var(--we-dark-muted) !important;
}

/* =====================================================================
   2c. DARK MODE â€” mobile offcanvas sidebar (#offcanvasDarkNavbar)
   ---------------------------------------------------------------------
   On screens <= 991.98px the sidebar is a Bootstrap offcanvas panel.
   header.blade.php styles it with hardcoded LIGHT colors using ID-level
   specificity (#offcanvasDarkNavbar ...) + !important, so the generic
   dark-mode rules in section 2 lose the cascade and the panel renders
   near-transparent over the dark body (it reads as "invisible").
   These overrides re-assert dark styling at matching/higher specificity
   (id + [data-we-theme] attribute) and only inside the same breakpoint,
   so desktop is untouched. The same id is reused by the merchant panel,
   so this fixes both sidebars.
   ===================================================================== */
@media (max-width: 991.98px) {
    /* Panel + header surfaces */
    html[data-we-theme="dark"] #offcanvasDarkNavbar.offcanvas {
        background-color: var(--we-dark-surface) !important;
    }
    html[data-we-theme="dark"] #offcanvasDarkNavbar .offcanvas-header {
        background-color: rgba(13, 20, 34, 0.92) !important;
        border-bottom-color: var(--we-dark-border) !important;
    }
    html[data-we-theme="dark"] #offcanvasDarkNavbar .we-sidebar-profile {
        background-color: rgba(255, 255, 255, 0.04) !important;
        color: var(--we-dark-text) !important;
    }

    /* Nav links: light text on a subtle dark pill */
    html[data-we-theme="dark"] #offcanvasDarkNavbar .sidebar-dark.nav-left-sidebar .navbar-nav .nav-link {
        color: var(--we-dark-text) !important;
        background-color: rgba(255, 255, 255, 0.04) !important;
    }
    html[data-we-theme="dark"] #offcanvasDarkNavbar .sidebar-dark.nav-left-sidebar .navbar-nav .nav-link i {
        color: var(--we-accent, #00a8e8) !important;
    }
    html[data-we-theme="dark"] #offcanvasDarkNavbar .sidebar-dark.nav-left-sidebar .navbar-nav .nav-link.active,
    html[data-we-theme="dark"] #offcanvasDarkNavbar .sidebar-dark.nav-left-sidebar .navbar-nav .nav-link[aria-expanded="true"] {
        background-color: rgba(255, 255, 255, 0.12) !important;
        color: #fff !important;
    }
    html[data-we-theme="dark"] #offcanvasDarkNavbar .sidebar-dark.nav-left-sidebar .navbar-nav .nav-link.active i,
    html[data-we-theme="dark"] #offcanvasDarkNavbar .sidebar-dark.nav-left-sidebar .navbar-nav .nav-link[aria-expanded="true"] i {
        color: #fff !important;
    }
}

/* Hamburger / offcanvas toggler icon: the default Bootstrap navbar-light
   icon is a dark SVG and disappears on the darkened topbar. Invert it. */
html[data-we-theme="dark"] .offcanvas-nav-btn .navbar-toggler-icon,
html[data-we-theme="dark"] .navbar-toggler .navbar-toggler-icon {
    filter: invert(1) brightness(2);
}

/* =====================================================================
   3. THEME TOGGLE â€” floating pill button (bottom-right)
   ===================================================================== */

#we-theme-toggle {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 99998;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 46px;
    padding: 0 16px 0 14px;
    border: 1px solid var(--we-glass-border);
    border-radius: 999px;
    background: var(--we-glass-bg);
    -webkit-backdrop-filter: blur(var(--we-glass-blur));
    backdrop-filter: blur(var(--we-glass-blur));
    box-shadow: var(--we-glass-shadow);
    color: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .2px;
    cursor: pointer;
    user-select: none;
    transition: transform .18s ease, box-shadow .18s ease, background .25s ease;
}
#we-theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}
#we-theme-toggle:active {
    transform: translateY(0);
}
#we-theme-toggle .we-theme-icon {
    font-size: 16px;
    line-height: 1;
}
html[data-we-theme="dark"] #we-theme-toggle {
    color: var(--we-dark-text);
}

@media (max-width: 575.98px) {
    #we-theme-toggle {
        right: 12px;
        bottom: 12px;
        height: 42px;
        padding: 0 12px;
    }
    #we-theme-toggle .we-theme-label {
        display: none; /* icon-only on small screens to save space */
    }
}

@media (prefers-reduced-motion: reduce) {
    html[data-we-theme] body,
    html[data-we-theme] .card,
    html[data-we-theme] .modal-content,
    html[data-we-theme] .nav-left-sidebar,
    html[data-we-theme] .dropdown-menu,
    #we-theme-toggle {
        transition: none;
    }
}


/* =====================================================================
   Support / Ticket index page â€” dark mode
   ---------------------------------------------------------------------
   `support/index.blade.php` ships its own page-scoped <style> block
   that:
   - sets `:root { --surface: #fbfdff }` and `.dashboard-content
     { background-color: var(--surface) }`  â†’ light cream wrapper
   - paints `.card { background-color: #ffffff }`
   - paints `.form-control { background-color: #fff; color: #0f172a }`
   - sets `.nav-tabs#supportStatusTabs .nav-link` border to
     `rgba(15,23,42,0.06)` â†’ invisible on dark

   `.dashboard-content` is already retinted by the base-canvas rule
   above. The rest of the page-scoped rules need overrides â€” scoped by
   `#supportStatusTabs` (unique to this page) or the `.support-table` /
   `.support-tabs-wrap` selectors so we don't touch other pages.
   ===================================================================== */

/* The outer card on the ticket page: let it inherit the canvas so we
   don't paint a card-inside-card box. */
html[data-we-theme="dark"] .dashboard-content > .card.shadow-sm,
html[data-we-theme="dark"] .dashboard-content > .card.shadow-sm > .card-body {
    background-color: transparent !important;
    border-color: var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
    box-shadow: none !important;
}

/* "Ticket" heading at the top */
html[data-we-theme="dark"] .dashboard-content > .card.shadow-sm h3 {
    color: var(--we-dark-text) !important;
}

/* Search form inputs (Supplier Tracking Number / Shipping Mark).
   Page rule sets light bg + dark text; flip it. */
html[data-we-theme="dark"] .dashboard-content .form-control {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: var(--we-dark-text) !important;
    border-color: var(--we-dark-border) !important;
}
html[data-we-theme="dark"] .dashboard-content .form-control::placeholder {
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .dashboard-content .form-control:focus {
    background-color: rgba(255, 255, 255, 0.09) !important;
    border-color: var(--we-accent, #00a8e8) !important;
    box-shadow: 0 0 0 0.15rem rgba(0, 168, 232, 0.18) !important;
}

/* Status filter tabs: bordered pills. Page sets a near-invisible border
   on the non-active state â€” give it a clear outlined chip on dark. */
html[data-we-theme="dark"] .nav-tabs#supportStatusTabs .nav-link {
    background-color: rgba(255, 255, 255, 0.04) !important;
    color: var(--we-dark-muted) !important;
    border: 1px solid var(--we-dark-border) !important;
}
html[data-we-theme="dark"] .nav-tabs#supportStatusTabs .nav-link:not(.active):hover,
html[data-we-theme="dark"] .nav-tabs#supportStatusTabs .nav-link:not(.active):focus {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: var(--we-dark-text) !important;
    border-color: var(--we-dark-border) !important;
}
html[data-we-theme="dark"] .nav-tabs#supportStatusTabs .nav-link.active {
    background-color: var(--we-accent, #00a8e8) !important;
    color: #fff !important;
    border-color: var(--we-accent, #00a8e8) !important;
    box-shadow: 0 4px 10px rgba(0, 168, 232, 0.20) !important;
}

/* Support table â€” table header already uses a dark surface, so we
   really just need to make sure the body rows + row separators read
   properly on the dark canvas. */
html[data-we-theme="dark"] .support-table tbody tr {
    background-color: transparent !important;
}
html[data-we-theme="dark"] .support-table tbody td {
    color: var(--we-dark-text) !important;
    border-bottom-color: var(--we-dark-border) !important;
}
html[data-we-theme="dark"] .support-table tbody td .text-muted,
html[data-we-theme="dark"] .support-table tbody td small {
    color: var(--we-dark-muted) !important;
}
/* Dropdown trigger (three-dot / sky-blue square) stays brand-accent,
   but make sure dropdown menus that fly out of it are themed. */
html[data-we-theme="dark"] .support-table .dropdown-menu {
    background-color: var(--we-dark-surface) !important;
    border-color: var(--we-dark-border) !important;
}
html[data-we-theme="dark"] .support-table .dropdown-menu .dropdown-item {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .support-table .dropdown-menu .dropdown-item:hover,
html[data-we-theme="dark"] .support-table .dropdown-menu .dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
}

/* `.btn-light` Reset button at the end of the search form */
html[data-we-theme="dark"] .dashboard-content form .btn-light {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border-color: var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .dashboard-content form .btn-light:hover,
html[data-we-theme="dark"] .dashboard-content form .btn-light:focus {
    background-color: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
}

/* The status pills (.status-pill.pending/.processing/.resolved/.closed)
   ship as solid app colours with white text â€” they already read fine
   on the dark canvas, so no changes are needed. */

/* =====================================================================
   Client profile / merchant view (`.cp-*` classes) â€” dark mode
   ---------------------------------------------------------------------
   `backend/merchant/merchant-details.blade.php` ships its own scoped
   style block with a complete set of `.cp-*` rules â€” all designed for
   light mode. Every surface is hardcoded white / light cream, every
   text colour hardcoded near-black, and there are no dark-mode
   overrides. In dark mode the right pane therefore reads as a big
   light cream wrapper (cp-content-col bg #fff), with white card chips
   (cp-card / cp-tile bg #fff) containing dark text that's invisible
   on its own background and unreadable when our generic dark-mode
   recolors push the surrounding canvas to dark.

   Fix scope: anything inside `.cp-page-card` (unique to this view).
   We override surfaces to dark, text to light, accents kept where
   appropriate (the brand-blue sidebar active state, the icon chip
   tints used on the metric tiles).
   ===================================================================== */

/* Outer card + the page-body split */
html[data-we-theme="dark"] .cp-page-card {
    background-color: transparent !important;
    border-color: var(--we-dark-border) !important;
    box-shadow: none !important;
}
html[data-we-theme="dark"] .cp-page-card .cp-page-body {
    background-color: transparent !important;
}

/* Left column (Company info / Goods Received / Container Manifest /
   Destination Warehouse) â€” the sidebar already reads as dark in your
   screenshot, just keep the surface explicit and the border-right
   themed. */
html[data-we-theme="dark"] .cp-sidebar-col {
    background-color: rgba(255, 255, 255, 0.02) !important;
    border-right-color: var(--we-dark-border) !important;
}
/* Sidebar `.list-group-item` non-active state: page paints them light
   muted on transparent; force light text on dark hover background. */
html[data-we-theme="dark"] .cp-sidebar-nav .merchant-view .list-group-item {
    color: var(--we-dark-muted) !important;
    background-color: transparent !important;
}
html[data-we-theme="dark"] .cp-sidebar-nav .merchant-view .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .cp-sidebar-nav .merchant-view .list-group-item.active {
    /* Keep the brand-blue pill the page already uses */
    background-color: #0284c7 !important;
    color: #fff !important;
    box-shadow: 0 6px 14px rgba(2, 132, 199, 0.28);
}
html[data-we-theme="dark"] .cp-sidebar-nav .merchant-view .list-group-item.font-weight-bold {
    color: #38bdf8 !important;  /* sky-400 â€” readable on dark sub-item */
}

/* Right column (the main content area â€” was the cream wrapper in the
   screenshot). */
html[data-we-theme="dark"] .cp-content-col {
    background-color: transparent !important;
}

/* Identity header (PRINCE GYAN) */
html[data-we-theme="dark"] .cp-name {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .cp-mark {
    background-color: rgba(2, 132, 199, 0.18) !important;
    color: #38bdf8 !important;
}
html[data-we-theme="dark"] .cp-contact {
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .cp-contact i {
    color: #38bdf8 !important;
}
html[data-we-theme="dark"] .cp-avatar {
    border-color: var(--we-dark-surface) !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18) !important;
}

/* Section titles ("PACKAGES", "FINANCIALS", "SEND SMS",
   "RECENT GOODS RECEIVED", "RECENT PICKUP REQUESTS",
   "CLIENT INFORMATION"). Page sets them near-black. */
html[data-we-theme="dark"] .cp-section-title {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .cp-section-title::before {
    background-color: var(--we-accent, #00a8e8) !important;
}

/* Metric tiles (PACKAGES grid + FINANCIALS grid) â€” page paints them
   solid #fff with dark text. Give them a lifted dark surface so they
   stand out from the canvas, and brighten the value. */
html[data-we-theme="dark"] .cp-tile {
    background-color: var(--we-dark-surface) !important;
    border-color: var(--we-dark-border) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.30) !important;
}
html[data-we-theme="dark"] .cp-tile:hover {
    border-color: rgba(0, 168, 232, 0.35) !important;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45) !important;
}
html[data-we-theme="dark"] .cp-tile-label,
html[data-we-theme="dark"] .cp-tile-sub {
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .cp-tile-value {
    color: var(--we-dark-text) !important;
}
/* The .cp-i-* icon chip backgrounds (green/blue/orange/red/teal/purple)
   already use a tinted-coloured background â€” they read fine on dark,
   so no change needed. */

/* Client Information detail grid (FIRST NAME / LAST NAME / EMAIL /
   PHONE / ADDRESS / STATUS) */
html[data-we-theme="dark"] .cp-detail-label {
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .cp-detail-value {
    color: var(--we-dark-text) !important;
}

/* Tables (RECENT GOODS RECEIVED / RECENT PICKUP REQUESTS) â€” page
   forces `background:#f8fafc !important; color: var(--cp-muted) !important`
   on the thead. Override. */
html[data-we-theme="dark"] .cp-table thead th {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: var(--we-dark-muted) !important;
    border-bottom-color: var(--we-dark-border) !important;
}
html[data-we-theme="dark"] .cp-table tbody td {
    color: var(--we-dark-text) !important;
    border-top-color: var(--we-dark-border) !important;
    background-color: transparent !important;
}
html[data-we-theme="dark"] .cp-table tbody tr:hover td {
    background-color: rgba(255, 255, 255, 0.04) !important;
}
html[data-we-theme="dark"] .cp-table.table-bordered,
html[data-we-theme="dark"] .cp-table.table-bordered td,
html[data-we-theme="dark"] .cp-table.table-bordered th {
    border-color: var(--we-dark-border) !important;
}

/* Generic `.cp-card` wrapper (Send SMS / recent activity panels) */
html[data-we-theme="dark"] .cp-card {
    background-color: var(--we-dark-surface) !important;
    border-color: var(--we-dark-border) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.30) !important;
    color: var(--we-dark-text) !important;
}

/* SMS textarea + placeholder code chips */
html[data-we-theme="dark"] .cp-sms-textarea {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: var(--we-dark-text) !important;
    border-color: var(--we-dark-border) !important;
}
html[data-we-theme="dark"] .cp-sms-textarea::placeholder {
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .cp-sms-textarea:focus {
    border-color: var(--we-accent, #00a8e8) !important;
    box-shadow: 0 0 0 .15rem rgba(0, 168, 232, 0.18) !important;
}
html[data-we-theme="dark"] .cp-code {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #f472b6 !important;  /* pink-400, readable on dark */
}

/* =====================================================================
   ApexCharts (SVG-based charts) â€” dark mode
   ---------------------------------------------------------------------
   ApexCharts renders to SVG, so axis labels / legends / tooltips /
   titles use the SVG `fill` attribute, NOT CSS `color`. Our generic
   `html[data-we-theme="dark"] span/text/h*  { color: â€¦  }` rules don't
   reach them, which is why month names, axis numbers, the "GHC" axis
   title, and the "Selected Range" / "Remaining" legend on the expense
   page render as near-black on the dark canvas in the user's
   screenshot.

   Fix: override `fill` (and `stroke` for the grid lines) on every
   ApexCharts text/grid class in dark mode. No JS / chart config
   changes needed â€” purely a CSS overlay.
   ===================================================================== */

/* All axis + datalabel text */
html[data-we-theme="dark"] .apexcharts-text,
html[data-we-theme="dark"] .apexcharts-text tspan,
html[data-we-theme="dark"] .apexcharts-xaxis-label,
html[data-we-theme="dark"] .apexcharts-yaxis-label,
html[data-we-theme="dark"] .apexcharts-xaxis-title-text,
html[data-we-theme="dark"] .apexcharts-yaxis-title-text,
html[data-we-theme="dark"] .apexcharts-xaxistooltip-text,
html[data-we-theme="dark"] .apexcharts-yaxistooltip-text,
html[data-we-theme="dark"] .apexcharts-datalabel,
html[data-we-theme="dark"] .apexcharts-datalabel-label,
html[data-we-theme="dark"] .apexcharts-datalabel-value,
html[data-we-theme="dark"] .apexcharts-pie-label,
html[data-we-theme="dark"] .apexcharts-pie-series text,
html[data-we-theme="dark"] .apexcharts-title-text,
html[data-we-theme="dark"] .apexcharts-subtitle-text {
    fill: var(--we-dark-text) !important;
}
/* Slightly muted: axis tick labels look better when they're a notch
   lower in contrast than the value text. */
html[data-we-theme="dark"] .apexcharts-xaxis text,
html[data-we-theme="dark"] .apexcharts-yaxis text {
    fill: var(--we-dark-muted) !important;
}
/* Axis title (e.g. "GHC") stays prominent */
html[data-we-theme="dark"] .apexcharts-xaxis-title text,
html[data-we-theme="dark"] .apexcharts-yaxis-title text {
    fill: var(--we-dark-text) !important;
}

/* Grid lines + axis tick lines: light tint instead of near-black */
html[data-we-theme="dark"] .apexcharts-gridline,
html[data-we-theme="dark"] .apexcharts-grid line,
html[data-we-theme="dark"] .apexcharts-grid-borders line,
html[data-we-theme="dark"] .apexcharts-xaxis line,
html[data-we-theme="dark"] .apexcharts-yaxis line {
    stroke: var(--we-dark-border) !important;
}

/* Legend (Selected Range / Remaining) */
html[data-we-theme="dark"] .apexcharts-legend-text {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .apexcharts-legend-series .apexcharts-legend-marker {
    /* Series colour is set by JS via fill; only restyle outline if needed */
    border-color: var(--we-dark-border) !important;
}

/* Tooltip â€” convert the white panel to a dark surface */
html[data-we-theme="dark"] .apexcharts-tooltip {
    background-color: var(--we-dark-surface) !important;
    border-color: var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
html[data-we-theme="dark"] .apexcharts-tooltip.apexcharts-theme-light,
html[data-we-theme="dark"] .apexcharts-tooltip.apexcharts-theme-dark {
    background-color: var(--we-dark-surface) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .apexcharts-tooltip-title {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-bottom-color: var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .apexcharts-tooltip-text,
html[data-we-theme="dark"] .apexcharts-tooltip-text-y-label,
html[data-we-theme="dark"] .apexcharts-tooltip-text-y-value,
html[data-we-theme="dark"] .apexcharts-tooltip-text-z-label,
html[data-we-theme="dark"] .apexcharts-tooltip-text-z-value {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .apexcharts-xaxistooltip,
html[data-we-theme="dark"] .apexcharts-yaxistooltip {
    background-color: var(--we-dark-surface) !important;
    border-color: var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .apexcharts-xaxistooltip::after,
html[data-we-theme="dark"] .apexcharts-yaxistooltip::after {
    border-bottom-color: var(--we-dark-surface) !important;
    border-top-color: var(--we-dark-surface) !important;
}

/* Selection / zoom rect */
html[data-we-theme="dark"] .apexcharts-selection-rect {
    fill: rgba(0, 168, 232, 0.15) !important;
    stroke: var(--we-accent, #00a8e8) !important;
}

/* =====================================================================
   Native <select> dropdown <option> elements â€” dark mode
   ---------------------------------------------------------------------
   A native `<select>` is themed by our form-control dark rules: light
   text on a dark tinted background. But the dropdown POPUP that
   appears when the user clicks the select is rendered by the
   browser/OS, not the page CSS, and defaults to a WHITE background.
   The `<option>` elements inherit the select's light text colour, so
   on the white popup the options read as near-invisible (exactly what
   the user screenshotted on "Commission paid to delivery man" /
   "Others" / "trail").

   Setting `background-color` + `color` on `<option>` itself is
   honoured by Chrome / Edge / Firefox on Windows + Linux. Safari /
   macOS ignores it (OS-native dropdown) â€” acceptable trade-off; the
   admin runs primarily on Chromium-based browsers.

   We DON'T scope this under `.form-control` because some selects on
   the admin omit that class â€” covering all `select option` is safe
   because the rule only matters when the dropdown is open.
   ===================================================================== */
html[data-we-theme="dark"] select option,
html[data-we-theme="dark"] select optgroup {
    background-color: var(--we-dark-surface) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] select option:checked,
html[data-we-theme="dark"] select option:hover {
    background-color: var(--we-accent, #00a8e8) !important;
    color: #fff !important;
}
/* Disabled / placeholder option (first <option value="">Select â€¦</option>) */
html[data-we-theme="dark"] select option:disabled {
    color: var(--we-dark-muted) !important;
}

/* Also re-affirm the closed select itself so the chosen value reads
   light on dark even when the form-control rules from a page-scoped
   stylesheet would otherwise win the cascade. */
html[data-we-theme="dark"] select.form-control,
html[data-we-theme="dark"] select.custom-select,
html[data-we-theme="dark"] .form-group select {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: var(--we-dark-text) !important;
    border-color: var(--we-dark-border) !important;
}

/* =====================================================================
   Native date / datetime / time input pickers â€” dark mode
   ---------------------------------------------------------------------
   `<input type="date|datetime-local|time|month|week">` renders a small
   calendar / clock SVG icon at the right edge via the WebKit pseudo
   `::-webkit-calendar-picker-indicator`. The icon is a solid black
   glyph by default, so on the dark form-control background it reads
   as near-invisible (the icon was almost gone in the user's
   screenshot â€” only a faint outline visible).

   Inverting the indicator flips it to white. We also brighten the
   indicator on hover and tint the placeholder digits + the AM/PM /
   field-separator spinners so the whole control reads as light-on-dark.

   Affects only the icon paint â€” interaction behaviour (opening the
   picker, etc.) is untouched.
   ===================================================================== */
html[data-we-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
html[data-we-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator,
html[data-we-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator,
html[data-we-theme="dark"] input[type="month"]::-webkit-calendar-picker-indicator,
html[data-we-theme="dark"] input[type="week"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.6);
    opacity: 0.9;
    cursor: pointer;
}
html[data-we-theme="dark"] input[type="date"]:hover::-webkit-calendar-picker-indicator,
html[data-we-theme="dark"] input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator,
html[data-we-theme="dark"] input[type="time"]:hover::-webkit-calendar-picker-indicator {
    opacity: 1;
}

/* The placeholder text ("mm/dd/yyyy --:-- --") and field separators
   inside the native input render via these pseudo-elements. Force the
   light-on-dark palette so they don't read as faded grey on our dark
   tinted background. */
html[data-we-theme="dark"] input[type="date"]::-webkit-datetime-edit,
html[data-we-theme="dark"] input[type="datetime-local"]::-webkit-datetime-edit,
html[data-we-theme="dark"] input[type="time"]::-webkit-datetime-edit {
    color: var(--we-dark-text);
}
html[data-we-theme="dark"] input[type="date"]::-webkit-datetime-edit-fields-wrapper,
html[data-we-theme="dark"] input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper,
html[data-we-theme="dark"] input[type="time"]::-webkit-datetime-edit-fields-wrapper {
    color: var(--we-dark-text);
}
html[data-we-theme="dark"] input[type="date"]::-webkit-datetime-edit-text,
html[data-we-theme="dark"] input[type="datetime-local"]::-webkit-datetime-edit-text,
html[data-we-theme="dark"] input[type="time"]::-webkit-datetime-edit-text {
    color: var(--we-dark-muted);
}
/* Per-field values (month, day, year, hour, minute, AM/PM) */
html[data-we-theme="dark"] input[type="date"]::-webkit-datetime-edit-month-field,
html[data-we-theme="dark"] input[type="date"]::-webkit-datetime-edit-day-field,
html[data-we-theme="dark"] input[type="date"]::-webkit-datetime-edit-year-field,
html[data-we-theme="dark"] input[type="datetime-local"]::-webkit-datetime-edit-month-field,
html[data-we-theme="dark"] input[type="datetime-local"]::-webkit-datetime-edit-day-field,
html[data-we-theme="dark"] input[type="datetime-local"]::-webkit-datetime-edit-year-field,
html[data-we-theme="dark"] input[type="datetime-local"]::-webkit-datetime-edit-hour-field,
html[data-we-theme="dark"] input[type="datetime-local"]::-webkit-datetime-edit-minute-field,
html[data-we-theme="dark"] input[type="datetime-local"]::-webkit-datetime-edit-ampm-field,
html[data-we-theme="dark"] input[type="time"]::-webkit-datetime-edit-hour-field,
html[data-we-theme="dark"] input[type="time"]::-webkit-datetime-edit-minute-field,
html[data-we-theme="dark"] input[type="time"]::-webkit-datetime-edit-ampm-field {
    color: var(--we-dark-text);
}
/* When a field is empty (showing "mm" / "dd" / "yyyy"), browser renders
   a placeholder grey â€” soften it to our muted token. */
html[data-we-theme="dark"] input[type="date"]::-webkit-datetime-edit-month-field:empty,
html[data-we-theme="dark"] input[type="date"]::-webkit-datetime-edit-day-field:empty,
html[data-we-theme="dark"] input[type="date"]::-webkit-datetime-edit-year-field:empty,
html[data-we-theme="dark"] input[type="datetime-local"]::-webkit-datetime-edit-month-field:empty,
html[data-we-theme="dark"] input[type="datetime-local"]::-webkit-datetime-edit-day-field:empty,
html[data-we-theme="dark"] input[type="datetime-local"]::-webkit-datetime-edit-year-field:empty,
html[data-we-theme="dark"] input[type="datetime-local"]::-webkit-datetime-edit-hour-field:empty,
html[data-we-theme="dark"] input[type="datetime-local"]::-webkit-datetime-edit-minute-field:empty,
html[data-we-theme="dark"] input[type="datetime-local"]::-webkit-datetime-edit-ampm-field:empty {
    color: var(--we-dark-muted);
}

/* =====================================================================
   Scrollbars â€” dark mode
   ---------------------------------------------------------------------
   Without an explicit theme, browsers paint scrollbars with the
   default OS palette: a light-grey track + arrows + thumb. On the
   dark canvas that reads as a bright cream/silver bar â€” exactly the
   light scrollbar the user screenshotted on the Settings page.

   Two scrollbar standards exist:
   1. WebKit / Chromium / Edge / Safari â€” `::-webkit-scrollbar` and
      friends. Lets us style the track, thumb, arrows.
   2. Firefox â€” `scrollbar-color: thumb track` + `scrollbar-width`.

   We do both, scoped to `html[data-we-theme="dark"]` so light mode
   keeps the native scrollbar look.

   Applied to `html`, `body`, AND any scrolling descendant (using `*`
   inside the dark theme) so internal scroll panes (sidebars, code
   blocks, table-responsive wrappers, etc.) also get the dark
   scrollbar â€” not just the page-level one.
   ===================================================================== */

/* --- Firefox --- */
html[data-we-theme="dark"],
html[data-we-theme="dark"] * {
    scrollbar-color: rgba(255, 255, 255, 0.22) var(--we-dark-bg, #0b1220);
    scrollbar-width: thin;
}

/* --- WebKit (Chrome / Edge / Safari) --- */
html[data-we-theme="dark"] ::-webkit-scrollbar {
    width: 12px;
    height: 12px;
    background-color: var(--we-dark-bg, #0b1220);
}
html[data-we-theme="dark"] ::-webkit-scrollbar-track,
html[data-we-theme="dark"] ::-webkit-scrollbar-track-piece {
    background-color: var(--we-dark-bg, #0b1220);
    border-radius: 0;
}
html[data-we-theme="dark"] ::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    /* The transparent border + background-clip creates a "padded" thumb,
       so the visible bar feels like it floats inside the track. */
    border: 2px solid var(--we-dark-bg, #0b1220);
    background-clip: padding-box;
}
html[data-we-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.30);
}
html[data-we-theme="dark"] ::-webkit-scrollbar-thumb:active {
    background-color: rgba(255, 255, 255, 0.42);
}
html[data-we-theme="dark"] ::-webkit-scrollbar-corner {
    background-color: var(--we-dark-bg, #0b1220);
}
/* Hide the directional arrow buttons (the up/down triangles at the
   ends of the bar) â€” most modern apps go button-less and it matches
   our cleaner look. */
html[data-we-theme="dark"] ::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

/* =====================================================================
   Warehouse Address modal (`.warehouse-*` design system) â€” dark mode
   ---------------------------------------------------------------------
   `backend/warehouse_address/index.blade.php` ships its own
   `.warehouse-*` styling system designed for light mode:
     .warehouse-type-card    â†’ linear-gradient(rgba(248,250,252,.96), #fff)
     .warehouse-client-panel â†’ linear-gradient(rgba(240,249,255,.95), â€¦)
     .warehouse-client-picker__input    â†’ background:#fff; color:#0f172a
     .warehouse-client-picker__dropdown â†’ background:#fff
     .warehouse-client-panel__title     â†’ color:#0f172a
     .warehouse-client-panel__text      â†’ color:#64748b
   None of it has a dark-mode counterpart, so the Shipment Type block
   renders as the bright cream slab in the user's screenshot with the
   "Shipment Type" / "Required" / "Sea Address" labels essentially
   invisible.

   Fix: scope a dark palette per `.warehouse-*` class. Brand-accent
   highlights are preserved where they're meaningful (the "Required"
   tag, the multi-client chips, the input focus ring).
   ===================================================================== */

/* Shipment Type card â€” was the cream slab in the screenshot */
html[data-we-theme="dark"] .warehouse-type-card {
    background: var(--we-dark-surface) !important;
    border: 1px solid var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .warehouse-type-card label {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .warehouse-type-card__tag {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .warehouse-inline-note,
html[data-we-theme="dark"] .warehouse-type-card .form-text.text-muted {
    color: var(--we-dark-muted) !important;
}

/* Assign-to-shipping-mark client panel */
html[data-we-theme="dark"] .warehouse-client-panel {
    background: rgba(14, 165, 233, 0.08) !important;
    border: 1px solid rgba(14, 165, 233, 0.30) !important;
    box-shadow: none !important;
}
html[data-we-theme="dark"] .warehouse-client-panel__title {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .warehouse-client-panel__text,
html[data-we-theme="dark"] .warehouse-client-panel .form-text {
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .warehouse-client-panel__badge {
    background-color: rgba(14, 165, 233, 0.18) !important;
    color: #7dd3fc !important;  /* sky-300 â€” visible on dark */
}

/* Selected-client chips */
html[data-we-theme="dark"] .warehouse-client-picker__chip {
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.20), rgba(14, 165, 233, 0.12)) !important;
    color: #bae6fd !important;  /* sky-200 */
    box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.35) !important;
}
html[data-we-theme="dark"] .warehouse-client-picker__chip button {
    color: #bae6fd !important;
}

/* Search input */
html[data-we-theme="dark"] .warehouse-client-picker__input {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: var(--we-dark-text) !important;
    border-color: var(--we-dark-border) !important;
}
html[data-we-theme="dark"] .warehouse-client-picker__input::placeholder {
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .warehouse-client-picker__input:focus {
    border-color: rgba(14, 165, 233, 0.55) !important;
    box-shadow: 0 0 0 0.18rem rgba(14, 165, 233, 0.18) !important;
}
html[data-we-theme="dark"] .warehouse-client-picker__search-icon {
    color: #38bdf8 !important;
}

/* Dropdown panel + options */
html[data-we-theme="dark"] .warehouse-client-picker__dropdown {
    background-color: var(--we-dark-surface) !important;
    border-color: var(--we-dark-border) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55) !important;
}
html[data-we-theme="dark"] .warehouse-client-picker__option {
    background-color: transparent !important;
    color: var(--we-dark-text) !important;
    border-bottom-color: var(--we-dark-border) !important;
}
html[data-we-theme="dark"] .warehouse-client-picker__option:hover,
html[data-we-theme="dark"] .warehouse-client-picker__option.is-active {
    background-color: rgba(14, 165, 233, 0.14) !important;
    color: #fff !important;
}
html[data-we-theme="dark"] .warehouse-client-picker__option.is-selected {
    background-color: rgba(14, 165, 233, 0.18) !important;
    color: #7dd3fc !important;
}
html[data-we-theme="dark"] .warehouse-client-picker__option-check {
    color: #38bdf8 !important;
}
html[data-we-theme="dark"] .warehouse-client-picker__empty {
    color: var(--we-dark-muted) !important;
}

/* `.warehouse-modal` modal-content (in case the parent modal rule
   doesn't catch it). Same dark surface as other modals. */
html[data-we-theme="dark"] .warehouse-modal .modal-content {
    background: var(--we-dark-surface) !important;
    border-color: var(--we-dark-border) !important;
    color: var(--we-dark-text);
}
html[data-we-theme="dark"] .warehouse-modal .form-control,
html[data-we-theme="dark"] .warehouse-modal .custom-select {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: var(--we-dark-text) !important;
    border-color: var(--we-dark-border) !important;
}
html[data-we-theme="dark"] .warehouse-modal .form-control::placeholder {
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .warehouse-modal .form-control:focus,
html[data-we-theme="dark"] .warehouse-modal .custom-select:focus {
    border-color: rgba(0, 168, 232, 0.55) !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 168, 232, 0.18) !important;
}

/* =====================================================================
   SweetAlert2 confirmation dialogs (`.swal2-*`) â€” dark mode
   ---------------------------------------------------------------------
   The admin uses SweetAlert2 for destructive-action confirms ("Delete
   Regional Rate", etc.). Out of the box, swal renders a WHITE popup
   with dark text. In dark mode our generic
   `html[data-we-theme="dark"] h1-h6 { color: var(--we-dark-text) }`
   rule retints the title to light â€” but the popup background stays
   white, so the title becomes near-invisible (exactly the "Delete
   Regional Rate" ghost in the user's screenshot).

   Fix: paint the popup itself dark so the light text reads naturally
   â€” same dark surface + border + shadow used by our modals.
   ===================================================================== */

/* Backdrop dimmer */
html[data-we-theme="dark"] .swal2-container .swal2-backdrop-show,
html[data-we-theme="dark"] .swal2-backdrop-show {
    background-color: rgba(0, 0, 0, 0.72) !important;
}

/* Popup panel */
html[data-we-theme="dark"] .swal2-popup {
    background: var(--we-dark-surface) !important;
    color: var(--we-dark-text) !important;
    border: 1px solid var(--we-dark-border) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55) !important;
}

/* Title ("Delete Regional Rate", etc.) â€” full light */
html[data-we-theme="dark"] .swal2-popup .swal2-title,
html[data-we-theme="dark"] .swal2-title {
    color: var(--we-dark-text) !important;
}

/* Body text ("This action cannot be undone.") */
html[data-we-theme="dark"] .swal2-popup .swal2-html-container,
html[data-we-theme="dark"] .swal2-popup .swal2-content,
html[data-we-theme="dark"] .swal2-html-container,
html[data-we-theme="dark"] .swal2-content {
    color: var(--we-dark-text) !important;
}

/* Footer / input field if present */
html[data-we-theme="dark"] .swal2-popup .swal2-footer {
    color: var(--we-dark-muted) !important;
    border-top-color: var(--we-dark-border) !important;
}
html[data-we-theme="dark"] .swal2-popup .swal2-input,
html[data-we-theme="dark"] .swal2-popup .swal2-textarea,
html[data-we-theme="dark"] .swal2-popup .swal2-file,
html[data-we-theme="dark"] .swal2-popup .swal2-select {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: var(--we-dark-text) !important;
    border-color: var(--we-dark-border) !important;
}
html[data-we-theme="dark"] .swal2-popup .swal2-input::placeholder,
html[data-we-theme="dark"] .swal2-popup .swal2-textarea::placeholder {
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .swal2-popup .swal2-validation-message {
    background-color: rgba(239, 68, 68, 0.14) !important;
    color: #fca5a5 !important;
}

/* Close button (the Ã— in some popups) */
html[data-we-theme="dark"] .swal2-popup .swal2-close {
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .swal2-popup .swal2-close:hover,
html[data-we-theme="dark"] .swal2-popup .swal2-close:focus {
    color: #fff !important;
}

/* Loader / progress bar */
html[data-we-theme="dark"] .swal2-popup .swal2-loader {
    border-color: var(--we-accent, #00a8e8) rgba(255, 255, 255, 0.10) rgba(255, 255, 255, 0.10) !important;
}
html[data-we-theme="dark"] .swal2-popup .swal2-timer-progress-bar {
    background: rgba(255, 255, 255, 0.18) !important;
}

/* Icons (warning/error/success/info/question) â€” the surrounding ring
   colour is set by `border-color` per type; on dark, the soft amber/
   green/red etc. read fine, but the inner glyph (!, ?, âœ“, âœ—) needs to
   stay coloured-on-dark so we don't lose it. SweetAlert paints the
   glyph via inner elements that inherit colour â€” re-affirm the icon
   border tints so they pop on dark. */
html[data-we-theme="dark"] .swal2-icon.swal2-warning {
    border-color: #f59e0b !important;
    color: #fbbf24 !important;
}
html[data-we-theme="dark"] .swal2-icon.swal2-error {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
}
html[data-we-theme="dark"] .swal2-icon.swal2-success {
    border-color: #10b981 !important;
    color: #10b981 !important;
}
html[data-we-theme="dark"] .swal2-icon.swal2-info {
    border-color: #38bdf8 !important;
    color: #38bdf8 !important;
}
html[data-we-theme="dark"] .swal2-icon.swal2-question {
    border-color: #94a3b8 !important;
    color: #94a3b8 !important;
}
/* The animated success "ring fill" is white in light mode and reads
   harshly on dark â€” soften it. */
html[data-we-theme="dark"] .swal2-icon.swal2-success [class^="swal2-success-line"] {
    background-color: #10b981 !important;
}
html[data-we-theme="dark"] .swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(16, 185, 129, 0.30) !important;
}
html[data-we-theme="dark"] .swal2-icon.swal2-success [class^="swal2-success-circular-line"],
html[data-we-theme="dark"] .swal2-icon.swal2-success .swal2-success-fix {
    background-color: transparent !important;
}

/* =====================================================================
   File download modal (`.fdm-*`) â€” dark mode
   ---------------------------------------------------------------------
   `backend/partials/file-download-modal.blade.php` ships its own
   `.fdm-*` system (header / spinner / progress bar / file chip /
   error box / close button), all hardcoded for light mode:
     .fdm-ht-title { color:#111827; }      â†’ "Preparing download" /
                                            "Download ready" / "Download failed"
     .fdm-ht-sub   { color:#6b7280; }      â†’ "Please waitâ€¦" /
                                            "Your file is downloadingâ€¦"
     .fdm-lbl      { color:#374151; }      â†’ "Generating fileâ€¦"
     .fdm-bar-track{ background:#e2e8f0; } â†’ progress track
     .fdm-file-chip{ background:#f0fdf4; color:#15803d; } â†’ green file pill
     .fdm-err-*     { red palette ... }
     .fdm-btn      { background:#fff; color:#374151; }

   The outer `.modal-content.fdm-card` is now painted dark by our modal
   dark rules, so the dark hardcoded text + tracks land on the dark
   panel and become invisible (exactly the ghosted "Preparing download"
   / "Generating fileâ€¦" / "Download ready" in the user's screenshots).

   Fix: scope a dark palette per `.fdm-*` class so the popup matches
   the rest of the dark modal system, while keeping the semantic
   coloured states (blue / green / red strip + icon).
   ===================================================================== */

/* Top accent strip stays bright (state colours are deliberately
   saturated) â€” no change needed. */

/* Header divider */
html[data-we-theme="dark"] .fdm-head {
    border-bottom-color: var(--we-dark-border) !important;
}

/* Title + subtitle */
html[data-we-theme="dark"] .fdm-ht-title {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .fdm-ht-sub {
    color: var(--we-dark-muted) !important;
}

/* Close button (Ã—) */
html[data-we-theme="dark"] .fdm-xbtn {
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .fdm-xbtn:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
}

/* Icon circle states â€” soften the pastel fills for the dark panel */
html[data-we-theme="dark"] .fdm-ic {
    background-color: rgba(14, 165, 233, 0.18) !important; /* loading: sky tint */
}
html[data-we-theme="dark"] .fdm-ic.fdm-ic-done {
    background-color: rgba(34, 197, 94, 0.18) !important;  /* done: green tint */
}
html[data-we-theme="dark"] .fdm-ic.fdm-ic-error {
    background-color: rgba(239, 68, 68, 0.18) !important;  /* error: red tint */
}
/* Spinner ring â€” brighten the inactive arc so it reads on dark */
html[data-we-theme="dark"] .fdm-ic .fdm-spinner {
    border-color: rgba(255, 255, 255, 0.18);
    border-top-color: #38bdf8;  /* sky-400 */
}

/* Loading label + progress bar */
html[data-we-theme="dark"] .fdm-lbl {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .fdm-bar-track {
    background-color: rgba(255, 255, 255, 0.08) !important;
}
html[data-we-theme="dark"] .fdm-bar-fill {
    /* Keep the sky gradient but slightly brighter for dark */
    background: linear-gradient(90deg, #7dd3fc 0%, #38bdf8 60%, #7dd3fc 100%) !important;
}
html[data-we-theme="dark"] .fdm-bar-hint {
    color: var(--we-dark-muted) !important;
}

/* "Done" state: file chip */
html[data-we-theme="dark"] .fdm-file-chip {
    background-color: rgba(34, 197, 94, 0.14) !important;
    border-color: rgba(34, 197, 94, 0.32) !important;
    color: #86efac !important;  /* green-300 readable on dark */
}
html[data-we-theme="dark"] .fdm-file-chip i {
    color: #86efac !important;
}
html[data-we-theme="dark"] .fdm-close-hint {
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .fdm-cd-track {
    background-color: rgba(255, 255, 255, 0.08) !important;
}
html[data-we-theme="dark"] .fdm-cd-fill {
    background-color: #22c55e !important;
}

/* "Error" state: error box */
html[data-we-theme="dark"] .fdm-err-box {
    background-color: rgba(239, 68, 68, 0.10) !important;
    border-color: rgba(239, 68, 68, 0.32) !important;
}
html[data-we-theme="dark"] .fdm-err-head {
    color: #fca5a5 !important;  /* red-300 */
}
html[data-we-theme="dark"] .fdm-err-msg {
    color: #fecaca !important;  /* red-200 */
}

/* Shared close button at the bottom of the popup */
html[data-we-theme="dark"] .fdm-btn {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border-color: var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .fdm-btn:hover {
    background-color: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.20) !important;
    color: #fff !important;
}

/* =====================================================================
   Goods Received pages (Sea + Air) â€” dark mode
   ---------------------------------------------------------------------
   `backend/receive_warehouse/sea.blade.php` and `air.blade.php` share
   the same `.rw-us-*` (Upload Settings modal) and `.rw-pdf-*` (Export
   PDF modal) class systems â€” both hardcoded for light mode:
     .rw-us-option  { background:#f8f9fa; }     /* light option card */
     .rw-us-help    { color:#6c757d; }
     .rw-pdf-option { background:#f8f9fa; }     /* same â€” PDF mode card */
     .rw-pdf-help   { color:#6c757d; }
   Neither has a dark counterpart, so in dark mode the "Enforce Client
   Matching" / "Multiple Received Dates" / "Goods received on specific
   date(s)" / "Goods not shipped" cards render as bright cream slabs
   with invisible titles (exactly the user's two screenshots).

   Selectors are global (not scoped to .rw-sea-* / .rw-air-*) so the
   same block covers both pages with one set of rules.
   ===================================================================== */

/* Upload Settings option cards */
html[data-we-theme="dark"] .rw-us-option {
    background-color: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .rw-us-label {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .rw-us-help {
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .rw-us-section-title {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .rw-us-note {
    color: var(--we-dark-muted) !important;
}
/* The red "NB:" note explicitly carries the text-danger class; make
   sure it stays red on dark (default `.text-danger` reads fine, but
   our generic dark text rules might soften it â€” re-affirm). */
html[data-we-theme="dark"] .rw-us-note.text-danger {
    color: #fca5a5 !important;
}

/* Export PDF option cards */
html[data-we-theme="dark"] .rw-pdf-option {
    background-color: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .rw-pdf-label {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .rw-pdf-help {
    color: var(--we-dark-muted) !important;
}

/* "Shipped" column No-pill â€” user wants the "No" text WHITE in dark
   mode. The markup is `<span class="badge badge-pill badge-warning
   text-dark">â€¦No</span>`. Our generic `.text-dark` dark rule retints
   it to `--we-dark-muted` which fades into the yellow. Force white. */
html[data-we-theme="dark"] .badge-warning.text-dark,
html[data-we-theme="dark"] .badge.badge-warning.text-dark,
html[data-we-theme="dark"] .badge-pill.badge-warning.text-dark,
html[data-we-theme="dark"] .badge-warning.text-dark i {
    color: #fff !important;
}
/* `.badge-warning` keeps its existing yellow background â€” readable
   yellow + white is intentional per the user request. */

/* "Yes" pill (badge-success) and any other success-coloured pill in
   these tables â€” make sure the text stays white in dark mode too. */
html[data-we-theme="dark"] .badge-success,
html[data-we-theme="dark"] .badge.badge-success,
html[data-we-theme="dark"] .badge-pill.badge-success {
    color: #fff !important;
}

/* "Unassigned" / .badge-secondary pills in the same table need
   matching white text for consistency. */
html[data-we-theme="dark"] .badge-secondary,
html[data-we-theme="dark"] .badge.badge-secondary,
html[data-we-theme="dark"] .badge-pill.badge-secondary {
    color: #fff !important;
}

/* =====================================================================
   Goods Received Bulk Message modal (`.rw-bm-*`) â€” sea + air
   ---------------------------------------------------------------------
   Both `backend/receive_warehouse/sea.blade.php` and `air.blade.php`
   define an identical `.rw-bm-*` class system for the "Send Bulk SMS"
   modal that appears on those pages. All surfaces are hardcoded white
   / light:
     .rw-bm-card        { background:#fff; }
     .rw-bm-icon        { background:rgba(0,0,0,0.02); }
     .rw-bm-tab         { background:#fff; color:rgba(0,0,0,0.65); }
     .rw-bm-tab.is-active { color:rgba(0,0,0,0.90); }
     .rw-bm-dashed      { background:rgba(0,0,0,0.02); border:dashed rgba(0,0,0,0.10); }
     .rw-bm-spark       { background:rgba(0,0,0,0.02); }
     .rw-bm-footer      { background:rgba(0,0,0,0.02); }
     .rw-bm-template-tile { background:rgba(0,0,0,0.02); }
     .rw-bm-template    { background:#fff; }
     .rw-bm-template-plus { background:#fff; }
   Plus the modal body wrapper has an inline
   `style="background:#f3f4f6"` (already covered by the expanded
   substring catcher above) and the header bar carries `bg-white`.

   In dark mode all of that landed as white slabs with dark text
   floating on a cream wrapper â€” the user's screenshot. Fix: scope
   dark surfaces + borders + text per `.rw-bm-*` class, plus override
   the white `bg-white` header bar inside the modal. The selectors are
   not scoped to `.rw-sea-modal` vs `.rw-air-modal`, so the same block
   covers both pages with one rule set.
   ===================================================================== */

/* Modal header bar (the `bg-white` chip that holds the title) */
html[data-we-theme="dark"] #rwSeaBulkMessageModal .modal-body > .bg-white,
html[data-we-theme="dark"] #rwAirBulkMessageModal .modal-body > .bg-white,
html[data-we-theme="dark"] .rw-sea-modal .modal-body > .bg-white,
html[data-we-theme="dark"] .rw-air-modal .modal-body > .bg-white {
    background-color: var(--we-dark-surface) !important;
    color: var(--we-dark-text) !important;
    border-bottom: 1px solid var(--we-dark-border) !important;
}

/* Inner cards (`Bulk SMS Campaign`, the tabs container, etc.) */
html[data-we-theme="dark"] .rw-bm-card {
    background-color: var(--we-dark-surface) !important;
    border: 1px solid var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}

/* Round icon chip on the "Bulk SMS Campaign" row */
html[data-we-theme="dark"] .rw-bm-icon {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}

/* Tabs (Compose Message / Use Template) */
html[data-we-theme="dark"] .rw-bm-tab {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--we-dark-border) !important;
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .rw-bm-tab:hover,
html[data-we-theme="dark"] .rw-bm-tab:focus {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .rw-bm-tab.is-active {
    background-color: var(--we-accent, #00a8e8) !important;
    border-color: var(--we-accent, #00a8e8) !important;
    color: #fff !important;
}

/* Dashed callout cards ("Personalize Your Message", "Recipients", etc.) */
html[data-we-theme="dark"] .rw-bm-dashed {
    background-color: rgba(255, 255, 255, 0.03) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
}

/* Magic-wand icon chip beside the Personalize / Choose-a-Template title */
html[data-we-theme="dark"] .rw-bm-spark {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}

/* Footer card ("Ready to send?") at the bottom of the compose pane */
html[data-we-theme="dark"] .rw-bm-footer {
    background-color: rgba(255, 255, 255, 0.04) !important;
    border-color: var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}

/* Template tiles + add-new tile + plus chip (Use Template pane) */
html[data-we-theme="dark"] .rw-bm-template-tile {
    background-color: rgba(255, 255, 255, 0.03) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .rw-bm-template-tile:hover {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border-color: var(--we-accent, #00a8e8) !important;
}
html[data-we-theme="dark"] .rw-bm-template {
    background-color: var(--we-dark-surface) !important;
    border-color: var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .rw-bm-template:hover {
    border-color: var(--we-accent, #00a8e8) !important;
}
html[data-we-theme="dark"] .rw-bm-template-plus {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}

/* `0/1600` / `1 SMS` badges in the campaign row */
html[data-we-theme="dark"] .rw-bm-card .badge-light.badge-pill,
html[data-we-theme="dark"] .rw-bm-card .badge.badge-pill.badge-light {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: var(--we-dark-text) !important;
    border: 1px solid var(--we-dark-border) !important;
}

/* Dashed border-top divider used inside the recipients section
   `border-top: 1px dashed #d1d5db` */
html[data-we-theme="dark"] .rw-bm-dashed [style*="border-top: 1px dashed #d1d5db"],
html[data-we-theme="dark"] [style*="border-top: 1px dashed #d1d5db"] {
    border-top-color: rgba(255, 255, 255, 0.18) !important;
}
/* =====================================================================
   v2 RESCOPE â€” Goods Received pages
   ---------------------------------------------------------------------
   Re-asserting the four previous fixes (No pill / Upload Settings card
   / Export PDF card / Bulk SMS modal) at MUCH HIGHER specificity using
   `html[data-we-theme="dark"]` as the leading selector. Belt-and-
   suspenders: if these rules are loaded by the browser, the user MUST
   see them applied â€” they can't lose to any page-scoped rule.

   Also includes a tiny visible TEST MARKER (2-px dark cyan strip at
   the bottom-left edge of the page in dark mode). If the user
   hard-reloads and sees that strip, the file is being served and
   parsed; if they don't see it, the browser is serving a cached
   we-theme.css and the cache-bust isn't working.
   ===================================================================== */

/* (Earlier diagnostic test marker removed â€” CSS load confirmed.) */

/* --- v2: "No" pill â€” boosted specificity --- */
html[data-we-theme="dark"] td .badge-warning.text-dark,
html[data-we-theme="dark"] td .badge.badge-warning.text-dark,
html[data-we-theme="dark"] td .badge-pill.badge-warning.text-dark,
html[data-we-theme="dark"] table .badge-warning.text-dark,
html[data-we-theme="dark"] .badge-warning.text-dark,
html[data-we-theme="dark"] span.badge-warning.text-dark,
html[data-we-theme="dark"] .badge-warning.text-dark i,
html[data-we-theme="dark"] span.badge-warning.text-dark i {
    color: #ffffff !important;
}
html[data-we-theme="dark"] td .badge-success,
html[data-we-theme="dark"] table .badge-success,
html[data-we-theme="dark"] span.badge.badge-success,
html[data-we-theme="dark"] .badge-success {
    color: #ffffff !important;
}
html[data-we-theme="dark"] td .badge-secondary,
html[data-we-theme="dark"] table .badge-secondary,
html[data-we-theme="dark"] span.badge.badge-secondary,
html[data-we-theme="dark"] .badge-secondary {
    color: #ffffff !important;
}

/* --- v2: Upload Settings option cards (.rw-us-*) --- */
html[data-we-theme="dark"] .modal .rw-us-option,
html[data-we-theme="dark"] .modal-body .rw-us-option,
html[data-we-theme="dark"] .rw-us-option {
    background-color: rgba(255, 255, 255, 0.04) !important;
    background-image: none !important;
    border: 1px solid var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .rw-us-option .rw-us-label,
html[data-we-theme="dark"] .rw-us-label {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .rw-us-option .rw-us-help,
html[data-we-theme="dark"] .rw-us-help {
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .modal .rw-us-section-title,
html[data-we-theme="dark"] .rw-us-section-title {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .rw-us-note {
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .rw-us-note.text-danger {
    color: #fca5a5 !important;
}

/* --- v2: Export PDF option cards (.rw-pdf-*) --- */
html[data-we-theme="dark"] .modal .rw-pdf-option,
html[data-we-theme="dark"] .modal-body .rw-pdf-option,
html[data-we-theme="dark"] .rw-pdf-option {
    background-color: rgba(255, 255, 255, 0.04) !important;
    background-image: none !important;
    border: 1px solid var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .rw-pdf-option .rw-pdf-label,
html[data-we-theme="dark"] .rw-pdf-label {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .rw-pdf-option .rw-pdf-help,
html[data-we-theme="dark"] .rw-pdf-help {
    color: var(--we-dark-muted) !important;
}

/* --- v2: Goods Received Bulk SMS modal (.rw-bm-*) --- */
html[data-we-theme="dark"] .modal .modal-body > [style*="#f3f4f6"],
html[data-we-theme="dark"] [style*="background:#f3f4f6"],
html[data-we-theme="dark"] [style*="background: #f3f4f6"] {
    background-color: var(--we-dark-bg) !important;
    background-image: none !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .modal .modal-body > .bg-white,
html[data-we-theme="dark"] .modal-body > .bg-white,
html[data-we-theme="dark"] .modal .bg-white {
    background-color: var(--we-dark-surface) !important;
    background-image: none !important;
    color: var(--we-dark-text) !important;
    border-bottom: 1px solid var(--we-dark-border) !important;
}
html[data-we-theme="dark"] .modal .bg-white .text-muted {
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .modal .rw-bm-card,
html[data-we-theme="dark"] .rw-bm-card {
    background-color: var(--we-dark-surface) !important;
    background-image: none !important;
    border: 1px solid var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .modal .rw-bm-icon,
html[data-we-theme="dark"] .rw-bm-icon {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .modal .rw-bm-tab,
html[data-we-theme="dark"] button.rw-bm-tab,
html[data-we-theme="dark"] .rw-bm-tab {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--we-dark-border) !important;
    color: var(--we-dark-muted) !important;
}
html[data-we-theme="dark"] .modal .rw-bm-tab.is-active,
html[data-we-theme="dark"] button.rw-bm-tab.is-active,
html[data-we-theme="dark"] .rw-bm-tab.is-active {
    background-color: #00a8e8 !important;
    border-color: #00a8e8 !important;
    color: #ffffff !important;
}
html[data-we-theme="dark"] .modal .rw-bm-dashed,
html[data-we-theme="dark"] .rw-bm-dashed {
    background-color: rgba(255, 255, 255, 0.03) !important;
    border: 2px dashed rgba(255, 255, 255, 0.20) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .modal .rw-bm-spark,
html[data-we-theme="dark"] .rw-bm-spark {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .modal .rw-bm-footer,
html[data-we-theme="dark"] .rw-bm-footer {
    background-color: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .modal .rw-bm-template-tile,
html[data-we-theme="dark"] .rw-bm-template-tile {
    background-color: rgba(255, 255, 255, 0.03) !important;
    border: 2px dashed rgba(255, 255, 255, 0.20) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .modal .rw-bm-template,
html[data-we-theme="dark"] .rw-bm-template {
    background-color: var(--we-dark-surface) !important;
    border: 1px solid var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .modal .rw-bm-template-plus,
html[data-we-theme="dark"] .rw-bm-template-plus {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--we-dark-border) !important;
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .rw-bm-card .badge-pill.badge-light,
html[data-we-theme="dark"] .rw-bm-card .badge.badge-pill.badge-light {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: var(--we-dark-text) !important;
    border: 1px solid var(--we-dark-border) !important;
}


/* =====================================================================
   Final catch-all: ALL TEXT WHITE in dark mode
   ---------------------------------------------------------------------
   The user's request: every text colour in dark mode should read as
   white. Light mode is fully preserved (this whole block is scoped
   under `html[data-we-theme="dark"]` so no light-mode rule is touched).

   Approach:
   1. The `--we-dark-text` token is now `#ffffff` (was `#e2e8f0`), so
      everything inheriting from body picks up pure white.
   2. The `--we-dark-muted` token is now `#cbd5e1` (slate-300, was the
      darker `#93a4bf`), so "muted" text reads as light grey-white
      instead of mid blue-grey. Still distinguishable from primary
      text but clearly visible.
   3. Bootstrap's `.text-secondary`, `.text-dark`, `.text-body` etc.
      are re-asserted as light here at high specificity.
   4. The "No" / "Yes" / pill badges are re-asserted as `#fff` text.
   ===================================================================== */
html[data-we-theme="dark"] .text-secondary,
html[data-we-theme="dark"] .text-body,
html[data-we-theme="dark"] .text-black,
html[data-we-theme="dark"] .text-reset {
    color: var(--we-dark-text) !important;
}
/* Bootstrap `text-dark` and `text-muted` keep their semantic meaning
   in dark mode but are bumped to bright values so they remain
   clearly readable. */
html[data-we-theme="dark"] .text-dark {
    color: var(--we-dark-text) !important;
}
html[data-we-theme="dark"] .text-muted,
html[data-we-theme="dark"] small.text-muted {
    color: var(--we-dark-muted) !important;
}

/* `.text-warning` / `.text-success` / `.text-danger` / `.text-info`
   semantic colours stay at brand-coloured tints — keep them but bump
   to the lighter shade so they read on the dark canvas. */
html[data-we-theme="dark"] .text-warning {
    color: #fbbf24 !important;
}
html[data-we-theme="dark"] .text-success {
    color: #34d399 !important;
}
html[data-we-theme="dark"] .text-danger {
    color: #fca5a5 !important;
}
html[data-we-theme="dark"] .text-info {
    color: #38bdf8 !important;
}
html[data-we-theme="dark"] .text-primary {
    color: #60a5fa !important;
}

/* Final blanket — `.badge-warning.text-dark` (the "No" pill) — re-affirmed */
html[data-we-theme="dark"] .badge-warning.text-dark,
html[data-we-theme="dark"] .badge.badge-warning.text-dark,
html[data-we-theme="dark"] span.badge-warning.text-dark,
html[data-we-theme="dark"] td .badge-warning.text-dark,
html[data-we-theme="dark"] .badge-warning.text-dark i,
html[data-we-theme="dark"] span.badge-warning.text-dark i,
html[data-we-theme="dark"] td .badge-warning.text-dark i {
    color: #ffffff !important;
}

/* =====================================================================
   Client Parcel Control Panel (`.cp-*`) — dark mode
   ---------------------------------------------------------------------
   `merchant_panel/parcel/index.blade.php` ships its own `.cp-control-panel`
   card containing the SEA/AIR mode toggle and the RECEIVED/SHIPPED/ARRIVED
   status tabs, plus a `.cp-search` block below it. All of these were
   designed light-only — `#ffffff` panel, `#f1f5f9` toggle track, `#64748b`
   tab text — so in dark mode the card glares white against the dark page
   and the inactive AIR / SHIPPED / ARRIVED labels are barely legible.

   Fix: re-skin the surfaces and muted text using the existing
   `--we-dark-*` tokens. The brand-cyan active states (gradient pill +
   underline) are preserved — they read well on both backgrounds.
   ===================================================================== */
/* IMPORTANT — surface tone: `var(--we-dark-surface)` (#131c2e) is too
   close to the body bg (#0b1220), so the panel disappears into the
   page and the whole area reads as "plain empty dark." Use a deliberately
   lifted slate (#1e2a44) with a brighter border so the card is clearly
   *present* as a distinct surface. */
html[data-we-theme="dark"] .cp-control-panel {
    background: #1e2a44 !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .30) !important;
}
html[data-we-theme="dark"] .cp-control-panel__title {
    color: #e2e8f0 !important;  /* slate-200 — heading needs presence */
}

/* SEA / AIR segmented pill — clearer pill track that contrasts with the
   panel above it, plus brighter inactive text so AIR is readable. */
html[data-we-theme="dark"] .cp-mode-toggle {
    background: rgba(15, 23, 42, 0.55) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
}
html[data-we-theme="dark"] .cp-mode-toggle__btn {
    color: #cbd5e1 !important;  /* slate-300 — visible inactive */
}
html[data-we-theme="dark"] .cp-mode-toggle__btn:hover {
    color: #ffffff !important;
}
html[data-we-theme="dark"] .cp-mode-toggle__btn.is-active {
    color: #ffffff !important;  /* brand gradient bg comes from base rule */
}

/* RECEIVED / SHIPPED / ARRIVED underlined tabs — clearer divider line
   and brighter inactive tab text so they don't read as disabled. */
html[data-we-theme="dark"] .cp-status-tabs {
    border-bottom-color: rgba(255, 255, 255, 0.12) !important;
}
html[data-we-theme="dark"] .cp-status-tabs__btn {
    color: #cbd5e1 !important;
}
html[data-we-theme="dark"] .cp-status-tabs__btn:hover {
    color: #ffffff !important;
}
html[data-we-theme="dark"] .cp-status-tabs__btn.is-active {
    color: #38bdf8 !important;  /* sky-400 — brighter cyan reads better on dark */
}

/* Search block (label + input + clear button). The label sits OUTSIDE
   the panel on the page bg, so keep it bright white for legibility. */
html[data-we-theme="dark"] .cp-search__label {
    color: #f1f5f9 !important;  /* slate-100 */
}
html[data-we-theme="dark"] .cp-search__input {
    background: #1e2a44 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
}
html[data-we-theme="dark"] .cp-search__input::placeholder {
    color: #94a3b8 !important;  /* slate-400 */
    opacity: 1;
}
html[data-we-theme="dark"] .cp-search__input:focus {
    background: #24314e !important;
    border-color: rgba(56, 189, 248, 0.60) !important;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.18) !important;
}
html[data-we-theme="dark"] .cp-search__icon {
    color: #94a3b8 !important;
}
html[data-we-theme="dark"] .cp-search__clear {
    background: rgba(255, 255, 255, 0.10) !important;
    color: #ffffff !important;
}
html[data-we-theme="dark"] .cp-search__clear:hover {
    background: rgba(255, 255, 255, 0.18) !important;
}
html[data-we-theme="dark"] .cp-search__spinner {
    color: #cbd5e1 !important;
}

/* =====================================================================
   Pickup Request views (`.pickup-view-card`) — dark mode
   ---------------------------------------------------------------------
   `merchant_panel/pickup_request/warehouse_index.blade.php` and
   `…/delivery_index.blade.php` both ship the same inline style:
     .pickup-view-card { background: #fff; ... }
     .pickup-view-kv { color: #111827; }
     .pickup-view-kv .label { color: rgba(17,24,39,.65); }
   In dark mode these render as glaring white slabs with dark text. The
   table/list rows and "No requests found" empty-state message also need
   to inherit dark-friendly colors so the page doesn't look blank.
   ===================================================================== */
html[data-we-theme="dark"] .pickup-view-card {
    background: #1e2a44 !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .35) !important;
}
html[data-we-theme="dark"] .pickup-view-kv {
    color: #f1f5f9 !important;  /* slate-100 */
}
html[data-we-theme="dark"] .pickup-view-kv .label {
    color: #cbd5e1 !important;  /* slate-300 — muted but legible */
}
