/*
 * dark-global.css
 * Application-wide BS5.3 / Metronic dark mode overrides.
 * Loaded after all other stylesheets. Uses [data-theme="dark"] (set server-side
 * by BootstrapBase.php) so every rule here wins over page-level :root variables
 * via CSS specificity (attribute selector 0-1-0 > pseudo-class 0-0-1).
 *
 * Structure:
 *   1. CSS variable overrides (all custom page-level vars → dark equivalents)
 *   2. Body / page background
 *   3. Generic element overrides (cards, tables, forms, badges, modals…)
 *   4. DataTables overrides
 *   5. Select2 overrides
 *   6. Utility / misc
 */

/* ─────────────────────────────────────────────────────────────────────────
   1. CSS VARIABLE OVERRIDES
   Covers every custom --variable found across admin views, grouped by role.
   Because [data-theme="dark"] has higher specificity than :root, these
   override each page's own :root { --var: light-value } definitions.
───────────────────────────────────────────────────────────────────────── */
[data-theme="dark"] {

    /* ── Page / body backgrounds ── */
    --bg: #0f172a;
    --bg-page: #0f172a;
    --bg-alt: #1e293b;
    --bg-card: #1e293b;
    --bg-elevated: #253044;
    --bg-hover: rgba(148,163,184,0.07);
    --bg-muted: #1e293b;
    --bg-soft: #1e293b;
    --bg-surface: #1e293b;
    --bg-accent: rgba(59,130,246,0.08);

    /* ── Cards / surfaces / panels ── */
    --card: rgba(30,41,59,0.95);
    --card-bd: rgba(148,163,184,0.12);
    --card-border: rgba(148,163,184,0.12);
    --card-shadow: 0 18px 40px rgba(0,0,0,.45);
    --card-shadow-sm: 0 4px 12px rgba(0,0,0,.35);
    --surface: #1e293b;
    --surface-dim: #253044;
    --surface-hover: rgba(148,163,184,0.07);
    --glass-bg: rgba(30,41,59,0.88);
    --glass-bd: rgba(148,163,184,0.14);
    --white: #1e293b;

    /* ── Text / ink ── */
    --text: #e2e8f0;
    --text-primary: #e2e8f0;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --text-faint: #475569;
    --ink: #e2e8f0;
    --ink-soft: #94a3b8;
    --muted: #94a3b8;
    --title: #f1f5f9;

    /* ── Borders / lines ── */
    --border: rgba(148,163,184,0.14);
    --border-default: rgba(148,163,184,0.14);
    --border-soft: rgba(148,163,184,0.10);
    --border-subtle: rgba(148,163,184,0.08);
    --border-accent: rgba(59,130,246,0.35);
    --border-emphasis: rgba(148,163,184,0.25);
    --line: rgba(148,163,184,0.12);
    --line-soft: rgba(148,163,184,0.08);

    /* ── Shadows ── */
    --shadow: 0 18px 40px rgba(0,0,0,.45);
    --shadow-sm: 0 4px 12px rgba(0,0,0,.35);
    --shadow-md: 0 8px 24px rgba(0,0,0,.40);
    --shadow-lg: 0 24px 56px rgba(0,0,0,.50);
    --shadow-xl: 0 32px 72px rgba(0,0,0,.55);
    --soft: rgba(148,163,184,0.07);
    --soft-strong: rgba(148,163,184,0.12);

    /* ── Accent colours ── */
    --primary: #3b82f6;
    --primary-light: rgba(59,130,246,0.15);
    --primary-soft: rgba(59,130,246,0.10);
    --primary-dark: #2563eb;
    --success: #34d399;
    --success-light: rgba(16,185,129,0.15);
    --danger: #f87171;
    --danger-light: rgba(239,68,68,0.15);
    --danger-soft: rgba(239,68,68,0.12);
    --warning: #fbbf24;
    --warning-light: rgba(245,158,11,0.15);
    --info: #60a5fa;
    --info-light: rgba(59,130,246,0.15);
    --info-soft: rgba(59,130,246,0.10);
    --warn: #fbbf24;
    --warn-soft: rgba(245,158,11,0.12);
    --amber: #fbbf24;
    --amber-bg: rgba(245,158,11,0.12);
    --amber-light: rgba(245,158,11,0.08);

    /* ── Tables ── */
    --thead: #1e293b;
    --table-border: rgba(148,163,184,0.10);
    --row-alt: rgba(148,163,184,0.04);
    --row-hover: rgba(59,130,246,0.07);
    --zebra: rgba(148,163,184,0.04);

    /* ── Chips / pills ── */
    --chip-bg: rgba(148,163,184,0.10);
    --chip-border: rgba(148,163,184,0.18);
    --chip-text: #cbd5e1;

    /* ─── Per-page prefix variables ───────────────────────────────────── */

    /* orders */
    --orders-bg: #0f172a; --orders-card: rgba(30,41,59,0.95);
    --orders-border: rgba(148,163,184,0.12); --orders-text: #e2e8f0;
    --orders-muted: #94a3b8; --orders-primary: #3b82f6;
    --orders-danger: #f87171; --orders-radius: 24px;
    --orders-shadow: 0 24px 60px rgba(0,0,0,.5);
    --orders-soft-shadow: 0 16px 32px rgba(0,0,0,.35);

    /* products */
    --products-bg: #0f172a; --products-card: rgba(30,41,59,0.95);
    --products-border: rgba(148,163,184,0.12); --products-text: #e2e8f0;
    --products-muted: #94a3b8; --products-primary: #3b82f6;
    --products-success: #34d399; --products-warning: #fb923c;
    --products-danger: #f87171; --products-info: #60a5fa;
    --products-shadow: 0 24px 52px rgba(0,0,0,.5);
    --products-soft-shadow: 0 18px 34px rgba(0,0,0,.35);

    /* invoice */
    --invoice-bg: #0f172a; --invoice-card: rgba(30,41,59,0.95);
    --invoice-border: rgba(148,163,184,0.12); --invoice-text: #e2e8f0;
    --invoice-muted: #94a3b8; --invoice-primary: #3b82f6;
    --invoice-success: #34d399; --invoice-warning: #fbbf24;
    --invoice-danger: #f87171; --invoice-info: #60a5fa;
    --invoice-shadow: 0 24px 60px rgba(0,0,0,.5);
    --invoice-soft-shadow: 0 16px 32px rgba(0,0,0,.35);

    /* purchase / po */
    --purchase-bg: #0f172a; --purchase-fg: #e2e8f0;
    --po-card: rgba(30,41,59,0.95); --po-bg: #0f172a;
    --po-border: rgba(148,163,184,0.12); --po-text: #e2e8f0;
    --po-ink: #e2e8f0; --po-muted: #94a3b8; --po-line: rgba(148,163,184,0.12);
    --po-brand: #3b82f6; --po-brand-dark: #2563eb; --po-brand-deep: #1d4ed8;
    --po-brand-soft: rgba(59,130,246,0.12); --po-soft: rgba(148,163,184,0.07);
    --po-shadow: 0 18px 40px rgba(0,0,0,.45); --po-shadow-sm: 0 4px 12px rgba(0,0,0,.35);
    --po-shadow-soft: 0 8px 24px rgba(0,0,0,.4);
    --po-blue-soft: rgba(59,130,246,0.12); --po-warn-soft: rgba(245,158,11,0.12);
    --po-danger-soft: rgba(239,68,68,0.12); --po-accent-soft: rgba(59,130,246,0.10);
    --po-accent: #3b82f6;

    /* projects / pr */
    --pr-bg: #0f172a; --pr-card: rgba(30,41,59,0.95);
    --pr-border: rgba(148,163,184,0.12); --pr-border-light: rgba(148,163,184,0.08);
    --pr-ink: #e2e8f0; --pr-ink-light: #cbd5e1; --pr-ink-muted: #94a3b8;
    --pr-primary: #3b82f6; --pr-primary-soft: rgba(59,130,246,0.12);
    --pr-success: #34d399; --pr-success-soft: rgba(16,185,129,0.12);
    --pr-warning: #fbbf24; --pr-warning-soft: rgba(245,158,11,0.12);
    --pr-danger: #f87171; --pr-danger-soft: rgba(239,68,68,0.12);
    --pr-purple: #a78bfa; --pr-purple-soft: rgba(167,139,250,0.12);
    --pr-surface: #1e293b; --pr-surface-elevated: #253044;
    --pr-shadow: 0 18px 40px rgba(0,0,0,.45); --pr-shadow-sm: 0 4px 12px rgba(0,0,0,.35);
    --pr-shadow-lg: 0 24px 56px rgba(0,0,0,.5); --pr-glow: rgba(59,130,246,0.25);
    --pr-white: #1e293b; --pr-white-muted: #253044;

    /* leave */
    --leave-bg: #0f172a; --leave-card: rgba(30,41,59,0.95);
    --leave-ink: #e2e8f0; --leave-line: rgba(148,163,184,0.12);
    --leave-muted: #94a3b8; --leave-primary: #3b82f6;
    --leave-primary-soft: rgba(59,130,246,0.12); --leave-shadow: 0 18px 40px rgba(0,0,0,.45);

    /* payroll / pl */
    --payroll-bg: #0f172a; --payroll-card-bg: rgba(30,41,59,0.95);
    --payroll-header-bg: #1e293b; --payroll-border: rgba(148,163,184,0.12);
    --payroll-text: #e2e8f0; --payroll-text-muted: #94a3b8;
    --payroll-primary: #3b82f6; --payroll-primary-dark: #2563eb;
    --payroll-success: #34d399; --payroll-danger: #f87171; --payroll-warning: #fbbf24;
    --payroll-row-hover: rgba(59,130,246,0.07);
    --payroll-frozen-shadow: 4px 0 12px rgba(0,0,0,.35);
    --payroll-sticky-shadow: 0 -4px 12px rgba(0,0,0,.35);
    --pl-bg: #0f172a; --pl-card: rgba(30,41,59,0.95);
    --pl-border: rgba(148,163,184,0.12); --pl-muted: #94a3b8;
    --pl-primary: #3b82f6; --pl-success: #34d399;
    --pl-danger: #f87171; --pl-warning: #fbbf24;
    --pl-shadow: 0 18px 40px rgba(0,0,0,.45);
    --pl-strong: #f1f5f9;

    /* kanban / kb */
    --kb-bg: #0a1120; --kanban-bg: #0a1120;
    --kb-col-bg: #131e2e; --kb-card-bg: #1e293b;
    --kb-border: rgba(148,163,184,0.12); --kb-brand: #3b82f6;
    --kb-brand-light: rgba(59,130,246,0.15); --kb-ink: #e2e8f0; --kb-ink-2: #cbd5e1;
    --kb-muted: #94a3b8;
    --kb-shadow-xs: 0 1px 4px rgba(0,0,0,.35); --kb-shadow-sm: 0 4px 12px rgba(0,0,0,.35);
    --kb-shadow-md: 0 8px 24px rgba(0,0,0,.40); --kb-shadow-lg: 0 24px 56px rgba(0,0,0,.5);

    /* manufacturing / mn */
    --mn-bg: #0f172a; --mn-bg-alt: #1e293b; --mn-card: rgba(30,41,59,0.95);
    --mn-card-2: #253044; --mn-card-bd: rgba(148,163,184,0.12);
    --mn-border: rgba(148,163,184,0.12); --mn-line: rgba(148,163,184,0.10);
    --mn-ink: #e2e8f0; --mn-text: #e2e8f0; --mn-text-muted: #94a3b8; --mn-text-secondary: #cbd5e1;
    --mn-muted: #94a3b8; --mn-surface: #1e293b;
    --mn-primary: #3b82f6; --mn-primary-50: rgba(59,130,246,0.08);
    --mn-primary-600: #2563eb; --mn-primary-700: #1d4ed8;
    --mn-primary-dark: #2563eb; --mn-primary-light: rgba(59,130,246,0.15);
    --mn-success: #34d399; --mn-warning: #fbbf24; --mn-danger: #f87171; --mn-info: #60a5fa;
    --mn-shadow: 0 18px 40px rgba(0,0,0,.45); --mn-shadow-2: 0 8px 24px rgba(0,0,0,.4);
    --mn-soft: rgba(148,163,184,0.07); --mn-row-alt: rgba(148,163,184,0.04);
    --mn-th-bg: #1e293b; --mn-th-ink: #94a3b8;
    --mn-nav-bg: #131e2e; --mn-nav-ink: #94a3b8; --mn-nav-ink-active: #e2e8f0;
    --mn-nav-pill: rgba(148,163,184,0.08); --mn-nav-pill-active: rgba(59,130,246,0.18);
    --mn-chip-bg: rgba(148,163,184,0.10); --mn-accent: #3b82f6;
    --mn-accent-600: #2563eb; --mn-accent-soft: rgba(59,130,246,0.12);

    /* grn */
    --grn-bg: #0f172a; --grn-card: rgba(30,41,59,0.95);
    --grn-ink: #e2e8f0; --grn-text: #e2e8f0; --grn-muted: #94a3b8;
    --grn-line: rgba(148,163,184,0.12); --grn-brand: #3b82f6;
    --grn-brand-soft: rgba(59,130,246,0.12); --grn-info-soft: rgba(59,130,246,0.10);
    --grn-warn-soft: rgba(245,158,11,0.12); --grn-shadow: 0 18px 40px rgba(0,0,0,.45);

    /* ir (internal requisition) */
    --ir-card: rgba(30,41,59,0.95); --ir-soft: rgba(148,163,184,0.07);
    --ir-ink: #e2e8f0; --ir-text: #e2e8f0; --ir-muted: #94a3b8; --ir-line: rgba(148,163,184,0.12);
    --ir-brand: #3b82f6; --ir-brand-deep: #1d4ed8; --ir-brand-soft: rgba(59,130,246,0.12);
    --ir-shadow: 0 18px 40px rgba(0,0,0,.45); --ir-shadow-soft: 0 8px 24px rgba(0,0,0,.4);

    /* expense */
    --expense-bg: #0f172a; --expense-fg: #e2e8f0;

    /* asset */
    --asset-bg: #0f172a; --asset-fg: #e2e8f0;

    /* cf (custom form) */
    --cf-bg: #0f172a; --cf-card: rgba(30,41,59,0.95);
    --cf-ink: #e2e8f0; --cf-text: #e2e8f0; --cf-muted: #94a3b8;
    --cf-line: rgba(148,163,184,0.12); --cf-brand: #3b82f6;
    --cf-brand-dark: #2563eb; --cf-brand-soft: rgba(59,130,246,0.12);
    --cf-amber-soft: rgba(245,158,11,0.12); --cf-blue-soft: rgba(59,130,246,0.12);
    --cf-shadow: 0 18px 40px rgba(0,0,0,.45); --cf-shadow-sm: 0 4px 12px rgba(0,0,0,.35);

    /* ep (employee profile) */
    --ep-bg: #0f172a; --ep-border: rgba(148,163,184,0.12);
    --ep-ink: #e2e8f0; --ep-muted: #94a3b8; --ep-brand: #3b82f6;
    --ep-green: #34d399; --ep-amber: #fbbf24; --ep-red: #f87171;
    --ep-indigo: #818cf8; --ep-violet: #a78bfa; --ep-teal: #2dd4bf;
    --ep-shadow: 0 18px 40px rgba(0,0,0,.45);

    /* lm (leave management) */
    --lm-bg: #0f172a; --lm-border: rgba(148,163,184,0.12);
    --lm-ink: #e2e8f0; --lm-muted: #94a3b8; --lm-brand: #3b82f6;
    --lm-green: #34d399; --lm-amber: #fbbf24; --lm-red: #f87171;
    --lm-indigo: #818cf8; --lm-violet: #a78bfa;
    --lm-shadow: 0 18px 40px rgba(0,0,0,.45);

    /* ui (generic ui prefix) */
    --ui-bg: #0f172a; --ui-card: rgba(30,41,59,0.95);
    --ui-border: rgba(148,163,184,0.12); --ui-muted: #94a3b8;
    --ui-primary: #3b82f6; --ui-primary-50: rgba(59,130,246,0.08);
    --ui-primary-600: #2563eb;
    --ui-success: #34d399; --ui-warning: #fbbf24; --ui-danger: #f87171;
    --ui-shadow: 0 18px 40px rgba(0,0,0,.45);

    /* sc */
    --sc-bg: #0f172a; --sc-border: rgba(148,163,184,0.12);
    --sc-ink: #e2e8f0; --sc-muted: #94a3b8; --sc-brand: #3b82f6;
    --sc-brand-dark: #2563eb; --sc-success: #34d399; --sc-danger: #f87171;
    --sc-warn: #fbbf24; --sc-shadow: 0 18px 40px rgba(0,0,0,.45);

    /* ns */
    --ns-navy: #0f172a; --ns-light: #1e293b; --ns-border: rgba(148,163,184,0.12);
    --ns-text: #e2e8f0; --ns-label: #94a3b8; --ns-muted: #94a3b8;
    --ns-green: #34d399; --ns-blue: #60a5fa; --ns-red: #f87171;
    --ns-row-alt: rgba(148,163,184,0.04);

    /* td (time & attendance) */
    --td-bg: #0f172a; --td-card: rgba(30,41,59,0.95);
    --td-border: rgba(148,163,184,0.12); --td-border-md: rgba(148,163,184,0.16);
    --td-ink: #e2e8f0; --td-ink2: #cbd5e1; --td-muted: #94a3b8;
    --td-blue: #60a5fa; --td-blue-lt: rgba(59,130,246,0.12);
    --td-green: #34d399; --td-amber: #fbbf24; --td-red: #f87171; --td-purple: #a78bfa;
    --td-sh: 0 18px 40px rgba(0,0,0,.45); --td-sh-md: 0 8px 24px rgba(0,0,0,.4);
    --td-sh-xs: 0 2px 8px rgba(0,0,0,.35);

    /* tm */
    --tm-bg: #0f172a; --tm-border: rgba(148,163,184,0.12);
    --tm-text: #e2e8f0; --tm-muted: #94a3b8;
    --tm-blue: #60a5fa; --tm-blue-dk: #3b82f6;

    /* sf */
    --sf-bg: #0f172a; --sf-border: rgba(148,163,184,0.12);
    --sf-text: #e2e8f0; --sf-muted: #94a3b8;
    --sf-blue: #60a5fa; --sf-blue-dk: #3b82f6;

    /* nm */
    --nm-brand: #3b82f6; --nm-ink: #e2e8f0; --nm-line: rgba(148,163,184,0.12);
    --nm-muted: #94a3b8; --nm-soft: rgba(148,163,184,0.07);
    --nm-shadow: 0 18px 40px rgba(0,0,0,.45);

    /* bc */
    --bc-brand: #3b82f6; --bc-brand-soft: rgba(59,130,246,0.12);
    --bc-ink: #e2e8f0; --bc-line: rgba(148,163,184,0.12); --bc-muted: #94a3b8;

    /* ac */
    --ac-bg: #0f172a; --ac-border: rgba(148,163,184,0.12);
    --ac-brand: #3b82f6; --ac-danger: #f87171; --ac-success: #34d399;
    --ac-warn: #fbbf24; --ac-indigo: #818cf8;
    --ac-ink: #e2e8f0; --ac-muted: #94a3b8;
    --ac-shadow: 0 18px 40px rgba(0,0,0,.45);

    /* a (short prefix) */
    --a-bg: #0f172a; --a-card: rgba(30,41,59,0.95);
    --a-ink: #e2e8f0; --a-muted: #94a3b8; --a-line: rgba(148,163,184,0.12);
    --a-pri: #3b82f6; --a-warn: #fbbf24;
    --a-shadow: 0 18px 40px rgba(0,0,0,.45); --a-soft: rgba(148,163,184,0.07);

    /* cl */
    --cl-text: #e2e8f0; --cl-muted: #94a3b8; --cl-border: rgba(148,163,184,0.12);
    --cl-soft: rgba(148,163,184,0.07); --cl-primary: #3b82f6;
    --cl-primary-50: rgba(59,130,246,0.08); --cl-primary-600: #2563eb;
    --cl-shadow: 0 18px 40px rgba(0,0,0,.45);

    /* dir */
    --dir-surface: #1e293b; --dir-surface-elevated: #253044; --dir-surface-hover: rgba(148,163,184,0.07);
    --dir-border: rgba(148,163,184,0.12); --dir-border-light: rgba(148,163,184,0.08);
    --dir-text-primary: #e2e8f0; --dir-text-secondary: #cbd5e1; --dir-text-muted: #94a3b8;
    --dir-primary: #3b82f6; --dir-primary-dark: #2563eb; --dir-primary-light: rgba(59,130,246,0.15);
    --dir-success: #34d399; --dir-danger: #f87171; --dir-warning: #fbbf24; --dir-accent: #3b82f6;

    /* ledger */
    --ledger-surface: #1e293b; --ledger-surface-dim: #253044;
    --ledger-border: rgba(148,163,184,0.12); --ledger-text: #e2e8f0;
    --ledger-text-muted: #94a3b8; --ledger-text-secondary: #cbd5e1;
    --ledger-primary: #3b82f6; --ledger-primary-light: rgba(59,130,246,0.15);
    --ledger-danger: #f87171; --ledger-warning: #fbbf24; --ledger-accent: #3b82f6;

    /* review */
    --review-surface: #1e293b; --review-border: rgba(148,163,184,0.12);
    --review-text: #e2e8f0; --review-muted: #94a3b8;
    --review-accent: #3b82f6; --review-accent-deep: #2563eb;
    --review-shadow: 0 18px 40px rgba(0,0,0,.45);

    /* vc (voucher / value chain) */
    --vc-bg: #0f172a; --vc-surface: #1e293b;
    --vc-border: rgba(148,163,184,0.12); --vc-text: #e2e8f0; --vc-muted: #94a3b8;
    --vc-accent: #3b82f6; --vc-accent-deep: #2563eb; --vc-accent-soft: rgba(59,130,246,0.12);
    --vc-success: #34d399;

    /* zi */
    --zi-bg: #0f172a; --zi-card: rgba(30,41,59,0.95);
    --zi-border: rgba(148,163,184,0.12); --zi-ink: #e2e8f0; --zi-muted: #94a3b8;
    --zi-chip: rgba(148,163,184,0.10); --zi-chip-text: #cbd5e1;
    --zi-pill: rgba(59,130,246,0.12); --zi-pill-text: #60a5fa;

    /* order (singular) */
    --order-bg: #0f172a; --order-surface: #1e293b; --order-surface-strong: #253044;
    --order-ink: #e2e8f0; --order-muted: #94a3b8; --order-line: rgba(148,163,184,0.12);
    --order-accent: #3b82f6; --order-accent-soft: rgba(59,130,246,0.12);
    --order-shadow: 0 18px 40px rgba(0,0,0,.45); --order-warm: #fbbf24;

    /* sr / sv / rev */
    --sr-soft: rgba(148,163,184,0.07); --sr-border: rgba(148,163,184,0.12);
    --sr-shadow: 0 18px 40px rgba(0,0,0,.45);
    --sv-soft: rgba(148,163,184,0.07); --sv-border: rgba(148,163,184,0.12);
    --sv-shadow: 0 18px 40px rgba(0,0,0,.45);
    --rev-soft: rgba(148,163,184,0.07); --rev-border: rgba(148,163,184,0.12);
    --rev-muted: #94a3b8; --rev-shadow: 0 18px 40px rgba(0,0,0,.45);

    /* badge colours */
    --blue: #60a5fa; --blue-bg: rgba(59,130,246,0.12); --blue-soft: rgba(59,130,246,0.08); --blue-light: rgba(59,130,246,0.15);
    --emerald: #34d399; --emerald-bg: rgba(16,185,129,0.12); --emerald-light: rgba(16,185,129,0.15);
    --rose: #f87171; --rose-bg: rgba(239,68,68,0.12); --rose-light: rgba(239,68,68,0.15);
    --teal: #2dd4bf; --teal-light: rgba(45,212,191,0.15);
    --violet: #a78bfa; --violet-light: rgba(167,139,250,0.15);

    /* misc sizing (unchanged — not colour vars) */
    --tab-bg: #1e293b; --tab-active: #3b82f6;
    --lane-bg: #131e2e; --lane-border: rgba(148,163,184,0.12); --lane-head: #1e293b;
}

/* ─────────────────────────────────────────────────────────────────────────
   2. BODY / PAGE BACKGROUND
───────────────────────────────────────────────────────────────────────── */
[data-theme="dark"] body {
    background: #0f172a !important;
    color: #e2e8f0;
}

/* ─────────────────────────────────────────────────────────────────────────
   3. GENERIC ELEMENT OVERRIDES
   All properties use !important — inline <style> blocks in <body> load after
   this <head> stylesheet, so equal-specificity rules would win without it.
───────────────────────────────────────────────────────────────────────── */

/* ── Cards ── */
[data-theme="dark"] .card,
[data-theme="dark"] .card-body,
[data-theme="dark"] .card-header,
[data-theme="dark"] .card-footer {
    background-color: #1e293b !important;
    border-color: rgba(148,163,184,0.12) !important;
    color: #e2e8f0 !important;
}
[data-theme="dark"] .card-modern,
[data-theme="dark"] .orders-panel,
[data-theme="dark"] .products-panel,
[data-theme="dark"] .hero-panel,
[data-theme="dark"] .panel-card,
[data-theme="dark"] .ns-card,
[data-theme="dark"] .ns-card .card-header {
    background: rgba(30,41,59,0.95) !important;
    border-color: rgba(148,163,184,0.12) !important;
    color: #e2e8f0 !important;
}

/* ── Form shells / wrappers (any class ending in -shell or containing -form-) ── */
[data-theme="dark"] .product-form-shell,
[data-theme="dark"] [class$="-shell"],
[data-theme="dark"] [class*="-form-shell"] {
    background: #1e293b !important;
    border-color: rgba(148,163,184,0.12) !important;
    color: #e2e8f0 !important;
}

/* ── Modals ── */
[data-theme="dark"] .modal-content {
    background: #1e293b !important;
    border-color: rgba(148,163,184,0.15) !important;
    color: #e2e8f0 !important;
}
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: rgba(148,163,184,0.12) !important;
}

/* ── Summary / stat pills ── */
[data-theme="dark"] .summary-pill {
    background: rgba(148,163,184,0.10) !important;
    border-color: rgba(148,163,184,0.15) !important;
    color: #cbd5e1 !important;
}
[data-theme="dark"] .summary-pill strong { color: #f1f5f9 !important; }

/* ── Status chips / badges ── */
[data-theme="dark"] .status-chip.is-success,
[data-theme="dark"] .status-pill.is-success { color: #34d399 !important; background: rgba(16,185,129,0.12) !important; }
[data-theme="dark"] .status-chip.is-warning,
[data-theme="dark"] .status-pill.is-warning { color: #fb923c !important; background: rgba(249,115,22,0.12) !important; }
[data-theme="dark"] .status-chip.is-danger,
[data-theme="dark"] .status-pill.is-danger  { color: #f87171 !important; background: rgba(239,68,68,0.12) !important; }
[data-theme="dark"] .status-chip.is-info,
[data-theme="dark"] .status-pill.is-info    { color: #60a5fa !important; background: rgba(59,130,246,0.12) !important; }
[data-theme="dark"] .status-chip.is-muted,
[data-theme="dark"] .status-pill.is-muted   { color: #94a3b8 !important; background: rgba(148,163,184,0.10) !important; }

/* Generic BS5 badges */
[data-theme="dark"] .badge.bg-light  { background-color: #334155 !important; color: #e2e8f0 !important; }
[data-theme="dark"] .badge.text-dark { color: #e2e8f0 !important; }

/* ── Coloured icon badges ── */
[data-theme="dark"] .uom-badge    { background: rgba(16,185,129,0.12) !important; color: #34d399 !important; }
[data-theme="dark"] .type-badge   { background: rgba(245,158,11,0.12) !important; color: #fbbf24 !important; }
[data-theme="dark"] .info-badge   { background: rgba(59,130,246,0.12) !important; color: #60a5fa !important; }
[data-theme="dark"] .variant-badge {
    background: #2e1065 !important; color: #c4b5fd !important; border-color: #4c1d95 !important;
}

/* ── Action / icon buttons ── */
[data-theme="dark"] .table-action,
[data-theme="dark"] .prod-action-btn,
[data-theme="dark"] .action-btn {
    background: #1e293b !important;
    border-color: rgba(148,163,184,0.15) !important;
    color: #94a3b8 !important;
}
[data-theme="dark"] .table-action:hover,
[data-theme="dark"] .prod-action-btn:hover,
[data-theme="dark"] .prod-action-btn.show {
    background: rgba(59,130,246,0.15) !important;
    color: #60a5fa !important;
}

/* ── Dropdown / context menus ── */
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .prod-menu,
[data-theme="dark"] .column-picker-menu {
    background: #1e293b !important;
    border-color: rgba(148,163,184,0.15) !important;
    color: #e2e8f0 !important;
}
[data-theme="dark"] .dropdown-item { color: #cbd5e1 !important; }
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background: rgba(59,130,246,0.12) !important;
    color: #93c5fd !important;
}
[data-theme="dark"] .dropdown-divider { border-color: rgba(148,163,184,0.12) !important; }
[data-theme="dark"] .dropdown-header  { color: #64748b !important; }

/* ── Autocomplete / suggestion dropdowns ── */
[data-theme="dark"] [id$="-suggestions"],
[data-theme="dark"] .autocomplete-suggestions {
    background: #1e293b !important;
    border-color: rgba(148,163,184,0.2) !important;
    color: #e2e8f0 !important;
}
[data-theme="dark"] [id$="-suggestions"] .dropdown-item:hover { background: #253044 !important; }

/* ── Forms — !important required: page <style> loads after this file ── */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] textarea.form-control,
[data-theme="dark"] input.form-control {
    background-color: #1e293b !important;
    border-color: rgba(148,163,184,0.25) !important;
    color: #e2e8f0 !important;
}
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: #1e293b !important;
    border-color: rgba(59,130,246,0.5) !important;
    color: #e2e8f0 !important;
    box-shadow: 0 0 0 0.2rem rgba(59,130,246,0.15) !important;
}
[data-theme="dark"] .form-control::placeholder { color: #64748b !important; }
[data-theme="dark"] .input-group-text {
    background-color: #253044 !important;
    border-color: rgba(148,163,184,0.25) !important;
    color: #94a3b8 !important;
}
[data-theme="dark"] .form-check-label { color: #cbd5e1 !important; }

/* ── Checkbox / toggle grids ── */
[data-theme="dark"] .checkbox-grid .form-check,
[data-theme="dark"] [class*="checkbox-grid"] .form-check {
    background: #1e293b !important;
    border-color: rgba(148,163,184,0.18) !important;
}
[data-theme="dark"] .checkbox-grid .form-check:hover,
[data-theme="dark"] [class*="checkbox-grid"] .form-check:hover {
    background: #253044 !important;
    border-color: rgba(148,163,184,0.3) !important;
}
[data-theme="dark"] .checkbox-grid .form-check-label,
[data-theme="dark"] [class*="checkbox-grid"] .form-check-label {
    color: #cbd5e1 !important;
}

/* ── Section dividers ── */
[data-theme="dark"] .section-divider::before,
[data-theme="dark"] .section-divider::after {
    background: rgba(148,163,184,0.15) !important;
}
[data-theme="dark"] .section-divider span { color: #64748b !important; }

/* ── Nav tabs (page-level overrides use specific selectors — match with !important) ── */
[data-theme="dark"] .nav-tabs { border-bottom-color: rgba(148,163,184,0.15) !important; }
[data-theme="dark"] .nav-tabs .nav-link {
    color: #94a3b8 !important;
    background: rgba(148,163,184,0.07) !important;
    border-color: rgba(148,163,184,0.15) !important;
}
[data-theme="dark"] .nav-tabs .nav-link:hover {
    color: #cbd5e1 !important;
    background: rgba(148,163,184,0.12) !important;
    border-color: rgba(148,163,184,0.25) !important;
}
[data-theme="dark"] .nav-tabs .nav-link.active {
    background: #6366f1 !important;
    border-color: #6366f1 !important;
    color: #fff !important;
}
[data-theme="dark"] .nav-pills .nav-link { color: #94a3b8 !important; }
[data-theme="dark"] .nav-pills .nav-link.active {
    background: rgba(59,130,246,0.18) !important;
    color: #60a5fa !important;
}

/* ── Sticky footers / overlays ── */
[data-theme="dark"] .sticky-actions { background: rgba(15,23,42,0.92) !important; }
[data-theme="dark"] #dt-overlay,
[data-theme="dark"] #products-overlay { background: rgba(15,23,42,0.82) !important; }

/* ── Term / info pills ── */
[data-theme="dark"] .term-pill {
    background: rgba(148,163,184,0.08) !important;
    color: #94a3b8 !important;
}
[data-theme="dark"] .order-code {
    background: rgba(59,130,246,0.12) !important;
    color: #60a5fa !important;
}

/* ── Pagination ── */
[data-theme="dark"] .page-link,
[data-theme="dark"] .dataTables_paginate .page-link {
    background: transparent !important;
    border-color: rgba(148,163,184,0.12) !important;
    color: #94a3b8 !important;
}
[data-theme="dark"] .page-item.active .page-link,
[data-theme="dark"] .dataTables_paginate .page-item.active .page-link {
    background: linear-gradient(135deg,#2563eb,#3b82f6) !important;
    color: #fff !important;
    border-color: transparent !important;
}
[data-theme="dark"] .page-item.disabled .page-link { color: #475569 !important; }

/* ── Accordion / collapse ── */
[data-theme="dark"] .accordion-item {
    background: #1e293b !important;
    border-color: rgba(148,163,184,0.12) !important;
    color: #e2e8f0 !important;
}
[data-theme="dark"] .accordion-button {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}
[data-theme="dark"] .accordion-button:not(.collapsed) {
    background: #253044 !important;
    color: #60a5fa !important;
}
[data-theme="dark"] .accordion-button::after { filter: invert(1) brightness(0.8) !important; }

/* ── List groups ── */
[data-theme="dark"] .list-group-item {
    background: #1e293b !important;
    border-color: rgba(148,163,184,0.12) !important;
    color: #e2e8f0 !important;
}
[data-theme="dark"] .list-group-item.active {
    background: rgba(59,130,246,0.18) !important;
    border-color: rgba(59,130,246,0.3) !important;
    color: #60a5fa !important;
}
[data-theme="dark"] .list-group-item:hover { background: #253044 !important; }

/* ── Alerts ── */
[data-theme="dark"] .alert-light {
    background: #1e293b !important;
    border-color: rgba(148,163,184,0.15) !important;
    color: #e2e8f0 !important;
}
[data-theme="dark"] .alert-secondary {
    background: #253044 !important;
    border-color: rgba(148,163,184,0.15) !important;
    color: #cbd5e1 !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   4. DATATABLES
───────────────────────────────────────────────────────────────────────── */
[data-theme="dark"] table.dataTable thead th,
[data-theme="dark"] #orders-table thead th,
[data-theme="dark"] #products-table thead th,
[data-theme="dark"] .table > thead > tr > th {
    background: #1e293b !important;
    border-bottom-color: rgba(148,163,184,0.12) !important;
    color: #94a3b8 !important;
}
[data-theme="dark"] table.dataTable tbody td,
[data-theme="dark"] #orders-table tbody td,
[data-theme="dark"] #products-table tbody td {
    border-bottom-color: rgba(148,163,184,0.08) !important;
    color: #cbd5e1 !important;
}
[data-theme="dark"] table.dataTable tbody tr:hover,
[data-theme="dark"] #orders-table tbody tr:hover,
[data-theme="dark"] #products-table tbody tr:hover {
    background: rgba(59,130,246,0.06) !important;
}
[data-theme="dark"] .dataTables_wrapper .dataTables_length,
[data-theme="dark"] .dataTables_wrapper .dataTables_filter,
[data-theme="dark"] .dataTables_wrapper .dataTables_info,
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate { color: #94a3b8 !important; }
[data-theme="dark"] .dataTables_wrapper .dataTables_filter input,
[data-theme="dark"] .dataTables_wrapper .dataTables_length select {
    background: #1e293b !important;
    border-color: rgba(148,163,184,0.25) !important;
    color: #e2e8f0 !important;
}
[data-theme="dark"] table.dataTable.stripe tbody tr.odd,
[data-theme="dark"] table.dataTable.display tbody tr.odd { background: rgba(148,163,184,0.03) !important; }

/* ─────────────────────────────────────────────────────────────────────────
   5. SELECT2
───────────────────────────────────────────────────────────────────────── */
[data-theme="dark"] .select2-container .select2-selection--single,
[data-theme="dark"] .select2-container .select2-selection--multiple {
    background: #1e293b !important;
    border-color: rgba(148,163,184,0.25) !important;
}
[data-theme="dark"] .select2-container .select2-selection--single .select2-selection__rendered,
[data-theme="dark"] .select2-container .select2-selection--multiple .select2-selection__rendered {
    color: #e2e8f0 !important;
}
[data-theme="dark"] .select2-container .select2-selection--single .select2-selection__arrow b {
    border-color: #94a3b8 transparent transparent transparent !important;
}
[data-theme="dark"] .select2-dropdown {
    background: #1e293b !important;
    border-color: rgba(148,163,184,0.2) !important;
}
[data-theme="dark"] .select2-search--dropdown .select2-search__field {
    background: #253044 !important;
    border-color: rgba(148,163,184,0.25) !important;
    color: #e2e8f0 !important;
}
[data-theme="dark"] .select2-results__option { color: #cbd5e1 !important; }
[data-theme="dark"] .select2-results__option--highlighted {
    background: rgba(59,130,246,0.15) !important;
    color: #93c5fd !important;
}
[data-theme="dark"] .select2-results__option[aria-selected=true] {
    background: rgba(59,130,246,0.10) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   6. MISC
───────────────────────────────────────────────────────────────────────── */
/* Offcanvas */
[data-theme="dark"] .offcanvas,
[data-theme="dark"] .offcanvas-body { background: #1e293b; color: #e2e8f0; }
[data-theme="dark"] .offcanvas-header { border-bottom-color: rgba(148,163,184,0.12); }

/* Toast */
[data-theme="dark"] .toast { background: #1e293b; border-color: rgba(148,163,184,0.15); color: #e2e8f0; }
[data-theme="dark"] .toast-header { background: #253044; border-bottom-color: rgba(148,163,184,0.12); color: #e2e8f0; }

/* Tooltips */
[data-theme="dark"] .tooltip-inner { background: #0f172a; color: #e2e8f0; }

/* Borders */
[data-theme="dark"] .border      { border-color: rgba(148,163,184,0.14) !important; }
[data-theme="dark"] .border-top  { border-top-color: rgba(148,163,184,0.12) !important; }
[data-theme="dark"] hr           { border-color: rgba(148,163,184,0.12); }

/* Text helpers */
[data-theme="dark"] .text-dark   { color: #e2e8f0 !important; }
[data-theme="dark"] .text-muted  { color: #94a3b8 !important; }
[data-theme="dark"] .text-body   { color: #e2e8f0 !important; }

/* Background helpers */
[data-theme="dark"] .bg-white    { background-color: #1e293b !important; }
[data-theme="dark"] .bg-light    { background-color: #253044 !important; }
[data-theme="dark"] .bg-body     { background-color: #0f172a !important; }

/* Tables */
[data-theme="dark"] .table       { color: #cbd5e1; --bs-table-striped-bg: rgba(148,163,184,0.04); --bs-table-hover-bg: rgba(59,130,246,0.06); }
[data-theme="dark"] .table-bordered { border-color: rgba(148,163,184,0.12); }
[data-theme="dark"] .table > :not(caption) > * > * { border-bottom-color: rgba(148,163,184,0.10); background-color: transparent; }

/* ── Custom card surfaces (hardcoded #fff, not using CSS vars) ── */
/* entries/index_modern */
[data-theme="dark"] .toolbar-card {
    background: #1e293b !important;
    border-color: rgba(148,163,184,0.12) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4) !important;
}
[data-theme="dark"] .stat-card {
    background: #1e293b !important;
    border-color: rgba(148,163,184,0.12) !important;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35) !important;
}
[data-theme="dark"] .stat-mini {
    background: #253044 !important;
    border-color: rgba(148,163,184,0.08) !important;
}
[data-theme="dark"] .show-more { color: #94a3b8 !important; }
[data-theme="dark"] .show-more:hover { color: #60a5fa !important; }
[data-theme="dark"] tr.row-selected { background: rgba(59,130,246,0.12) !important; }
[data-theme="dark"] tr.row-selected > * { box-shadow: inset 0 0 0 1px rgba(59,130,246,0.3) !important; }
[data-theme="dark"] .text-muted2 { color: #94a3b8 !important; }

/* payroll/salary_template — .mn-card and .mn-toolbar have hardcoded rgba(255,255,255) */
[data-theme="dark"] .mn-card {
    background: #1e293b !important;
    border-color: rgba(148,163,184,0.12) !important;
    box-shadow: 0 10px 26px rgba(0,0,0,0.4) !important;
}
[data-theme="dark"] .mn-toolbar {
    background: rgba(15,23,42,0.95) !important;
    border-color: rgba(148,163,184,0.12) !important;
}

/* table-light thead (used in payroll salary_template list tab) */
[data-theme="dark"] .table-light,
[data-theme="dark"] thead.table-light,
[data-theme="dark"] .table > thead.table-light > tr > th {
    background: #1e293b !important;
    color: #94a3b8 !important;
    border-color: rgba(148,163,184,0.12) !important;
    --bs-table-bg: #1e293b !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   7. BARE INPUT RESETS
   Pages that reset ALL bare inputs to white with !important
   html[data-theme="dark"] prefix → specificity 0-2-1 beats page's 0-1-1
───────────────────────────────────────────────────────────────────────── */
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input[type="url"],
html[data-theme="dark"] input[type="time"],
html[data-theme="dark"] input[type="datetime-local"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background-color: #1e293b !important;
    border-color: rgba(148,163,184,0.25) !important;
    color: #e2e8f0 !important;
}
html[data-theme="dark"] input[type="text"]::placeholder,
html[data-theme="dark"] input[type="number"]::placeholder,
html[data-theme="dark"] input[type="email"]::placeholder,
html[data-theme="dark"] input[type="search"]::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #64748b !important; }

html[data-theme="dark"] input[type="text"]:focus,
html[data-theme="dark"] input[type="number"]:focus,
html[data-theme="dark"] input[type="email"]:focus,
html[data-theme="dark"] input[type="password"]:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
    background-color: #253044 !important;
    border-color: rgba(59,130,246,0.5) !important;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(59,130,246,0.15) !important;
}

/* disabled / readonly inputs */
html[data-theme="dark"] input[disabled],
html[data-theme="dark"] input[readonly],
html[data-theme="dark"] select[disabled],
html[data-theme="dark"] textarea[readonly],
html[data-theme="dark"] textarea[disabled] {
    background-color: #0f172a !important;
    color: #64748b !important;
    opacity: 0.7 !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   8. NS JOURNAL-ENTRY PANELS & TABLES (entries/create and similar)
   These class names are used in admin.entries.create; also catches any
   other view that reuses the .ns-* naming convention.
───────────────────────────────────────────────────────────────────────── */
[data-theme="dark"] .ns-panel {
    background: #1e293b !important;
    border-color: rgba(148,163,184,0.12) !important;
    color: #cbd5e1 !important;
}
[data-theme="dark"] .ns-panel-hd {
    background: #253044 !important;
    border-bottom-color: rgba(148,163,184,0.12) !important;
    color: #e2e8f0 !important;
}
[data-theme="dark"] .ns-panel-bd { background: #1e293b !important; }

/* Table cells inside the journal entry lines grid */
[data-theme="dark"] .ns-lines-wrap tbody td {
    background: #1e293b !important;
    border-bottom-color: rgba(148,163,184,0.10) !important;
    color: #cbd5e1 !important;
}
[data-theme="dark"] .ns-lines-wrap tbody tr:nth-child(even) td { background: #253044 !important; }
[data-theme="dark"] .ns-lines-wrap tbody tr:hover td { background: rgba(59,130,246,0.07) !important; }
[data-theme="dark"] .ns-lines-wrap thead th {
    background: #0f172a !important;
    border-bottom-color: rgba(148,163,184,0.12) !important;
    color: #94a3b8 !important;
}

/* Total / diff summary rows */
[data-theme="dark"] .ns-total-row td {
    background: #253044 !important;
    color: #e2e8f0 !important;
    border-top-color: rgba(148,163,184,0.2) !important;
}
[data-theme="dark"] .ns-diff-row td {
    background: #1e293b !important;
    color: #94a3b8 !important;
}
[data-theme="dark"] .ns-diff-row td.text-danger { color: #f87171 !important; }
[data-theme="dark"] .ns-diff-row td.text-success { color: #4ade80 !important; }

/* Action add/remove row buttons inside the grid */
[data-theme="dark"] .ns-add-row-btn,
[data-theme="dark"] .ns-remove-row-btn {
    background: #253044 !important;
    border-color: rgba(148,163,184,0.2) !important;
    color: #94a3b8 !important;
}
[data-theme="dark"] .ns-add-row-btn:hover { background: rgba(59,130,246,0.15) !important; color: #60a5fa !important; }
[data-theme="dark"] .ns-remove-row-btn:hover { background: rgba(239,68,68,0.15) !important; color: #f87171 !important; }

/* ─────────────────────────────────────────────────────────────────────────
   9. SKELETON LOADERS & GLOBAL LOADER
───────────────────────────────────────────────────────────────────────── */
[data-theme="dark"] .skeleton,
[data-theme="dark"] [class*="skeleton-"] {
    background: linear-gradient(90deg, #1e293b 25%, #253044 50%, #1e293b 75%) !important;
    background-size: 200% 100% !important;
}
[data-theme="dark"] #globalLoader,
[data-theme="dark"] .global-loader { background: rgba(15,23,42,0.85) !important; }
[data-theme="dark"] #globalLoader .loader-box,
[data-theme="dark"] .global-loader .loader-box {
    background: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: rgba(148,163,184,0.12) !important;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   10. FINANCEBOARD (financeboard.blade.php)
   Page uses local :root vars; [data-theme="dark"] specificity 0-1-0
   beats :root 0-0-1, so variable overrides win without !important.
───────────────────────────────────────────────────────────────────────── */
[data-theme="dark"] {
    --bg: #0f172a;
    --card: #1e293b;
    --bd: rgba(148,163,184,0.15);
    --muted: #94a3b8;
    --ink: #e2e8f0;
    --brand: #60a5fa;
    --brand-lt: rgba(59,130,246,0.14);
    --green: #4ade80;
    --green-lt: rgba(74,222,128,0.12);
    --amber: #fbbf24;
    --amber-lt: rgba(251,191,36,0.12);
    --red: #f87171;
    --red-lt: rgba(248,113,113,0.12);
    --purple: #a78bfa;
    --purple-lt: rgba(167,139,250,0.12);

    /* stock-ledger / general semantic vars */
    --surface: #1e293b;
    --surface-dim: #253044;
    --surface-hover: rgba(148,163,184,0.08);
    --border: rgba(148,163,184,0.2);
    --border-soft: rgba(148,163,184,0.1);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);

    /* stock-ledger accent tints */
    --primary-soft: rgba(59,130,246,0.12);
    --accent-soft: rgba(74,222,128,0.10);
}

/* Hardcoded light backgrounds on fin- elements */
[data-theme="dark"] .fin-toolbar {
    background: #1e293b !important;
    border-bottom-color: rgba(148,163,184,0.12) !important;
}
[data-theme="dark"] .aging-table thead th,
[data-theme="dark"] .bank-table thead th {
    background: #0f172a !important;
    border-bottom-color: rgba(148,163,184,0.12) !important;
    color: #94a3b8 !important;
}
[data-theme="dark"] .aging-table td,
[data-theme="dark"] .bank-table td {
    border-bottom-color: rgba(148,163,184,0.08) !important;
}
[data-theme="dark"] .aging-table tbody tr:hover td,
[data-theme="dark"] .bank-table tbody tr:hover td {
    background: rgba(59,130,246,0.07) !important;
}
[data-theme="dark"] .aging-table tfoot td {
    background: #253044 !important;
    border-top-color: rgba(148,163,184,0.2) !important;
}
[data-theme="dark"] .sum-table tr { border-bottom-color: rgba(148,163,184,0.08) !important; }
[data-theme="dark"] .sum-table .divider td { background: rgba(148,163,184,0.06) !important; }

/* ─────────────────────────────────────────────────────────────────────────
   11. CASHINOUT GL (admin.cashinout.gl) — all hardcoded colours
───────────────────────────────────────────────────────────────────────── */
[data-theme="dark"] .ns-gl-card {
    background: #1e293b !important;
    border-color: rgba(148,163,184,0.15) !important;
    box-shadow: none !important;
}
[data-theme="dark"] .ns-gl-filter {
    background: linear-gradient(180deg, #253044 0%, #1e293b 100%) !important;
    border-bottom-color: rgba(148,163,184,0.12) !important;
}
[data-theme="dark"] .ns-gl-filter .form-label,
[data-theme="dark"] .ns-gl-filter .dual-calendar-container label {
    color: #94a3b8 !important;
}
[data-theme="dark"] .ns-gl-kpi {
    background: #253044 !important;
    border-color: rgba(148,163,184,0.12) !important;
}
[data-theme="dark"] .ns-gl-kpi .kpi-label { color: #94a3b8 !important; }
[data-theme="dark"] .ns-gl-kpi .kpi-value { color: #e2e8f0 !important; }
[data-theme="dark"] .ns-gl-table-wrap { border-top-color: rgba(148,163,184,0.12) !important; }
[data-theme="dark"] .ns-gl-table tbody tr:nth-child(even) td { background: #253044 !important; }
[data-theme="dark"] .ns-gl-table tfoot td {
    background: #253044 !important;
    border-top-color: rgba(148,163,184,0.2) !important;
}
[data-theme="dark"] .ns-dr { color: #f87171 !important; }
[data-theme="dark"] .ns-cr { color: #4ade80 !important; }
[data-theme="dark"] .ns-ledger-link { color: #60a5fa !important; }
[data-theme="dark"] .ns-detail-card {
    background: #1e293b !important;
    border-color: rgba(148,163,184,0.15) !important;
}
[data-theme="dark"] .ns-detail-head {
    background: #253044 !important;
    border-bottom-color: rgba(148,163,184,0.12) !important;
}
[data-theme="dark"] .ns-opening-row td { background: rgba(251,191,36,0.08) !important; }
[data-theme="dark"] .ns-detail-wrap { border-top-color: rgba(148,163,184,0.12) !important; }

/* ─────────────────────────────────────────────────────────────────────────
   12. COA INDEX & FILTERBYGROUPDETAIL (admin.coa.index / filterbygroupdetail)
───────────────────────────────────────────────────────────────────────── */
[data-theme="dark"] .coa-table thead th,
[data-theme="dark"] .coa-compact-table thead th {
    background: #1e293b !important;
    color: #94a3b8 !important;
    border-bottom-color: rgba(148,163,184,0.12) !important;
}
/* Group rows: swap #eef9f1 (light green) → dark green tint */
[data-theme="dark"] .coa-row-group {
    background: rgba(74,222,128,0.07) !important;
    color: #e2e8f0 !important;
}
/* Sub-ledger rows: swap #fafbfc → dark surface */
[data-theme="dark"] .coa-row-subledger {
    background: #253044 !important;
}
/* Sticky-position headers need z-index to stay above scrolling rows */
[data-theme="dark"] .coa-table thead th,
[data-theme="dark"] .coa-compact-table thead th { z-index: 3; }

/* ─────────────────────────────────────────────────────────────────────────
   13. HRBOARD (hrboard.blade.php & app/hrboard.blade.php)
───────────────────────────────────────────────────────────────────────── */
/* Override :root vars (specificity 0-1-0 > :root 0-0-1) */
[data-theme="dark"] {
    --hb-bg: #0f172a;
    --hb-ink: #e2e8f0;
    --hb-muted: #94a3b8;
    --hb-green: #4ade80;
    --hb-amber: #fbbf24;
    --hb-red: #f87171;
    --hb-teal: #2dd4bf;
    --hb-orange: #fb923c;
    --hb-violet: #a78bfa;
    --hb-shadow: 0 4px 24px rgba(0,0,0,0.45);
    --hb-border: rgba(148,163,184,0.12);
}

/* Hardcoded #fff / rgba(255,255,255) surfaces
   Use html[data-theme="dark"] prefix (specificity 0-2-1) so these beat
   any [data-theme="dark"] rule (0-2-0) even when both have !important */
html[data-theme="dark"] .hb-toolbar {
    background: rgba(15,23,42,0.97) !important;
    border-bottom-color: rgba(148,163,184,0.12) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4) !important;
}
html[data-theme="dark"] .hb-card {
    background: #1e293b !important;
}
html[data-theme="dark"] .hb-card-header,
html[data-theme="dark"] .hb-card-footer {
    background: #253044 !important;
}
html[data-theme="dark"] .hb-kpi {
    background: #1e293b !important;
}
[data-theme="dark"] .hb-kpi:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.5) !important; }
[data-theme="dark"] .hb-kpi-rate {
    background: #253044 !important;
    color: #94a3b8 !important;
}

/* Tabs */
html[data-theme="dark"] .hb-tab:hover {
    background: rgba(148,163,184,0.08) !important;
}
html[data-theme="dark"] .hb-tab.active {
    background: #1e293b !important;
    border-bottom-color: #1e293b !important;
}

/* Tables */
html[data-theme="dark"] .hb-table th {
    background: #0f172a !important;
    border-bottom-color: rgba(148,163,184,0.2) !important;
}
html[data-theme="dark"] .hb-table td {
    border-bottom-color: rgba(148,163,184,0.08) !important;
}
html[data-theme="dark"] .hb-table tbody tr:hover { background: rgba(59,130,246,0.06) !important; }
html[data-theme="dark"] .leave_tr:hover { background: rgba(59,130,246,0.07) !important; }

/* Person / holiday separators */
html[data-theme="dark"] .hb-person-item { border-bottom-color: rgba(148,163,184,0.10) !important; }
html[data-theme="dark"] .hb-holiday-item { border-bottom-color: rgba(148,163,184,0.10) !important; }
html[data-theme="dark"] .hb-avatar,
html[data-theme="dark"] .hb-avatar-sm { border-color: rgba(148,163,184,0.2) !important; }

/* Leave-balance progress track */
html[data-theme="dark"] .hb-bar-track { background: rgba(148,163,184,0.18) !important; }

/* Chips — swap light pastel bg for dark equivalents */
html[data-theme="dark"] .hb-chip-green { background: rgba(74,222,128,0.12) !important;  color: #4ade80 !important; }
html[data-theme="dark"] .hb-chip-amber { background: rgba(251,191,36,0.12) !important;  color: #fbbf24 !important; }
html[data-theme="dark"] .hb-chip-red   { background: rgba(248,113,113,0.12) !important; color: #f87171 !important; }
html[data-theme="dark"] .hb-chip-blue  { background: rgba(59,130,246,0.12) !important;  color: #60a5fa !important; }
html[data-theme="dark"] .hb-chip-gray  { background: rgba(148,163,184,0.10) !important; color: #94a3b8 !important; }

/* Icon wraps — inline style="background:#..." can't be recoloured
   per-value, so neutralise the bg and keep the icon's inline colour */
html[data-theme="dark"] .hb-icon-wrap,
html[data-theme="dark"] .hb-kpi-icon,
html[data-theme="dark"] .hb-quick-icon {
    background: rgba(148,163,184,0.12) !important;
}

/* Scrollbar thumb in dark */
html[data-theme="dark"] .split-col::-webkit-scrollbar-thumb {
    background: rgba(148,163,184,0.2) !important;
}
html[data-theme="dark"] .split-col::-webkit-scrollbar-thumb:hover {
    background: rgba(148,163,184,0.35) !important;
}
