/* =============================================================================
   MOMENTS BMS — moments-theme.css
   Single fully-owned theme. Replaces BOTH style.css (retired vendor theme) and
   design-system.css (absorbed override layer).

   Load order: Bootstrap 5.1.3 -> plugin CSS (select2, DataTables,
   daterangepicker, bootstrap-multiselect) -> THIS FILE (owns tokens + layout
   shell + components + plugin skins + dark mode).

   Sources of truth:
     - uiaudit/PROTOTYPE-THEME-SPEC.md  (visual contract — prototype wins)
     - uiaudit/OWN-THEME-AUDIT.md       (live-app coverage map — selectors kept)

   Layers below (in order):
     1. TOKENS
     2. LAYOUT SKELETON (header / sidebar / page-wrapper — mechanics from live,
        visuals from prototype)
     3. COMPONENT THEMING
     4. PLUGIN SKINS
     5. ABSORBED design-system.css content (.ds-* helpers — JS-referenced)
     6. PAGE-SPECIFIC (dashboard / entry forms / login / rojmed) + RESPONSIVE
   ============================================================================= */

/* =============================================================================
   1. TOKENS
   ============================================================================= */
:root {
  /* --- Brand accent (Plum) --- */
  --ds-accent: #8a3d6b;
  --ds-accent-hover: #732f58;
  --ds-accent-tint: #f5ebf1;
  --ds-on-accent: #ffffff;
  /* prototype aliases (same values) */
  --accent: var(--ds-accent);
  --accent-hover: var(--ds-accent-hover);
  --accent-tint: var(--ds-accent-tint);
  --accent-ink: var(--ds-on-accent);

  /* --- Neutrals (magenta-biased) --- */
  --ds-page: #f7f3f6;
  --ds-surface: #ffffff;
  --ds-surface-2: #fbf8fa;
  --ds-elevated: #ffffff;
  --ds-border: #ebe2e8;
  --ds-border-strong: #dcd0d8;
  --ds-ink: #241b21;
  --ds-ink-2: #574c53;
  --ds-muted: #8a7d84;

  /* --- Semantic status (fg + bg pairs) --- */
  --ds-pos: #0f7a4d;  --ds-pos-bg: #e6f4ec;
  --ds-due: #c0492f;  --ds-due-bg: #fbe9e5;
  --ds-warn: #a9640c; --ds-warn-bg: #fbf0dc;
  --ds-info: #2f6db3; --ds-info-bg: #e7f0fa;

  /* --- Sidebar palette (own dark scale, independent of light/dark theme) --- */
  --sidebar: #2a1622;
  --sidebar-2: #38202f;
  --sidebar-ink: #e9dde4;
  --sidebar-muted: #a88fa0;

  /* --- Shadow --- */
  --ds-shadow-sm: 0 1px 2px rgba(35,20,30,.06), 0 1px 3px rgba(35,20,30,.05);
  --ds-shadow-md: 0 4px 12px rgba(35,20,30,.08), 0 2px 4px rgba(35,20,30,.05);

  /* --- Type --- */
  --ds-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ds-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, monospace;

  /* --- Normalized scales (kill the 38/40/chip drift) --- */
  --ctl-h: 38px;         /* ONE control height: btn / input / select / select2 / chip */
  --ctl-h-sm: 32px;      /* dense tables/toolbars */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-pill: 20px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 14px; --fs-md: 16px; --fs-lg: 18px; --fs-xl: 22px;
}

/* --- Dark theme token block (app is light-only for now; a future toggle that
   stamps <html data-theme="dark"> just works) --- */
:root[data-theme="dark"] {
  --ds-page: #141014;
  --ds-surface: #1d171b;
  --ds-surface-2: #221a20;
  --ds-elevated: #241c22;
  --ds-border: #362b32;
  --ds-border-strong: #453742;
  --ds-ink: #f2ebef;
  --ds-ink-2: #c6b9c1;
  --ds-muted: #9c8d95;
  --ds-accent: #c874a3;
  --ds-accent-hover: #d488b3;
  --ds-accent-tint: #33202c;
  --ds-on-accent: #1a1015;
  --ds-pos: #4cc38a; --ds-pos-bg: #12281e;
  --ds-due: #f0836b; --ds-due-bg: #2e1712;
  --ds-warn: #e0a544; --ds-warn-bg: #2c2110;
  --ds-info: #6ba7e0; --ds-info-bg: #12212f;
  --sidebar: #120c10;
  --sidebar-2: #241820;
  --sidebar-ink: #ecdfe6;
  --sidebar-muted: #9d8492;
  --ds-shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --ds-shadow-md: 0 6px 18px rgba(0,0,0,.45);
}

/* --- Base typography / page --- */
body {
  font-family: var(--ds-font);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--ds-ink);
  background: var(--ds-page);
  -webkit-font-smoothing: antialiased;
}
.page-wrapper, .content { background: var(--ds-page); }
h1, h2, h3, h4, h5, .page-title { color: var(--ds-ink); font-weight: 700; letter-spacing: -.2px; }
.text-muted, small { color: var(--ds-muted) !important; }
/* tabular figures wherever money/qty line up */
td, .dataTable td, .amount, .money, .tnum { font-variant-numeric: tabular-nums; }
a { color: var(--ds-accent); }
a:hover { color: var(--ds-accent-hover); }
.text-accent { color: var(--ds-accent) !important; }
code, .code, kbd { font-family: var(--ds-mono); }

/* Global list reset (ported from retired style.css `ol, ul { list-style:none }`
   + the universal margin/padding zero). The old vendor theme stripped ALL list
   chrome by default; app markup (wordset toolbars, .total-order summary, entry
   forms) relies on it. Plugin lists re-declare their own padding on top. */
ol, ul { list-style: none; margin: 0; padding: 0; }

/* Global focus ring (prototype §5) */
:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; border-radius: var(--radius-xs); }

/* =============================================================================
   2. LAYOUT SKELETON — mechanics from live (script.js toggles), visuals from
   prototype. Structural DOM: .main-wrapper > (.header, .sidebar#sidebar,
   .page-wrapper > .content). Body toggle classes: mini-sidebar, expand-menu,
   slide-nav, nosidebar. Primary breakpoint 991.98px.
   ============================================================================= */

/* ---- Header (fixed, 60px, white) ---- */
.header {
  background: var(--ds-surface);
  border-bottom: 1px solid var(--ds-border);
  height: 60px;
  z-index: 999;
  position: fixed;
  top: 0; right: 0; left: 0;
  box-shadow: var(--ds-shadow-sm);
}
.header .header-left {
  float: left;
  height: 60px;
  position: relative;
  text-align: center;
  width: 200px;
  z-index: 1;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--ds-border);
  transition: all .2s ease;
}
.header .header-left .logo { display: inline-block; line-height: 0; }
.header .header-left .logo img { width: 140px; }
.header .header-left .logo-white, .header .header-left .logo-small { display: none; }
:root[data-theme="dark"] .header .header-left .logo-normal { display: none; }
:root[data-theme="dark"] .header .header-left .logo-white { display: inline-block; }

/* Desktop sidebar collapse control (#toggle_btn) — hamburger dot marker */
@media (min-width: 991.98px) {
  .header #toggle_btn {
    display: flex; align-items: center; justify-content: center;
    float: left; margin-left: 15px; height: 60px; cursor: pointer;
  }
  .header #toggle_btn:before {
    content: ""; width: 18px; height: 18px;
    border: 2px solid var(--ds-muted); border-radius: 20px;
  }
  .header .header-left.active #toggle_btn { position: relative; }
  .header .header-left.active #toggle_btn:after {
    content: ""; width: 6px; height: 6px; background-color: var(--ds-surface);
    border: 2px solid var(--ds-muted); border-radius: 20px;
    position: absolute; top: 6px; left: 6px;
  }
  .mini-sidebar .header-left #toggle_btn { opacity: 0; }
  .mini-sidebar .header-left #toggle_btn:after { border: 0; }
  .mini-sidebar.expand-menu .header-left #toggle_btn { opacity: 1; }
}
@media (max-width: 991.98px) {
  .header #toggle_btn { display: none; }
}

/* Mobile drawer trigger (#mobile_btn) + hamburger bars */
.header .mobile_btn { display: none; float: left; }
@media (max-width: 991.98px) {
  .header .mobile_btn {
    color: var(--ds-accent); font-size: 24px; height: 60px; line-height: 60px;
    width: 60px; z-index: 10; padding: 0 20px; position: absolute; top: 0; left: 0;
    display: block;
  }
  .header .header-left { position: absolute; width: 100%; }
  .header .header-left .logo { text-align: center; width: 100%; }
}
/* Mobile kebab user-menu (.mobile-user-menu) — desktop-hidden replacement for
   the full .user-menu (which hides <576px). Ported from retired style.css; the
   own-theme dropped it, leaking a stray blue ⋮ + caret next to the page title. */
.header .mobile-user-menu { display: none; float: right; }
.header .mobile-user-menu > a { color: var(--ds-accent); padding: 0; }
.header .mobile-user-menu > a::after { display: none; }
.header .mobile-user-menu > a i { color: var(--ds-accent); }
@media (max-width: 575px) { .header .mobile-user-menu { display: block; } }

.bar-icon { display: inline-block; width: 31px; margin-top: 20px; }
.bar-icon span {
  background-color: var(--ds-accent); display: block; float: left; height: 3px;
  margin-bottom: 7px; width: 31px; border-radius: 2px; transition: all .5s;
}
.bar-icon span:nth-child(2) { width: 16px; }
.menu-opened .slide-nav .bar-icon span:first-child { position: relative; top: 10px; transform: rotate(45deg); }
.menu-opened .slide-nav .bar-icon span:nth-child(2) { display: none; }
.menu-opened .slide-nav .bar-icon span:last-child { transform: rotate(135deg); }

/* Header page-title context (design-system: .ds-header-context / .ds-page-title) */
.ds-header-context { float: left; line-height: 60px; margin-left: 18px; }
.ds-page-title { font-weight: 700; font-size: var(--fs-md); color: var(--ds-ink); letter-spacing: -.2px; }

/* Header right cluster (theme toggle / notifications / user) */
.user-menu {
  float: right; margin: 0; position: relative; z-index: 99; padding-right: 15px;
  display: flex; align-items: center; height: 60px; list-style: none;
}
@media (max-width: 575px) { .user-menu { display: none; } }
.user-menu .dropdown-toggle::after { border: 0; display: none; }
.user-menu.nav > li > a {
  color: var(--ds-ink-2); font-size: 15px; height: 60px; padding: 0 12px;
  display: flex; align-items: center;
}
.user-menu.nav > li > a:hover { color: var(--ds-ink); }
.user-menu.nav > li > a.dropdown-toggle.nav-link.show { background: var(--ds-surface-2); border-radius: var(--radius-sm); }
.user-menu.nav > li > a .badge {
  color: #fff; font-weight: 700; position: absolute; top: 8px; right: 2px;
  background: var(--ds-due); min-width: 18px; height: 18px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center; font-size: 10px;
  border: 2px solid var(--ds-surface); padding: 0 4px;
}
.user-menu.nav > li > a i, .user-menu.nav > li > a svg { color: var(--ds-ink-2); }
/* user identity meta (design-system) */
.user-menu .nav-link.userset { display: flex; align-items: center; gap: 8px; }
.user-menu .ds-user-meta { line-height: 1.2; margin-left: 4px; }
.ds-user-meta .ds-user-name { display: block; font-size: 13px; font-weight: 600; color: var(--ds-ink); }
.ds-user-meta .ds-user-role { display: block; font-size: 11px; color: var(--ds-muted); }

/* ---- Sidebar (fixed, 200px, dark-plum rail) ---- */
.sidebar {
  background-color: var(--sidebar);
  margin-top: 0; z-index: 1001; position: fixed;
  top: 60px; bottom: 0; left: 0; width: 200px;
  border-right: 1px solid rgba(255,255,255,.06);
  transition: all .2s ease;
}
@media (max-width: 991.98px) {
  .sidebar { margin-left: -575px; transition: all .4s ease; z-index: 1041; }
}
@media (max-width: 575px) { .sidebar { width: 100%; } }
.slide-nav .sidebar { margin-left: 0; }
.sidebar .slimScrollDiv { width: 200px !important; overflow: visible !important; background: var(--sidebar); }
@media (max-width: 575px) { .sidebar .slimScrollDiv { width: 100% !important; } }
.sidebar .sidebar-menu { padding: 6px 12px; }
.sidebar .sidebar-menu > ul { list-style: none; margin: 0; padding: 0; }
.sidebar .sidebar-menu > ul > li { margin-bottom: 2px; }

/* Nav link base */
.sidebar .sidebar-menu > ul > li > a {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; position: relative;
  color: var(--sidebar-ink); transition: background-color .12s ease;
}
.sidebar .sidebar-menu > ul > li > a span { font-size: 13.5px; font-weight: 500; color: var(--sidebar-ink); }
.sidebar .sidebar-menu > ul > li > a svg,
.sidebar .sidebar-menu > ul > li > a img { width: 18px; opacity: .82; color: var(--sidebar-ink); }
.sidebar .sidebar-menu > ul > li > a img { filter: brightness(0) invert(1); }
/* submenu caret */
.sidebar .sidebar-menu > ul > li > a .menu-arrow {
  display: inline-block; font-family: "Font Awesome 5 Free"; position: absolute;
  right: 12px; top: 11px; font-size: 14px; transition: transform .2s ease; opacity: .7;
}
.sidebar .sidebar-menu > ul > li > a .menu-arrow::before { content: "\f105"; font-weight: 900; }
.sidebar .sidebar-menu > ul > li > a.subdrop .menu-arrow { transform: rotate(90deg); }
/* nav badge (Sales 12 / Products 1.4k …) */
.sidebar .sidebar-menu > ul > li > a .badge {
  margin-left: auto; background: var(--sidebar-2); color: var(--sidebar-ink);
  font-size: 11px; font-weight: 600; border-radius: var(--radius-pill); padding: 1px 8px;
}

/* Hover + active — higher specificity (.main-wrapper prefix) beats index.html's
   inline OFFICE_SIDEBAR_COLOR <style> block so the prototype gradient wins. */
.main-wrapper .sidebar .sidebar-menu > ul > li > a:hover {
  background: rgba(255,255,255,.06); color: #fff; border-radius: var(--radius-sm);
}
.main-wrapper .sidebar .sidebar-menu > ul > li > a:hover span { color: #fff; }
.main-wrapper .sidebar .sidebar-menu > ul > li > a:hover svg { opacity: 1; color: #fff; }
.main-wrapper .sidebar .sidebar-menu > ul > li > a.active,
.main-wrapper .sidebar .sidebar-menu > ul > li.active > a {
  background: linear-gradient(90deg, var(--ds-accent), #a24a80);
  color: #fff; border-radius: var(--radius-sm); box-shadow: var(--ds-shadow-sm);
}
.main-wrapper .sidebar .sidebar-menu > ul > li > a.active span,
.main-wrapper .sidebar .sidebar-menu > ul > li.active > a span { color: #fff; }
.main-wrapper .sidebar .sidebar-menu > ul > li > a.active svg,
.main-wrapper .sidebar .sidebar-menu > ul > li.active > a svg { opacity: 1; color: #fff; }
.main-wrapper .sidebar .sidebar-menu > ul > li > a.active img,
.main-wrapper .sidebar .sidebar-menu > ul > li.active > a img { opacity: 1; }
.main-wrapper .sidebar .sidebar-menu > ul > li > a.active .badge,
.main-wrapper .sidebar .sidebar-menu > ul > li.active > a .badge { background: rgba(255,255,255,.22); color: #fff; }
/* submenu list */
.sidebar .sidebar-menu > ul > li.submenu ul {
  list-style: none; background: rgba(255,255,255,.03); border-radius: var(--radius-sm);
  padding: 6px 0; margin: 2px 0 4px; display: none;
}
.sidebar .sidebar-menu > ul > li.submenu ul li a {
  display: block; padding: 7px 12px 7px 42px; font-size: 13px; color: var(--sidebar-muted);
  border-radius: var(--radius-sm);
}
.sidebar .sidebar-menu > ul > li.submenu ul li a:hover,
.sidebar .sidebar-menu > ul > li.submenu ul li a.active { color: #fff; background: rgba(255,255,255,.06); }

/* Thin custom scrollbar on the nav */
.sidebar .sidebar-menu, .sidebar-inner.slimscroll { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.16) transparent; }
.sidebar .sidebar-menu::-webkit-scrollbar, .sidebar-inner.slimscroll::-webkit-scrollbar { width: 8px; }
.sidebar .sidebar-menu::-webkit-scrollbar-track, .sidebar-inner.slimscroll::-webkit-scrollbar-track { background: transparent; }
.sidebar .sidebar-menu::-webkit-scrollbar-thumb, .sidebar-inner.slimscroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.12); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box;
}
.sidebar .sidebar-menu::-webkit-scrollbar-thumb:hover, .sidebar-inner.slimscroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.22); background-clip: padding-box; }

/* Sidebar overlay (mobile) */
.sidebar-overlay { display: none; height: 100%; width: 100%; z-index: 99; background-color: rgba(20,10,16,.5); position: fixed; top: 60px; left: 0; }
.sidebar-overlay.opened { display: block; }

/* ---- Page wrapper + content ---- */
.page-wrapper {
  margin: 0 0 0 200px; padding: 60px 0 0; position: relative; left: 0;
  transition: all .2s ease;
}
@media (max-width: 991.98px) { .page-wrapper { margin: 0; padding: 60px 0 0; } }
/* margin-inline auto: when the wrapper is wider than the 1320px cap (e.g.
   collapsed sidebar on wide screens) the content centers instead of pinning
   left with a dead band on the right */
.page-wrapper .content { padding: 22px; max-width: 1320px; width: 100%; margin-inline: auto; }
@media (max-width: 991.98px) { .page-wrapper .content { padding: 15px; } }

/* ---- Toggle mechanics: mini-sidebar / expand-menu / nosidebar (desktop) ---- */
@media (min-width: 991.98px) {
  .mini-sidebar .page-wrapper { margin-left: 80px; }
  .mini-sidebar .sidebar { width: 80px; }
  .mini-sidebar .sidebar .sidebar-menu ul li a { padding: 10px; justify-content: center; }
  .mini-sidebar .sidebar .sidebar-menu ul li a span { display: none; }
  .mini-sidebar .sidebar .sidebar-menu ul li a .menu-arrow,
  .mini-sidebar .sidebar .sidebar-menu ul li a .badge { display: none; }
  .expand-menu .sidebar { width: 200px; }
  .expand-menu .sidebar .sidebar-menu ul > li > a { padding: 8px 12px; justify-content: flex-start; }
  .expand-menu .sidebar .sidebar-menu ul > li > a span { display: inline; }
  .expand-menu .header-left { width: 200px; }
  /* collapse-crop guard: pin rail to 80px even if a stray .expand-menu hover
     class co-occurs, so sidebar width and page-wrapper margin always agree. */
  .mini-sidebar.expand-menu .sidebar { width: 80px; }
  .mini-sidebar.expand-menu .sidebar .sidebar-menu ul > li > a { padding: 10px; }
  .mini-sidebar.expand-menu .sidebar .sidebar-menu ul > li > a span { display: none; }
  .mini-sidebar .active.subdrop ~ ul { display: none !important; }
  .mini-sidebar.expand-menu .active.subdrop ~ ul { display: block !important; }
}
.nosidebar .sidebar { left: -350px; }
.nosidebar .page-wrapper { margin: 0; }

/* =============================================================================
   3. COMPONENT THEMING
   ============================================================================= */

/* ---- Buttons (base = Bootstrap; we set shape/height/accent) ---- */
.btn {
  height: var(--ctl-h);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-sm);
  font-weight: 600; font-size: 13.5px;
  box-shadow: var(--ds-shadow-sm);
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn-sm, .btn-group-sm > .btn { height: var(--ctl-h-sm); font-size: 12px; }
.btn.btn-icon, .btn-lg { height: auto; }
.btn svg, .btn img { width: 16px; height: 16px; }
.btn-primary, .btn.btn-primary,
.btn-added, .btn.btn-added,
.btn-submit, .btn-searchset, .btn.btn-submit, .btn.btn-searchset {
  background-color: var(--ds-accent) !important;
  border-color: var(--ds-accent) !important;
  color: var(--ds-on-accent) !important;
}
.btn-primary:hover, .btn-primary:focus, .btn.btn-primary:hover,
.btn-added:hover, .btn-added:focus, .btn.btn-added:hover,
.btn-submit:hover, .btn-searchset:hover, .btn.btn-submit:hover, .btn.btn-searchset:hover {
  background-color: var(--ds-accent-hover) !important;
  border-color: var(--ds-accent-hover) !important;
  color: var(--ds-on-accent) !important;
}
.btn-cancel, .btn.btn-cancel,
.btn-secondary, .btn-outline-secondary, .btn-white {
  background-color: var(--ds-surface);
  border-color: var(--ds-border-strong);
  color: var(--ds-ink);
}
.btn-cancel:hover, .btn.btn-cancel:hover,
.btn-secondary:hover, .btn-outline-secondary:hover, .btn-white:hover {
  background-color: var(--ds-surface-2); color: var(--ds-ink); border-color: var(--ds-border-strong);
}
.btn-outline-primary, .btn.btn-outline-primary {
  color: var(--ds-accent); border-color: var(--ds-accent); background: transparent; box-shadow: none;
}
.btn-outline-primary:hover, .btn-outline-primary:focus, .btn.btn-outline-primary:hover {
  background: var(--ds-accent); border-color: var(--ds-accent); color: var(--ds-on-accent);
}
.btn-ghost { background: transparent; border-color: transparent; color: var(--ds-muted); box-shadow: none; }
.btn-ghost:hover { background: var(--ds-surface-2); color: var(--ds-ink); }
.btn-success { background-color: var(--ds-pos); border-color: var(--ds-pos); color: #fff; }
.btn-danger  { background-color: var(--ds-due); border-color: var(--ds-due); color: #fff; }
.btn-warning { background-color: var(--ds-warn); border-color: var(--ds-warn); color: #fff; }
/* row-action icon buttons (edit/lock/delete) render as .btn-outline-dark */
.btn-outline-dark { color: var(--ds-ink-2); border-color: var(--ds-border-strong); background: var(--ds-surface); }
.btn-outline-dark:hover { background: var(--ds-accent-tint); color: var(--ds-accent); border-color: var(--ds-accent); }
.btn:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
/* .page-header inline add/filter buttons */
.page-header .btn-added { background: var(--ds-accent); color: #fff; font-weight: 600; }
.page-header .btn-added img { filter: brightness(0) invert(1); }
.page-header .btn-added:hover { background: var(--ds-accent-hover); }

/* ---- Cards / panels ---- */
.card, .white-box, .dash-widget, .card-body { border-radius: var(--radius); }
.card {
  border: 1px solid var(--ds-border);
  box-shadow: var(--ds-shadow-sm);
  background: var(--ds-surface);
  margin-bottom: 20px;
}
.card .card-header, .card-header {
  background: var(--ds-surface); border-bottom: 1px solid var(--ds-border);
  font-weight: 600; padding: 16px 18px;
}
.card .card-body { padding: 18px; }
@media (max-width: 991.98px) { .card .card-body { padding: 15px; } }
.card .card-title, .card-title { font-size: var(--fs-lg); font-weight: 700; color: var(--ds-ink); margin: 0 0 12px; }

/* ---- Forms / inputs (recessed surface-2, raise on focus) ---- */
.form-control, .form-select,
.select2-container--default .select2-selection--single {
  height: var(--ctl-h);
  border-radius: var(--radius-sm);
  border: 1px solid var(--ds-border-strong);
  color: var(--ds-ink);
  background-color: var(--ds-surface-2);
  font-size: 13.5px;
}
textarea.form-control { height: auto; min-height: var(--ctl-h); }
.form-control:focus, .form-select:focus {
  border-color: var(--ds-accent);
  background-color: var(--ds-surface);
  box-shadow: 0 0 0 3px var(--ds-accent-tint);
  outline: none;
}
.form-control::placeholder { color: var(--ds-muted); }
.form-control:disabled, .form-control[readonly] { color: var(--ds-muted); background-color: var(--ds-surface-2); }
/* Bare .form-group inputs (no .form-control class) — entry-row fields on
   add-sales / add-purchase / quotation (#item_stock_input, #item_qty_input,
   Base/Total Price, etc.). Ported from retired style.css `.form-group
   input[type=text]{width:100%}`; without a width they overflow their narrow
   Bootstrap columns and overlap the plum + button. */
.form-group input[type=text],
.form-group input[type=password] {
  width: 100%;
  height: var(--ctl-h);
  border: 1px solid var(--ds-border-strong);
  border-radius: var(--radius-sm);
  background-color: var(--ds-surface-2);
  color: var(--ds-ink);
  font-size: 13.5px;
  padding: 0 12px;
}
.form-group input[type=text]:focus,
.form-group input[type=password]:focus {
  border-color: var(--ds-accent); background-color: var(--ds-surface);
  box-shadow: 0 0 0 3px var(--ds-accent-tint); outline: none;
}
.form-group input[type=text]:disabled,
.form-group input[type=text][readonly] { color: var(--ds-muted); background-color: var(--ds-surface-2); }
label, .col-form-label { color: var(--ds-ink-2); font-weight: 600; font-size: 13px; }
.form-label { color: var(--ds-ink-2); font-weight: 600; }
/* required marker */
.form-label .required, label .required, .text-danger.required { color: var(--ds-due); }
/* native checkbox/radio accent (except CSS switch) */
input[type="checkbox"]:not(.ds-switch-input), input[type="radio"] { accent-color: var(--ds-accent); }
.form-check-input:checked { background-color: var(--ds-accent); border-color: var(--ds-accent); }

/* ---- Tables ---- */
.table, table.dataTable { color: var(--ds-ink); }
table.dataTable thead th, .table thead th {
  text-transform: uppercase; letter-spacing: .5px; font-size: 11.5px; font-weight: 600;
  color: var(--ds-muted); background: var(--ds-surface-2);
  border-bottom: 1px solid var(--ds-border) !important; white-space: nowrap;
  padding: 11px 15px;
}
table.dataTable tbody td, .table td, .table tbody td {
  border-top: 1px solid var(--ds-border); vertical-align: middle; padding: 12px 15px; font-size: 13.5px;
}
table.dataTable tbody tr:hover, .table-hover tbody tr:hover, .table tbody tr:hover { background-color: var(--ds-surface-2); }
.table.mini td, table.mini td { padding: 10px 12px; font-size: 13px; }
.table.mini th, table.mini th { padding: 8px 12px; background: transparent; }
/* totals row */
tfoot td, tfoot th, .footer-total { background: var(--ds-surface-2); font-weight: 700; border-top: 2px solid var(--ds-border-strong); }
/* avatar cell (design-system .ds-cust) styled in layer 5 */

/* ---- Pagination (Bootstrap + DataTables unified, quiet Plum pills) ---- */
.pagination li a, .pagination li a.page-link, .page-link,
.dt-paging .dt-paging-button, .paginate_button {
  color: var(--ds-ink-2) !important; background: var(--ds-surface) !important;
  border: 1px solid var(--ds-border) !important; border-radius: var(--radius-sm) !important;
  box-shadow: none !important; min-width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center; margin: 0 2px;
}
.pagination li a:hover, .page-link:hover, .dt-paging .dt-paging-button:hover, .paginate_button:hover {
  background: var(--ds-surface-2) !important; border-color: var(--ds-border-strong) !important; color: var(--ds-ink) !important;
}
.pagination li.active a, .pagination li.active a.page-link, .page-item.active .page-link,
.dt-paging .dt-paging-button.current, .paginate_button.active > a, .paginate_button.current {
  background: var(--ds-accent) !important; border-color: var(--ds-accent) !important; color: #fff !important;
}
.page-item.disabled .page-link, .paginate_button.disabled { color: var(--ds-muted) !important; background: var(--ds-surface-2) !important; }

/* ---- Badges / pills — ONE system (prototype .pill). Bootstrap .badge maps in;
   POS .badges (min-width:80px) retired. ---- */
.badge { border-radius: var(--radius-pill); font-weight: 600; padding: 3px 9px; font-size: 12px; }
.badge-success, .badge.bg-success, .status-paid { color: var(--ds-pos); background: var(--ds-pos-bg); }
.badge-danger,  .badge.bg-danger,  .status-overdue { color: var(--ds-due); background: var(--ds-due-bg); }
.badge-warning, .badge.bg-warning, .status-partial { color: var(--ds-warn); background: var(--ds-warn-bg); }
.badge-info,    .badge.bg-info { color: var(--ds-info); background: var(--ds-info-bg); }
/* retire the POS badge look — fold into the pill language */
.badges { font-size: 12px; padding: 3px 9px; border-radius: var(--radius-pill); min-width: 0; font-weight: 600; }

/* ---- Alerts ---- */
.alert { border-radius: var(--radius-sm); border: 1px solid transparent; }
.alert-success { color: var(--ds-pos); background: var(--ds-pos-bg); border-color: var(--ds-pos-bg); }
.alert-danger  { color: var(--ds-due); background: var(--ds-due-bg); border-color: var(--ds-due-bg); }
.alert-warning { color: var(--ds-warn); background: var(--ds-warn-bg); border-color: var(--ds-warn-bg); }
.alert-info    { color: var(--ds-info); background: var(--ds-info-bg); border-color: var(--ds-info-bg); }

/* ---- Modals ---- */
.modal-content { background: var(--ds-surface); color: var(--ds-ink); border: 1px solid var(--ds-border); border-radius: var(--radius); box-shadow: var(--ds-shadow-md); }
.modal-header { border-bottom: 1px solid var(--ds-border); padding: 18px 20px; }
.modal-header .modal-title { font-weight: 700; color: var(--ds-ink); font-size: 17px; letter-spacing: -.2px; }
.modal-body { padding: 18px 20px; }
.modal-footer { border-top: 1px solid var(--ds-border); background: var(--ds-surface-2); border-radius: 0 0 var(--radius) var(--radius); padding: 14px 20px; display: flex; justify-content: flex-end; gap: 8px; }
/* close "×": quiet neutral, not alarm-red */
.modal .close, .modal-header .close, .modal .btn-close, .modal-header .btn-close {
  color: var(--ds-muted); opacity: 1; text-shadow: none; background: none; border: 0; cursor: pointer;
}
.modal .close:hover, .modal-header .close:hover, .modal .btn-close:hover { color: var(--ds-due); opacity: 1; }
.modal .close span { color: inherit; }
.modal-backdrop.show { background: rgba(20,10,16,.5); }

/* ---- Right-side drawer variant (.modal.ds-drawer) ---- */
.modal.ds-drawer .modal-dialog {
  position: fixed; top: 0; right: 0; bottom: 0; margin: 0;
  width: 560px; max-width: 94vw; height: 100%; display: flex;
}
.modal.ds-drawer.fade .modal-dialog { transform: translateX(100%); transition: transform .28s ease-out; }
.modal.ds-drawer.show .modal-dialog { transform: none; }
.modal.ds-drawer .modal-content { height: 100%; width: 100%; border-radius: var(--radius) 0 0 var(--radius); display: flex; flex-direction: column; border-right: 0; }
.modal.ds-drawer .modal-body { overflow-y: auto; flex: 1 1 auto; padding-bottom: 28px; }
.modal.ds-drawer .modal-header, .modal.ds-drawer .modal-footer { flex-shrink: 0; }
.modal.ds-drawer.ds-drawer-lg .modal-dialog { width: 780px; }
.modal.ds-drawer .modal-body .card { border: 0; box-shadow: none; }
/* drawer header subtitle + sectioned body */
.modal.ds-drawer .modal-header .modal-title-wrap { display: flex; flex-direction: column; gap: 2px; }
.modal.ds-drawer .modal-subtitle { font-size: 12.5px; color: var(--ds-muted); font-weight: 500; line-height: 1.3; }
.ds-dsection { border: 1px solid var(--ds-border); border-radius: 10px; padding: 14px 14px 2px; margin-bottom: 14px; background: var(--ds-surface); }
.ds-dsection > .ds-dh { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 700; font-size: 13px; color: var(--ds-ink); }
.ds-dsection > .ds-dh .ds-req { color: var(--ds-due); font-weight: 700; }
.ds-dsection > .ds-dh .ds-hint { margin-left: auto; font-weight: 500; font-size: 11.5px; color: var(--ds-muted); }

/* ---- Audit timeline (.ds-timeline, sales edit history) ----
   Three columns: when | rail | what. The rail is drawn on the marker cell so
   the connecting line inherits the row height and closes itself on the last
   entry, rather than needing a fixed height or a trailing element. */
.ds-tl { list-style: none; margin: 0; padding: 0; }
.ds-tl-entry { display: grid; grid-template-columns: 76px 26px 1fr; column-gap: 4px; }
.ds-tl-when { text-align: right; padding-top: 2px; line-height: 1.25; }
.ds-tl-time { display: block; font-size: 12.5px; font-weight: 700; color: var(--ds-ink); font-variant-numeric: tabular-nums; }
.ds-tl-date { display: block; font-size: 11px; color: var(--ds-muted); font-variant-numeric: tabular-nums; }

.ds-tl-marker { position: relative; }
.ds-tl-marker::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: -2px;
  width: 2px; margin-left: -1px; background: var(--ds-border);
}
.ds-tl-entry:last-child .ds-tl-marker::before { bottom: auto; height: 18px; }
.ds-tl-dot {
  position: absolute; left: 50%; top: 5px; width: 11px; height: 11px;
  margin-left: -5.5px; border-radius: 50%; background: var(--ds-surface);
  border: 2px solid var(--ds-muted); z-index: 1;
}
.ds-tl-created .ds-tl-dot { border-color: var(--ds-pos); }
.ds-tl-updated .ds-tl-dot { border-color: var(--ds-accent); }
.ds-tl-deleted .ds-tl-dot { border-color: var(--ds-due); }

.ds-tl-body { padding: 0 0 20px 4px; min-width: 0; }
.ds-tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.ds-tl-title { font-weight: 700; font-size: 13.5px; color: var(--ds-ink); }
.ds-tl-actor { font-size: 12px; color: var(--ds-muted); }

.ds-tl-fields, .ds-tl-items { list-style: none; margin: 0 0 6px; padding: 0; }
.ds-tl-fields > li, .ds-tl-items > li {
  font-size: 12.5px; color: var(--ds-ink-2); padding: 3px 0; line-height: 1.5;
}
.ds-tl-items > li { border-top: 1px dashed var(--ds-border); padding: 5px 0; }
.ds-tl-field { display: inline-block; min-width: 104px; color: var(--ds-muted); font-weight: 600; }
.ds-tl-item { font-weight: 600; color: var(--ds-ink); }
.ds-tl-type {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ds-muted); background: var(--ds-surface-2);
  border: 1px solid var(--ds-border); border-radius: 4px; padding: 0 4px; margin-left: 2px;
}
.ds-tl-old { color: var(--ds-muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.ds-tl-new { color: var(--ds-ink); font-weight: 600; }
.ds-tl-add { color: var(--ds-pos); font-weight: 700; }
.ds-tl-remove { color: var(--ds-due); font-weight: 700; }
.ds-tl-modify { color: var(--ds-accent); font-weight: 700; }
.ds-tl-reason {
  font-size: 12.5px; color: var(--ds-ink-2); background: var(--ds-due-bg);
  border-radius: 8px; padding: 8px 10px; margin-bottom: 6px;
}

/* The derived discount band reuses the shared .ds-pill vocabulary (pos/warn/due/
   muted, defined below and in design-system.css) rather than defining its own:
   the same band must read the same colour here as on the sales entry row. */
.ds-tl .ds-pill { font-size: 10.5px; padding: 1px 8px; vertical-align: 1px; }

@media (max-width: 575.98px) {
  .ds-tl-entry { grid-template-columns: 60px 22px 1fr; }
  .ds-tl-field { min-width: 0; margin-right: 6px; }
}

/* ---- Dropdown menus (notifications, user menu, actions) ---- */
.dropdown-menu { background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--radius-sm); box-shadow: var(--ds-shadow-md); }
.dropdown-item { color: var(--ds-ink-2); }
.dropdown-item:hover { background-color: var(--ds-surface-2); color: var(--ds-ink); }
.dropdown-item:active, .dropdown-item.active { background-color: var(--ds-accent); color: var(--ds-on-accent); }
.header .dropdown-menu { box-shadow: var(--ds-shadow-md); border: 1px solid var(--ds-border); }
/* notifications dropdown chrome */
.topnav-dropdown-header { border-bottom: 1px solid var(--ds-border); padding: 12px 15px; }
.notification-title { font-weight: 700; color: var(--ds-ink); }
.clear-noti { color: var(--ds-accent); font-size: 12px; }
.noti-content { max-height: 320px; overflow-y: auto; }
/* profile menu */
.menu-drop-user .profilename .profileset { display: flex; align-items: center; gap: 10px; padding: 12px 15px; }
.profilesets h6 { margin: 0; font-size: 13px; font-weight: 700; color: var(--ds-ink); }
.profilesets h5 { margin: 0; font-size: 12px; color: var(--ds-muted); }

/* ---- Tabs / segmented control + count badges ---- */
.nav-tabs { border-bottom: 1px solid var(--ds-border); }
.nav-tabs .nav-link { color: var(--ds-ink-2); font-weight: 600; border: 0; }
.nav-tabs .nav-link.active { color: var(--ds-accent); border-bottom: 2px solid var(--ds-accent); background: transparent; }
.nav-pills .nav-link.active { background-color: var(--ds-accent); color: var(--ds-on-accent); border-radius: var(--radius-sm); }
.ds-status-tabs { margin-bottom: 12px; }
.ds-status-tabs .ds-tab-count {
  display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 5px;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  border-radius: 10px; background: var(--ds-accent-tint); color: var(--ds-accent);
  font-variant-numeric: tabular-nums;
}
.ds-status-tabs .ds-tab-count:empty { display: none; }

/* ---- Switch (ds-switch, shimmed by ds-switch.js) ---- */
input.ds-switch-input[type="checkbox"] {
  -webkit-appearance: none; appearance: none;
  width: 44px; height: 24px; flex: 0 0 44px; margin: 0; padding: 0;
  border: 0; border-radius: 999px; background: var(--ds-border-strong);
  position: relative; cursor: pointer; vertical-align: middle;
  transition: background-color .15s ease; box-shadow: none;
}
input.ds-switch-input[type="checkbox"]::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s ease;
}
input.ds-switch-input[type="checkbox"]:checked { background: var(--ds-accent); }
input.ds-switch-input[type="checkbox"]:checked::after { left: 22px; }
input.ds-switch-input[type="checkbox"]:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
input.ds-switch-input[type="checkbox"]:disabled { opacity: .5; cursor: not-allowed; }
.ds-switch-label { margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--ds-ink-2); vertical-align: middle; }

/* ---- Toasts (design-system feedback.js) ---- */
.ds-toaster { position: fixed; top: 16px; right: 16px; z-index: 12000; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; max-width: calc(100vw - 32px); }
.ds-toast { pointer-events: auto; min-width: 250px; max-width: 380px; background: var(--ds-elevated); color: var(--ds-ink); padding: 11px 11px 11px 13px; border-radius: 11px; font-size: 13px; font-weight: 500; box-shadow: var(--ds-shadow-md); border: 1px solid var(--ds-border); border-left: 3px solid var(--ds-muted); display: flex; align-items: flex-start; gap: 10px; animation: ds-toastin .18s cubic-bezier(.2,.8,.2,1); }
.ds-toast .ti { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--ds-muted); }
.ds-toast .tmsg { flex: 1; line-height: 1.4; }
.ds-toast .tmsg b { font-weight: 700; }
.ds-toast .tx { background: none; border: 0; color: var(--ds-muted); cursor: pointer; padding: 2px; width: 20px; height: 20px; flex: none; border-radius: 5px; display: grid; place-items: center; }
.ds-toast .tx:hover { background: var(--ds-surface-2); color: var(--ds-ink); } .ds-toast .tx svg { width: 14px; height: 14px; }
.ds-toast.success { border-left-color: var(--ds-pos); } .ds-toast.success .ti { color: var(--ds-pos); }
.ds-toast.error   { border-left-color: var(--ds-due); } .ds-toast.error .ti { color: var(--ds-due); }
.ds-toast.warning { border-left-color: var(--ds-warn); } .ds-toast.warning .ti { color: var(--ds-warn); }
.ds-toast.info    { border-left-color: var(--ds-info); } .ds-toast.info .ti { color: var(--ds-info); }
.ds-toast.leaving { animation: ds-toastout .16s forwards; }
@keyframes ds-toastin { from { opacity: 0; transform: translateX(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ds-toastout { to { opacity: 0; transform: translateX(14px); } }

/* ---- Avatars (one size, flex-centered; drop line-height mismatch) ---- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; color: #fff; font-weight: 600; text-transform: uppercase;
  vertical-align: middle; position: relative; white-space: nowrap; margin: 0 10px 0 0; border-radius: 50%;
}
.avatar.avatar-xs { width: 24px; height: 24px; }
.avatar-sm { width: 40px; height: 40px; }
.avatar-lg { width: 60px; height: 60px; }
.avatar-xl { width: 80px; height: 80px; }
.avatar > img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar .avatar-title {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; background-color: var(--ds-accent); color: #fff; font-size: 14px; border-radius: inherit;
}
.avatar .avatar-title.rounded, .avatar-title.rounded { border-radius: var(--radius-xs) !important; }
.avatar.avatar-online::before, .avatar.avatar-offline::before, .avatar.avatar-away::before {
  width: 25%; height: 25%; border-radius: 50%; content: ""; border: 2px solid var(--ds-surface);
  position: absolute; right: 0; bottom: 0;
}
.avatar.avatar-online::before { background-color: var(--ds-pos); }
.avatar.avatar-offline::before { background-color: var(--ds-due); }
.avatar.avatar-away::before { background-color: var(--ds-warn); }
.status.online { width: 10px; height: 10px; border-radius: 50%; background: var(--ds-pos); display: inline-block; }

/* ---- Page header + list toolbar ---- */
.page-header { margin-bottom: 18px; }
.page-header h3, .page-header h4 { font-weight: 700; color: var(--ds-ink); font-size: 22px; letter-spacing: -.4px; margin: 0; }
.page-header h6 { font-size: 13px; color: var(--ds-muted); font-weight: 500; margin: 3px 0 0; }
.page-title h4 { font-size: 22px; font-weight: 700; letter-spacing: -.4px; margin: 0; color: var(--ds-ink); }
.page-title .page-meta { margin: 3px 0 0; font-size: 13px; color: var(--ds-muted); font-variant-numeric: tabular-nums; }
.page-title .page-meta b { color: var(--ds-ink-2); font-weight: 700; }
.page-title h6 { font-size: 13px; font-weight: 500; color: var(--ds-muted); margin: 3px 0 0; }
.table-top { margin-bottom: 18px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
@media (max-width: 575px) { .table-top { flex-direction: column; align-items: stretch; } }
/* search box */
.search-set .search-input { position: relative; }
.search-set .search-input input[type=search] {
  background: var(--ds-surface-2); height: var(--ctl-h); border: 1px solid var(--ds-border-strong);
  width: 200px; border-radius: var(--radius-sm); padding: 0 15px 0 38px; color: var(--ds-ink); font-size: 13px;
}
.search-set .search-input input[type=search]:focus { border-color: var(--ds-accent); background: var(--ds-surface); box-shadow: 0 0 0 3px var(--ds-accent-tint); outline: none; }
.search-set .search-input .btn-searchset { padding: 2px; border-radius: 50px; position: absolute; top: 9px; left: 10px; background: transparent !important; border: 0 !important; box-shadow: none !important; color: var(--ds-muted) !important; }
.search-set { align-items: center; }
/* wordset (export + page-size cluster, retire ruby hack). Not always inside
   .table-top (customer list nests it in a bare .row / col-md-4), so the row
   layout must be unscoped or it collapses to a bulleted vertical stack. */
.wordset { display: flex; align-items: center; justify-content: flex-end; }
.table-top .wordset { margin-left: auto; }
.wordset ul { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.wordset ul li { margin: 0; }
.wordset ul li .btn { white-space: nowrap; }
/* page-size <select> (DataTables length control appended into .page-dropdown)
   is a full-width .form-control by default (~338px); make it a compact chip. */
.wordset .page-dropdown, .wordset .cdf-page-dropdown { display: inline-flex; align-items: center; }
.wordset .page-dropdown select, .wordset .cdf-page-dropdown select,
.wordset select[name$="_length"] {
  width: auto; min-width: 64px; max-width: 80px; padding: 0 8px; text-align: center;
}

/* ---- Filter-bar (.ds-filterbar) uniform chips ---- */
.ds-filterbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ds-filterbar .search-input input[type=search],
.ds-filterbar input.form-control-sm,
.ds-filterbar select.form-select-sm,
.ds-filterbar #date_time_filter,
.ds-filterbar .dataTables_filter-1 select,
.ds-filterbar > div > .btn,
.ds-filterbar .btn.btn-sm {
  height: var(--ctl-h); border-radius: var(--radius-sm);
}
.ds-filterbar #date_time_filter { display: inline-flex; align-items: center; gap: 6px; }
.ds-filterbar > div > .btn, .ds-filterbar .btn.btn-sm { display: inline-flex; align-items: center; justify-content: center; }
.ds-filterbar select.form-select-sm,
.ds-filterbar #date_time_filter,
.ds-filterbar input.form-control-sm,
.ds-filterbar .search-input input[type=search] {
  background-color: var(--ds-surface-2); border: 1px solid var(--ds-border); border-radius: var(--radius-pill);
  color: var(--ds-ink-2); font-size: 12.5px;
}
.ds-filterbar select.form-select-sm { padding-left: 14px; }
.ds-filterbar .search-input input[type=search] { padding-left: 38px; border-radius: var(--radius-pill); }
.ds-filterbar select.form-select-sm:hover,
.ds-filterbar #date_time_filter:hover,
.ds-filterbar input.form-control-sm:hover,
.ds-filterbar .search-input input[type=search]:hover { border-color: var(--ds-border-strong); background-color: var(--ds-surface); }
.ds-filterbar select.form-select-sm:focus,
.ds-filterbar input.form-control-sm:focus,
.ds-filterbar .search-input input[type=search]:focus { border-color: var(--ds-accent); background-color: var(--ds-surface); box-shadow: 0 0 0 3px var(--ds-accent-tint); }
.ds-filterbar .btn.btn-sm, .ds-filterbar > div > .btn { border-radius: var(--radius-pill); }
.ds-filterbar .dt-page-length, .ds-filterbar .page-dropdown { margin-left: auto; }
/* Products has many filters and wraps to 2 rows; keep the page-size chip inline
   with the search/reset cluster (no orphaned far-right float on the 2nd row). */
.ds-filterbar .page-length { margin-left: 0; }

/* ---- Tooltip (Bootstrap) + infotip ---- */
.tooltip-inner { background: var(--ds-ink); color: var(--ds-surface); font-size: 11.5px; border-radius: var(--radius-xs); }
.infotip { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--ds-surface-2); border: 1px solid var(--ds-border); color: var(--ds-muted); font-size: 10.5px; font-weight: 700; cursor: help; }
.infotip:hover { color: var(--ds-accent); border-color: var(--ds-accent); }

/* ---- Notes / helper strips ---- */
.note, .ds-note { color: var(--ds-muted); font-size: 12.5px; display: flex; gap: 8px; align-items: flex-start; }

/* =============================================================================
   4. PLUGIN SKINS
   ============================================================================= */

/* ---- select2 (height unified to --ctl-h — fixes the 40 vs 38 mismatch) ---- */
.select2-container { min-width: 100% !important; width: auto !important; z-index: 99; }
span.select2-container.select2-container--default.select2-container--open { z-index: 9999; }
.select2-container .select2-selection--single { height: var(--ctl-h); }
.select2-container--default .select2-selection--single {
  border: 1px solid var(--ds-border-strong); border-radius: var(--radius-sm); background-color: var(--ds-surface-2);
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--ds-ink); line-height: var(--ctl-h); padding-left: 12px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow { height: var(--ctl-h); right: 8px; }
.select2-container--default .select2-selection--single .select2-selection__arrow b {
  position: absolute; top: 50%; left: 50%; border-color: var(--ds-muted); border-style: solid;
  border-width: 0 2px 2px 0; padding: 3px; height: 0; width: 0; margin-left: -10px; margin-top: -3px;
  transform: rotate(45deg) translateY(-50%);
}
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  border-color: var(--ds-accent); border-width: 2px 0 0 2px; margin-top: 3px;
}
.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single { background: var(--ds-surface) !important; border-color: var(--ds-accent); }
.select2-container--default .select2-selection--multiple { border: 1px solid var(--ds-border-strong); border-radius: var(--radius-sm); background-color: var(--ds-surface-2); min-height: var(--ctl-h); }
.select2-container--default .select2-selection--multiple .select2-selection__choice { background-color: var(--ds-accent-tint); border-color: var(--ds-accent); color: var(--ds-ink); border-radius: var(--radius-xs); }
/* dropdown panel */
.select2-dropdown { background: var(--ds-surface); border-color: var(--ds-border-strong); border-radius: var(--radius-sm); box-shadow: var(--ds-shadow-md); overflow: hidden; }
.select2-container--default .select2-search--dropdown .select2-search__field { border-radius: var(--radius-sm); border-color: var(--ds-border-strong); background: var(--ds-surface-2); color: var(--ds-ink); }
.select2-container--default .select2-search--dropdown .select2-search__field:focus { border-color: var(--ds-accent); outline: none; }
.select2-container--default .select2-results__option { color: var(--ds-ink); }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background-color: var(--ds-accent); color: #fff; }
.select2-container--default .select2-results__option--selected,
.select2-container--default .select2-results__option[aria-selected="true"] { background: var(--ds-accent-tint); color: var(--ds-ink); }

/* ---- DataTables (wrapper, length, info, filter, buttons) ---- */
.dataTables_wrapper, .dt-container { min-width: 0; font-size: 14px; color: var(--ds-ink); }
.dataTables_length, .dt-length, .dataTables_info, .dt-info { color: var(--ds-ink-2); font-size: 13px; }
.dataTables_length select, .dt-length select,
.dataTables_filter input, .dt-search input {
  height: var(--ctl-h); border: 1px solid var(--ds-border-strong); border-radius: var(--radius-sm);
  background: var(--ds-surface-2); color: var(--ds-ink); padding: 0 10px;
}
.dataTables_filter input:focus, .dt-search input:focus { border-color: var(--ds-accent); background: var(--ds-surface); box-shadow: 0 0 0 3px var(--ds-accent-tint); outline: none; }
table.dataTable { width: 100% !important; border-collapse: collapse; }
table.dataTable td { white-space: normal; word-wrap: break-word; }
/* DataTables Buttons (export/print) */
.dt-buttons .dt-button, .dt-button, div.dt-buttons > .btn {
  height: var(--ctl-h); border-radius: var(--radius-sm); background: var(--ds-surface);
  border: 1px solid var(--ds-border-strong); color: var(--ds-ink); font-weight: 600; font-size: 13px;
  box-shadow: var(--ds-shadow-sm); display: inline-flex; align-items: center;
}
.dt-buttons .dt-button:hover, .dt-button:hover { background: var(--ds-surface-2); color: var(--ds-ink); }

/* ---- Sticky ACTION column (last col pinned right) ---- */
.table-responsive { overflow-x: auto; max-width: 100%; }
.table-responsive.row, .dataTables_wrapper, .dt-container { min-width: 0; }
.card:has(.table-responsive), .card-body:has(.table-responsive) { min-width: 0; }
.table-responsive table > thead > tr > th:last-child,
.table-responsive table > tbody > tr > td:last-child,
.table-responsive table > tfoot > tr > th:last-child {
  position: sticky; right: 0;
  /* opaque backing for the pinned cell; Bootstrap's stripe/hover overlay
     (inset 0 0 0 9999px accent box-shadow) still paints on top so the striping
     runs seamlessly through. A single left border is the only separator — the
     old -7px drop-shadow clobbered the overlay and left a white band. */
  background-color: var(--ds-surface);
  border-left: 1px solid var(--ds-border);
}
.table-responsive table > tbody > tr > td:last-child { z-index: 1; }
.table-responsive table > thead > tr > th:last-child { z-index: 2; background-color: var(--ds-surface-2); }
.table-responsive table > tfoot > tr > th:last-child { z-index: 1; background-color: var(--ds-surface-2); }

/* Numeric / currency cells must not wrap mid-value ("₹" on its own line). List
   tables render currency in plain <td>; default them to nowrap but let the
   name/avatar cell (.ds-cust) keep wrapping long company names. Beats the
   inline `table.dataTable td{white-space:normal}` block in index.html by
   specificity. */
.table-responsive table > tbody > tr > td { white-space: nowrap; }
.table-responsive table > tbody > tr > td:has(.ds-cust) { white-space: normal; }
/* Row-action icon buttons stay one horizontal row (JS emits .d-flex.flex-wrap). */
.table-responsive table > tbody > tr > td:last-child .d-flex.flex-wrap { flex-wrap: nowrap !important; }

/* ---- bootstrap-multiselect panel ---- */
.multiselect-container.dropdown-menu { border-color: var(--ds-border-strong); border-radius: var(--radius-sm); box-shadow: var(--ds-shadow-md); padding: 5px; }
.multiselect-container .multiselect-search, .multiselect-container input.multiselect-search { border-radius: var(--radius-sm); border-color: var(--ds-border-strong); background: var(--ds-surface-2); }
.multiselect-container li a, .multiselect-container .multiselect-option { border-radius: 6px; padding: 5px 10px; }
.multiselect-container li a:hover, .multiselect-container li.active a, .multiselect-container .multiselect-option:hover { background: var(--ds-surface-2); }
.btn-group .multiselect.btn { height: var(--ctl-h); background: var(--ds-surface-2); border: 1px solid var(--ds-border-strong); color: var(--ds-ink); border-radius: var(--radius-sm); }

/* ---- Searchable multi-select toolbar filters (bootstrap-multiselect) ----
   The CLOSED control must read exactly like a .ds-filterbar chip: fixed 38px
   height, pill-ish radius, surface-2, and — critically — a FIXED width so the
   summary text ("All customers" -> "3 selected") never resizes the chip and
   never reflows its neighbours. The chip only ever shows a summary; the search
   input lives inside the panel (themed above). */
.ds-filterbar .ds-ms-group { display: inline-block; vertical-align: middle; }
.ds-filterbar .ds-ms-group .ds-ms-btn,
.ds-filterbar .ds-ms-group button.multiselect {
  height: var(--ctl-h);
  width: 160px;
  display: inline-flex;
  align-items: center;
  padding: 0 28px 0 14px;
  background: var(--ds-surface-2);
  border: 1px solid var(--ds-border-strong);
  border-radius: var(--radius-sm);
  color: var(--ds-ink);
  font-size: 13px;
  text-align: left;
  position: relative;
  white-space: nowrap;
  box-shadow: none;
}
.ds-filterbar .ds-ms-group .ds-ms-btn:hover { border-color: var(--ds-border-strong); background: var(--ds-surface); }
.ds-filterbar .ds-ms-group .ds-ms-btn:focus,
.ds-filterbar .ds-ms-group.open .ds-ms-btn { border-color: var(--ds-accent); background: var(--ds-surface); box-shadow: 0 0 0 3px var(--ds-accent-tint); outline: none; }
.ds-filterbar .ds-ms-group .ds-ms-btn .multiselect-selected-text {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%;
}
.ds-filterbar .ds-ms-group .ds-ms-btn .caret {
  position: absolute; right: 12px; top: 50%; margin-top: -2px;
  border-top-color: var(--ds-muted);
}
.ds-filterbar .ds-ms-group .multiselect-container { min-width: 220px; }

/* ---- daterangepicker ---- */
.daterangepicker { background: var(--ds-surface); border-color: var(--ds-border); border-radius: var(--radius-sm); box-shadow: var(--ds-shadow-md); font-family: var(--ds-font); }
.daterangepicker .calendar-table { background: var(--ds-surface); border-color: var(--ds-surface); }
.daterangepicker td.available:hover, .daterangepicker th.available:hover { background: var(--ds-surface-2); }
.daterangepicker td.active, .daterangepicker td.active:hover { background: var(--ds-accent); color: #fff; }
.daterangepicker td.in-range { background: var(--ds-accent-tint); color: var(--ds-ink); }
.daterangepicker .ranges li.active { background: var(--ds-accent); color: #fff; }
.daterangepicker .drp-buttons .btn { height: var(--ctl-h-sm); }

/* ---- ApexCharts container ---- */
.apexcharts-canvas { width: 100% !important; }
.apexcharts-tooltip { background: var(--ds-surface) !important; border-color: var(--ds-border) !important; color: var(--ds-ink) !important; box-shadow: var(--ds-shadow-md) !important; }
.apexcharts-tooltip-title { background: var(--ds-surface-2) !important; border-color: var(--ds-border) !important; }

/* ---- slimScroll ---- */
.slimScrollBar { background: rgba(255,255,255,.16) !important; border-radius: 8px !important; width: 4px !important; }
.slimScrollDiv { overflow: visible !important; }

/* ---- Global loader + whirly-loader (ported from style.css / animate.css use) ---- */
div#global-loader { background: var(--ds-surface); position: fixed; z-index: 999999; width: 100%; height: 100vh; display: flex; align-items: center; justify-content: center; }
div#global-loader .whirly-loader:not(:required) {
  animation: whirly-loader 1.25s linear infinite; background: transparent;
  box-shadow: 0 26px 0 6px var(--ds-accent), 0.90971px 26.05079px 0 5.93333px var(--ds-accent), 1.82297px 26.06967px 0 5.86667px var(--ds-accent), 2.73865px 26.05647px 0 5.8px var(--ds-accent), 3.65561px 26.01104px 0 5.73333px var(--ds-accent), 4.57274px 25.93327px 0 5.66667px var(--ds-accent), 5.48887px 25.8231px 0 5.6px var(--ds-accent), 6.40287px 25.68049px 0 5.53333px var(--ds-accent), 7.31358px 25.50548px 0 5.46667px var(--ds-accent), 8.21985px 25.2981px 0 5.4px var(--ds-accent), 9.12054px 25.05847px 0 5.33333px var(--ds-accent), 10.01448px 24.78672px 0 5.26667px var(--ds-accent), 10.90054px 24.48302px 0 5.2px var(--ds-accent), 11.77757px 24.1476px 0 5.13333px var(--ds-accent), 12.64443px 23.78072px 0 5.06667px var(--ds-accent), 13.5px 23.38269px 0 5px var(--ds-accent), 14.34315px 22.95384px 0 4.93333px var(--ds-accent), 15.17277px 22.49455px 0 4.86667px var(--ds-accent), 15.98776px 22.00526px 0 4.8px var(--ds-accent), 16.78704px 21.48643px 0 4.73333px var(--ds-accent), 17.56953px 20.93855px 0 4.66667px var(--ds-accent), 18.33418px 20.36217px 0 4.6px var(--ds-accent), 19.07995px 19.75787px 0 4.53333px var(--ds-accent), 19.80582px 19.12626px 0 4.46667px var(--ds-accent), 20.5108px 18.468px 0 4.4px var(--ds-accent), 21.1939px 17.78379px 0 4.33333px var(--ds-accent), 21.85416px 17.07434px 0 4.26667px var(--ds-accent), 22.49067px 16.34043px 0 4.2px var(--ds-accent), 23.10251px 15.58284px 0 4.13333px var(--ds-accent), 23.68881px 14.80241px 0 4.06667px var(--ds-accent), 24.24871px 14px 0 4px var(--ds-accent), 24.7814px 13.1765px 0 3.93333px var(--ds-accent), 25.28607px 12.33284px 0 3.86667px var(--ds-accent), 25.76198px 11.46997px 0 3.8px var(--ds-accent), 26.2084px 10.58888px 0 3.73333px var(--ds-accent), 26.62462px 9.69057px 0 3.66667px var(--ds-accent), 27.01001px 8.77608px 0 3.6px var(--ds-accent), 27.36392px 7.84648px 0 3.53333px var(--ds-accent), 27.68577px 6.90284px 0 3.46667px var(--ds-accent), 27.97502px 5.94627px 0 3.4px var(--ds-accent), 28.23116px 4.97791px 0 3.33333px var(--ds-accent), 28.4537px 3.99891px 0 3.26667px var(--ds-accent), 28.64223px 3.01042px 0 3.2px var(--ds-accent), 28.79635px 2.01364px 0 3.13333px var(--ds-accent), 28.91571px 1.00976px 0 3.06667px var(--ds-accent), 29px 0 0 3px var(--ds-accent), 29.04896px -1.01441px 0 2.93333px var(--ds-accent), 29.06237px -2.03224px 0 2.86667px var(--ds-accent), 29.04004px -3.05223px 0 2.8px var(--ds-accent), 28.98185px -4.07313px 0 2.73333px var(--ds-accent), 28.88769px -5.09368px 0 2.66667px var(--ds-accent), 28.75754px -6.1126px 0 2.6px var(--ds-accent), 28.59138px -7.12863px 0 2.53333px var(--ds-accent), 28.38926px -8.14049px 0 2.46667px var(--ds-accent), 28.15127px -9.1469px 0 2.4px var(--ds-accent), 27.87755px -10.1466px 0 2.33333px var(--ds-accent), 27.56827px -11.1383px 0 2.26667px var(--ds-accent), 27.22365px -12.12075px 0 2.2px var(--ds-accent), 26.84398px -13.09268px 0 2.13333px var(--ds-accent), 26.42956px -14.05285px 0 2.06667px var(--ds-accent), 25.98076px -15px 0 2px var(--ds-accent), 25.49798px -15.93291px 0 1.93333px var(--ds-accent), 24.98167px -16.85035px 0 1.86667px var(--ds-accent), 24.43231px -17.75111px 0 1.8px var(--ds-accent), 23.85046px -18.63402px 0 1.73333px var(--ds-accent), 23.23668px -19.49789px 0 1.66667px var(--ds-accent), 22.5916px -20.34157px 0 1.6px var(--ds-accent), 21.91589px -21.16393px 0 1.53333px var(--ds-accent), 21.21024px -21.96384px 0 1.46667px var(--ds-accent), 20.4754px -22.74023px 0 1.4px var(--ds-accent), 19.71215px -23.49203px 0 1.33333px var(--ds-accent), 18.92133px -24.2182px 0 1.26667px var(--ds-accent), 18.10379px -24.91772px 0 1.2px var(--ds-accent), 17.26042px -25.58963px 0 1.13333px var(--ds-accent), 16.39217px -26.23295px 0 1.06667px var(--ds-accent), 15.5px -26.84679px 0 1px var(--ds-accent), 14.58492px -27.43024px 0 0.93333px var(--ds-accent), 13.64796px -27.98245px 0 0.86667px var(--ds-accent), 12.69018px -28.50262px 0 0.8px var(--ds-accent), 11.7127px -28.98995px 0 0.73333px var(--ds-accent), 10.71663px -29.4437px 0 0.66667px var(--ds-accent), 9.70313px -29.86317px 0 0.6px var(--ds-accent), 8.67339px -30.2477px 0 0.53333px var(--ds-accent), 7.6286px -30.59666px 0 0.46667px var(--ds-accent), 6.57001px -30.90946px 0 0.4px var(--ds-accent), 5.49886px -31.18558px 0 0.33333px var(--ds-accent), 4.41643px -31.42451px 0 0.26667px var(--ds-accent), 3.32401px -31.6258px 0 0.2px var(--ds-accent), 2.22291px -31.78904px 0 0.13333px var(--ds-accent), 1.11446px -31.91388px 0 0.06667px var(--ds-accent), 0 -32px 0 0 var(--ds-accent), -1.11911px -32.04713px 0 -0.06667px var(--ds-accent), -2.24151px -32.05506px 0 -0.13333px var(--ds-accent), -3.36582px -32.02361px 0 -0.2px var(--ds-accent), -4.49065px -31.95265px 0 -0.26667px var(--ds-accent), -5.61462px -31.84212px 0 -0.33333px var(--ds-accent), -6.73634px -31.69198px 0 -0.4px var(--ds-accent), -7.8544px -31.50227px 0 -0.46667px var(--ds-accent), -8.9674px -31.27305px 0 -0.53333px var(--ds-accent), -10.07395px -31.00444px 0 -0.6px var(--ds-accent), -11.17266px -30.69663px 0 -0.66667px var(--ds-accent), -12.26212px -30.34982px 0 -0.73333px var(--ds-accent), -13.34096px -29.96429px 0 -0.8px var(--ds-accent), -14.4078px -29.54036px 0 -0.86667px var(--ds-accent), -15.46126px -29.07841px 0 -0.93333px var(--ds-accent), -16.5px -28.57884px 0 -1px var(--ds-accent), -17.52266px -28.04212px 0 -1.06667px var(--ds-accent), -18.52792px -27.46878px 0 -1.13333px var(--ds-accent), -19.51447px -26.85936px 0 -1.2px var(--ds-accent), -20.48101px -26.21449px 0 -1.26667px var(--ds-accent), -21.42625px -25.53481px 0 -1.33333px var(--ds-accent), -22.34896px -24.82104px 0 -1.4px var(--ds-accent), -23.2479px -24.07391px 0 -1.46667px var(--ds-accent), -24.12186px -23.29421px 0 -1.53333px var(--ds-accent), -24.96967px -22.48279px 0 -1.6px var(--ds-accent), -25.79016px -21.64052px 0 -1.66667px var(--ds-accent), -26.58223px -20.76831px 0 -1.73333px var(--ds-accent), -27.34477px -19.86714px 0 -1.8px var(--ds-accent), -28.07674px -18.938px 0 -1.86667px var(--ds-accent), -28.7771px -17.98193px 0 -1.93333px var(--ds-accent), -29.44486px -17px 0 -2px var(--ds-accent), -30.07908px -15.99333px 0 -2.06667px var(--ds-accent), -30.67884px -14.96307px 0 -2.13333px var(--ds-accent), -31.24325px -13.91039px 0 -2.2px var(--ds-accent), -31.7715px -12.83652px 0 -2.26667px var(--ds-accent), -32.26278px -11.74269px 0 -2.33333px var(--ds-accent), -32.71634px -10.63018px 0 -2.4px var(--ds-accent), -33.13149px -9.5003px 0 -2.46667px var(--ds-accent), -33.50755px -8.35437px 0 -2.53333px var(--ds-accent), -33.84391px -7.19374px 0 -2.6px var(--ds-accent), -34.14px -6.0198px 0 -2.66667px var(--ds-accent), -34.39531px -4.83395px 0 -2.73333px var(--ds-accent), -34.60936px -3.63759px 0 -2.8px var(--ds-accent), -34.78173px -2.43218px 0 -2.86667px var(--ds-accent), -34.91205px -1.21916px 0 -2.93333px var(--ds-accent), -35px 0 0 -3px var(--ds-accent), -35.04531px 1.22381px 0 -3.06667px var(--ds-accent), -35.04775px 2.45078px 0 -3.13333px var(--ds-accent), -35.00717px 3.6794px 0 -3.2px var(--ds-accent), -34.92345px 4.90817px 0 -3.26667px var(--ds-accent), -34.79654px 6.13557px 0 -3.33333px var(--ds-accent), -34.62643px 7.36007px 0 -3.4px var(--ds-accent), -34.41316px 8.58016px 0 -3.46667px var(--ds-accent), -34.15683px 9.79431px 0 -3.53333px var(--ds-accent), -33.85761px 11.001px 0 -3.6px var(--ds-accent), -33.5157px 12.19872px 0 -3.66667px var(--ds-accent), -33.13137px 13.38594px 0 -3.73333px var(--ds-accent), -32.70493px 14.56117px 0 -3.8px var(--ds-accent), -32.23675px 15.72291px 0 -3.86667px var(--ds-accent), -31.72725px 16.86968px 0 -3.93333px var(--ds-accent), -31.17691px 18px 0 -4px var(--ds-accent), -30.58627px 19.11242px 0 -4.06667px var(--ds-accent), -29.95589px 20.2055px 0 -4.13333px var(--ds-accent), -29.28642px 21.27783px 0 -4.2px var(--ds-accent), -28.57852px 22.32799px 0 -4.26667px var(--ds-accent), -27.83295px 23.35462px 0 -4.33333px var(--ds-accent), -27.05047px 24.35635px 0 -4.4px var(--ds-accent), -26.23192px 25.33188px 0 -4.46667px var(--ds-accent), -25.37819px 26.27988px 0 -4.53333px var(--ds-accent), -24.49018px 27.1991px 0 -4.6px var(--ds-accent), -23.56888px 28.0883px 0 -4.66667px var(--ds-accent), -22.6153px 28.94626px 0 -4.73333px var(--ds-accent), -21.6305px 29.77183px 0 -4.8px var(--ds-accent), -20.61558px 30.56385px 0 -4.86667px var(--ds-accent), -19.57168px 31.32124px 0 -4.93333px var(--ds-accent), -18.5px 32.04294px 0 -5px var(--ds-accent), -17.40175px 32.72792px 0 -5.06667px var(--ds-accent), -16.27818px 33.37522px 0 -5.13333px var(--ds-accent), -15.1306px 33.98389px 0 -5.2px var(--ds-accent), -13.96034px 34.55305px 0 -5.26667px var(--ds-accent), -12.76875px 35.08186px 0 -5.33333px var(--ds-accent), -11.55724px 35.56951px 0 -5.4px var(--ds-accent), -10.32721px 36.01527px 0 -5.46667px var(--ds-accent), -9.08014px 36.41843px 0 -5.53333px var(--ds-accent), -7.81748px 36.77835px 0 -5.6px var(--ds-accent), -6.54075px 37.09443px 0 -5.66667px var(--ds-accent), -5.25147px 37.36612px 0 -5.73333px var(--ds-accent), -3.95118px 37.59293px 0 -5.8px var(--ds-accent), -2.64145px 37.77443px 0 -5.86667px var(--ds-accent), -1.32385px 37.91023px 0 -5.93333px var(--ds-accent);
  display: inline-block; height: 8px; overflow: hidden; position: relative; text-indent: -9999px;
  width: 8px; transform-origin: 50% 50%; border-radius: 100%;
}
@keyframes whirly-loader { 0% { transform: rotate(0deg); } to { transform: rotate(1turn); } }

/* =============================================================================
   5. ABSORBED design-system.css helpers (.ds-* — referenced by ds-render.js /
   ds-switch.js / list JS; every .ds-* selector kept styled)
   ============================================================================= */

/* ---- List avatars + name meta (ds-render.js) ---- */
.ds-cust { display: inline-flex; align-items: center; gap: 10px; text-align: left; }
.ds-ci { width: 30px; height: 30px; border-radius: 8px; flex: none; display: inline-grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .3px; line-height: 1; }
.ds-cust .ds-cmeta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.ds-cust .ds-cmeta b { font-weight: 600; font-size: 13.5px; color: var(--ds-ink); }
.ds-cust .ds-cmeta small { font-size: 11.5px; color: var(--ds-muted); }

/* ---- Status pills (leading dot; colour never the only signal) ---- */
.ds-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; white-space: nowrap; }
.ds-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.ds-pill.pos   { color: var(--ds-pos);  background: var(--ds-pos-bg); }
.ds-pill.warn  { color: var(--ds-warn); background: var(--ds-warn-bg); }
.ds-pill.due   { color: var(--ds-due);  background: var(--ds-due-bg); }
.ds-pill.info  { color: var(--ds-info); background: var(--ds-info-bg); }
.ds-pill.muted { color: var(--ds-muted); background: var(--ds-surface-2); }
/* customer-type / category chip (quiet, bordered) */
.ds-typepill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--ds-ink-2); background: var(--ds-surface-2); border: 1px solid var(--ds-border); white-space: nowrap; }

/* ---- Sidebar section labels + cash card ---- */
.sidebar .sidebar-menu > ul > li.ds-nav-section {
  padding: 14px 12px 6px; margin: 0; font-size: 10.5px; font-weight: 600;
  letter-spacing: .9px; text-transform: uppercase; color: var(--sidebar-muted);
  line-height: 1.2; list-style: none; cursor: default; user-select: none; white-space: nowrap;
}
.sidebar .sidebar-menu > ul > li.ds-nav-section:first-of-type { padding-top: 6px; }
.sidebar .ds-sidebar-cash {
  display: flex; align-items: center; gap: 10px; margin: 10px 12px 14px; padding: 12px 13px;
  background: var(--sidebar-2); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius-sm);
}
.sidebar .ds-sidebar-cash-icon { flex: 0 0 auto; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: rgba(255,255,255,.1); color: var(--sidebar-ink); }
.sidebar .ds-sidebar-cash-text { min-width: 0; overflow: hidden; }
.sidebar .ds-sidebar-cash-text small { display: block; color: var(--sidebar-muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; margin-bottom: 2px; }
.sidebar .ds-sidebar-cash-text b { display: block; font-size: 18px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -.2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .ds-sidebar-cash-text b.is-neg { color: var(--ds-due); }
@media (min-width: 991.98px) {
  .mini-sidebar .sidebar .ds-nav-section { display: none; }
  .mini-sidebar .sidebar .ds-sidebar-cash { justify-content: center; margin: 10px 6px 14px; padding: 8px; }
  .mini-sidebar .sidebar .ds-sidebar-cash-text { display: none; }
}

/* ---- Dashboard greeting ---- */
.ds-greeting { margin-bottom: 18px; }
.ds-greeting-title { margin: 0; font-size: 22px; font-weight: 700; color: var(--ds-ink); letter-spacing: -.3px; }
.ds-greeting-subtitle { margin: 4px 0 0; color: var(--ds-muted); font-size: 13px; }

/* ---- Dashboard KPI tile icons ---- */
.dash-widget .dash-widgetimg span { background: var(--ds-accent-tint); color: var(--ds-accent); border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; }
.dash-widget .dash-widgetimg span svg { width: 24px; height: 24px; }

/* ---- Dashboard ranked-bar lists + stat strip ---- */
.ds-ranklist { list-style: none; margin: 0; padding: 4px 6px; display: flex; flex-direction: column; gap: 9px; counter-reset: dsrank; }
.ds-ranklist li { display: grid; grid-template-columns: minmax(90px, 1.1fr) 2fr auto; align-items: center; gap: 10px; font-size: 12.5px; }
.ds-ranklist li::before { display: none; }
.ds-rank-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ds-ink-2); font-weight: 600; }
.ds-rank-bar { background: var(--ds-surface-2); border-radius: 4px; height: 10px; overflow: hidden; }
.ds-rank-bar i { display: block; height: 100%; background: var(--ds-accent); border-radius: 4px; }
.ds-rank-val { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ds-ink); }
.ds-rank-val.is-neg { color: var(--ds-due); }
.ds-rank-empty { color: var(--ds-muted); font-size: 13px; padding: 18px 6px; text-align: center; }
.ds-statstrip { display: flex; gap: 14px; flex-wrap: wrap; }
.ds-statstrip .ds-stat { flex: 1 1 160px; background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--radius); box-shadow: var(--ds-shadow-sm); padding: 13px 16px; }
.ds-statstrip .ds-stat small { display: block; color: var(--ds-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; margin-bottom: 5px; }
.ds-statstrip .ds-stat b { font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.ds-stat .is-neg { color: var(--ds-due); }

/* =====================================================================
   Dashboard lower panels (#89) — company balance, top performers, dues,
   cash on hand, needs attention. Anatomy ported from the prototype's
   .panel / .ulist / .urow / .alerts patterns onto the live Bootstrap cards.
   ===================================================================== */

/* greeting header + New Sale action */
.ds-greeting-row { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.ds-greeting-row .ds-greeting { margin-bottom: 0; }
.ds-greeting-actions { margin-left: auto; }
.ds-new-sale { display: inline-flex; align-items: center; gap: 8px; height: 40px; }
.ds-new-sale img { width: 16px; height: 16px; filter: brightness(0) invert(1); }

/* panel sub-caption under a card title */
.ds-panel-sub { display: block; color: var(--ds-muted); font-size: 12px; margin-top: 2px; }
.card-header .ds-seeall { color: var(--ds-accent); font-weight: 600; font-size: 13px; white-space: nowrap; }
.card-header .ds-seeall:hover { color: var(--ds-accent-hover); }

/* net-position headline */
.ds-balnet { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
    padding: 2px 0 12px; border-bottom: 1px solid var(--ds-border); margin-bottom: 6px; }
.ds-balnet small { color: var(--ds-muted); text-transform: uppercase; letter-spacing: .5px; font-size: 11px; font-weight: 600; }
.ds-balnet b { font-size: 22px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; color: var(--ds-ink); }
.ds-balnet b.is-neg { color: var(--ds-due); }

/* shared list / row anatomy (dues, cash, top performers, balance lines) */
.ds-ulist { display: flex; flex-direction: column; }
.ds-urow { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 11px;
    padding: 9px 0; border-bottom: 1px solid var(--ds-border); }
.ds-urow:last-child { border-bottom: 0; }
.ds-urow-main { min-width: 0; }
.ds-urow .ds-ci { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
    color: #fff; font-weight: 700; font-size: 11px; }
.ds-urow .ds-rank { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
    font-weight: 700; font-size: 12px; background: var(--ds-accent-tint); color: var(--ds-accent); }
.ds-urow .ds-swatch { width: 12px; height: 12px; border-radius: 4px; justify-self: center; }
.ds-urow .ds-nm { font-weight: 600; font-size: 13.5px; color: var(--ds-ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-urow .ds-track { height: 5px; background: var(--ds-surface-2); border-radius: 4px; margin-top: 5px; overflow: hidden; }
.ds-urow .ds-track > i { display: block; height: 100%; border-radius: 4px; }
.ds-urow .ds-amt { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13.5px; text-align: right; color: var(--ds-ink); }
.ds-urow .ds-amt.is-neg { color: var(--ds-due); }
.ds-urow .ds-amt small { display: block; font-weight: 500; color: var(--ds-muted); font-size: 11px; }

/* top-performers segmented tabs */
.ds-perftabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; margin-bottom: 14px;
    background: var(--ds-surface-2); border: 1px solid var(--ds-border); border-radius: 9px; }
.ds-perftabs button { background: transparent; border: 0; color: var(--ds-ink-2); font-weight: 600;
    font-size: 12.5px; padding: 6px 11px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.ds-perftabs button.active { background: var(--ds-surface); color: var(--ds-ink); box-shadow: var(--ds-shadow-sm); }

/* investment donut captions */
.ds-dcap { text-align: center; color: var(--ds-muted); font-size: 12px; font-weight: 600; margin-top: 2px; }

/* needs-attention alert cards */
.ds-alerts3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ds-alert { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px;
    border: 1px solid var(--ds-border); background: var(--ds-surface-2); }
.ds-alert > div { flex: 1; min-width: 0; }
.ds-alert .ds-ai { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.ds-alert .ds-ai svg { width: 18px; height: 18px; }
.ds-alert.due .ds-ai { background: var(--ds-due-bg); color: var(--ds-due); }
.ds-alert.warn .ds-ai { background: var(--ds-warn-bg); color: var(--ds-warn); }
.ds-alert.info .ds-ai { background: var(--ds-info-bg); color: var(--ds-info); }
.ds-alert b { font-size: 13.5px; font-weight: 600; display: block; color: var(--ds-ink); }
.ds-alert small { color: var(--ds-muted); font-size: 12px; }
.ds-need-count { font-variant-numeric: tabular-nums; }
.ds-chip-sm { display: inline-flex; align-items: center; height: 30px; padding: 0 11px; border-radius: 9px;
    border: 1px solid var(--ds-border-strong); background: var(--ds-surface); color: var(--ds-ink-2);
    font-weight: 600; font-size: 12px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.ds-chip-sm:hover { border-color: var(--ds-accent); color: var(--ds-accent); background: var(--ds-accent-tint); }

/* empty / loading states */
.ds-panel-empty, .ds-panel-loading { color: var(--ds-muted); font-size: 13px; padding: 22px 6px; text-align: center; }

/* ApexCharts text follows the theme (legend row, axis labels, chart title) so
   the Sales & Profit bars and the Investment donuts read native in light/dark. */
.apexcharts-legend { justify-content: center !important; }
.apexcharts-legend-text { color: var(--ds-ink-2) !important; }
.apexcharts-text tspan, .apexcharts-xaxis-label, .apexcharts-yaxis-label { fill: var(--ds-muted); }
.apexcharts-yaxis-title-text, .apexcharts-xaxis-title-text { fill: var(--ds-ink-2); }
.apexcharts-title-text { fill: var(--ds-ink-2); }
.apexcharts-tooltip { background: var(--ds-surface) !important; color: var(--ds-ink) !important;
    border: 1px solid var(--ds-border) !important; box-shadow: var(--ds-shadow-md) !important; }
.apexcharts-tooltip-title { background: var(--ds-surface-2) !important; border-bottom: 1px solid var(--ds-border) !important; }

@media (max-width: 991px) {
    .ds-alerts3 { grid-template-columns: 1fr; }
}

/* ---- Current/self row marker ---- */
.table tr.ds-row-current > td, .table tr.ds-row-current > th { background-color: var(--ds-accent-tint) !important; }
.table tr.ds-row-current > td:first-child { box-shadow: inset 3px 0 0 var(--ds-accent); }

/* ---- Add-item square buttons (orange asset → Plum) ---- */
.add_sales_button, .add_purchase_button, .add_quotation_button, .add_purchase_quote_button {
  background: var(--ds-accent); border-radius: var(--radius-sm);
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--ds-shadow-sm); transition: background-color .15s ease;
}
.add_sales_button:hover, .add_purchase_button:hover, .add_quotation_button:hover, .add_purchase_quote_button:hover { background: var(--ds-accent-hover); }
.add_sales_button img, .add_purchase_button img, .add_quotation_button img, .add_purchase_quote_button img { filter: brightness(0) invert(1); width: 16px; height: 16px; }
.progress-bar, .bar-inner, .sales-progress, .total-progress { background-color: var(--ds-accent) !important; }

/* =============================================================================
   6. PAGE-SPECIFIC + RESPONSIVE
   ============================================================================= */

/* ---- Order-summary card (.total-order) — ported from retired style.css.
   Each li is a label/value row (h4 left 50%, h5 right 50%); the own-theme lost
   these rules so every line rendered as a bulleted, stacked list. ---- */
.total-order ul { margin: 0; padding: 0; }
.total-order ul li {
  display: flex; align-items: stretch; list-style: none;
  border: 1px solid var(--ds-border); border-top: 0;
}
.total-order ul li:first-child { border-top: 1px solid var(--ds-border); }
.total-order ul li h4 {
  width: 50%; margin: 0; color: var(--ds-ink-2); font-size: 14px; font-weight: 500;
  padding: 10px 12px; border-right: 1px solid var(--ds-border); background: var(--ds-surface-2);
  display: flex; align-items: center; gap: 8px;
}
.total-order ul li h5 {
  width: 50%; margin: 0; color: var(--ds-ink); font-size: 14px; font-weight: 700;
  padding: 10px 12px; text-align: right; display: flex; align-items: center; justify-content: flex-end;
  font-variant-numeric: tabular-nums;
}
.total-order ul li.total h4, .total-order ul li.total h5 { color: var(--ds-ink); font-weight: 700; }
/* checkbox/inputs that sit inside a summary row stay inline, not block */
.total-order ul li h4 input[type=checkbox] { margin: 0; }

/* ---- Entry forms: card layout + sticky summary ---- */
.ds-form-layout { align-items: stretch; }
.ds-form-card { margin-bottom: 16px; }
.ds-sticky-summary { position: sticky; top: 76px; }
@media (max-width: 991.98px) { .ds-sticky-summary { position: static; } }
/* single visual primary: Save & Print becomes secondary (Submit stays accent) */
#submit-sales-print, .btn.btn-submit#submit-sales-print,
#submit-purchase-print, .btn.btn-submit#submit-purchase-print {
  background-color: var(--ds-surface) !important; border-color: var(--ds-border-strong) !important; color: var(--ds-ink) !important;
}
#submit-sales-print:hover, #submit-purchase-print:hover { background-color: var(--ds-surface-2) !important; }
@media (min-width: 992px) {
  .ds-form-card .col-lg-5 .form-group > .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
  .ds-form-card .col-lg-5 .form-group > .row > [class*="col-"]:first-child { margin-bottom: 10px; }
  .ds-form-card .col-lg-6 .form-group > .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
  .ds-form-card .col-lg-6 .form-group > .row > [class*="col-"]:first-child { margin-bottom: 10px; }
}
.ds-form-card .col-lg-3:has([id^="upload_"]) { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ds-form-card .col-lg-3:has([id^="upload_"]) [id^="download_"][id$="_button"] { margin-right: 0 !important; }
@media (min-width: 1200px) {
  .ds-form-card [id^="upload_"][id$="_button"], .ds-form-card [id^="download_"][id$="_button"] { padding: 5px 6px; font-size: 11.5px; }
}
.ds-sticky-summary .row.text-end { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ds-form-card .card-title.text-success { color: var(--ds-ink) !important; font-weight: 700; }

/* ---- Analysis "Smart Purchase Target" ruby-hack filter row ---- */
.card-body > div[style*="ruby-text"] { display: flex !important; flex-wrap: wrap; gap: 10px; align-items: flex-end; }

/* ---- Responsive: page-header stacking + table scroll containment ---- */
@media (max-width: 991.98px) {
  .page-header.row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
}
/* Touch targets on small screens */
@media (max-width: 767.98px) {
  .table td .btn.btn-sm,
  .ds-filterbar .btn.btn-sm:not(.search-input .btn-searchset),
  .table-top .btn.btn-sm:not(.search-input .btn-searchset),
  .wordset .btn.btn-sm { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
  .modal.ds-drawer .close, .modal.ds-drawer .btn-close { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }
}
@media (max-width: 768px) {
  #sales_table td, #sales_table th, #return_table td, #return_table th,
  #less_return_table td, #less_return_table th, #freebie_table td, #freebie_table th { padding-left: 3px; padding-right: 1px; font-size: 12.5px; }
  #sales_table .item_edit, #return_table .item_edit, #less_return_table .item_edit { margin-right: 4px !important; }
}

/* ---- Login / auth pages (single centered card) ---- */
.login-wrapper { background: var(--ds-page); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; box-sizing: border-box; }
.login-wrapper .login-img { display: none; }
/* light mode shows the dark logo; the white logo is dark-mode only (matches the
   header logo swap). Without this the unconstrained white PNG fills the page. */
.login-wrapper .login-logo.logo-white { display: none; }
:root[data-theme="dark"] .login-wrapper .login-logo.logo-normal { display: none; }
:root[data-theme="dark"] .login-wrapper .login-logo.logo-white { display: block; }
.login-wrapper .login-logo img { max-width: 150px; height: auto; }
.login-wrapper .login-content { width: 100%; max-width: 420px; height: auto; padding: 0; }
@media (max-width: 991.98px) { .login-wrapper .login-content { width: 100%; max-width: 420px; } }
.login-wrapper .login-content .login-userset { width: 100%; margin-top: 0; background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: 16px; box-shadow: var(--ds-shadow-md); padding: 40px 36px; box-sizing: border-box; }
@media (max-width: 575.98px) { .login-wrapper .login-content .login-userset { padding: 30px 22px; } }
.login-wrapper .login-content .login-logo { margin-bottom: 22px; }
.login-wrapper .login-content .login-userheading h3 { color: var(--ds-ink); font-weight: 700; }
.login-wrapper .login-content .login-userheading h4 { color: var(--ds-ink-2); font-weight: 400; }
.login-wrapper .login-content .form-login label { color: var(--ds-ink-2); }
.login-wrapper .login-content .form-login { margin-bottom: 16px; }
.login-wrapper .login-content .form-login .form-addons,
.login-wrapper .login-content .form-login .pass-group { position: relative; }
.login-wrapper .login-content .form-login .form-addons input,
.login-wrapper .login-content .form-login .pass-group input { width: 100%; height: var(--ctl-h); padding: 0 40px 0 12px; border: 1px solid var(--ds-border-strong); background: var(--ds-surface-2); color: var(--ds-ink); border-radius: var(--radius-sm); }
.login-wrapper .login-content .form-login .form-addons img,
.login-wrapper .login-content .form-login .pass-group .toggle-password,
.login-wrapper .login-content .form-login .pass-group .toggle-passwords { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; }
.login-wrapper .login-content .form-login .form-addons input:focus,
.login-wrapper .login-content .form-login .pass-group input:focus { border-color: var(--ds-accent); box-shadow: 0 0 0 3px var(--ds-accent-tint); }
.login-wrapper .login-content .form-login input::placeholder { color: var(--ds-muted); }
.login-wrapper .login-content .form-login .btn-login { width: 100%; height: 42px; justify-content: center; background: var(--ds-accent); border-color: var(--ds-accent); color: var(--ds-on-accent); border-radius: var(--radius-sm); box-shadow: var(--ds-shadow-sm); }
.login-wrapper .login-content .form-login .btn-login:hover,
.login-wrapper .login-content .form-login .btn-login:focus { background: var(--ds-accent-hover); border-color: var(--ds-accent-hover); color: var(--ds-on-accent); }
.login-wrapper .login-content .form-login .alreadyuser h4,
.login-wrapper .login-content .form-login .alreadyuser h4 a { color: var(--ds-accent); font-weight: 600; }
.login-wrapper .login-content .form-login .alreadyuser h4 a:hover { color: var(--ds-accent-hover); }
.login-wrapper .hover-a:after { background: var(--ds-accent); }
.login-wrapper .hover-a:hover { color: var(--ds-accent-hover) !important; }
.login-wrapper .login-content .toggle-password, .login-wrapper .login-content .toggle-passwords { color: var(--ds-muted); }
.login-wrapper .login-content .toggle-password:hover, .login-wrapper .login-content .toggle-passwords:hover { color: var(--ds-accent); }

/* ---- Rojmed table header fill (recolor to token) ---- */
.header-class { background-color: var(--ds-surface-2); }

/* =============================================================================
   ROJMED VALUE-SCALED HEATMAP (spec §"Rojmed heatmap")
   Each money cell carries an inset rounded fill whose opacity scales with the
   cell's amount relative to its column max across the visible page. The scale
   (0.06 -> 0.40) and per-column hue are computed per draw in rojmed-class.js
   applyHeatmap(): available=info, sale/received=pos, purchase=warn,
   transferred/misc=accent, balance=pos, and any negative value=due (red).
   Zero amounts get --hm-op:0 (plain surface). Capping opacity at 0.40 keeps
   dark ink and the coloured drill-down links legible at every step. The totals
   row lives in <tfoot> and is never given .hm-cell, so it keeps its own style.
   ============================================================================= */
#rojmed_list_table tbody td.hm-num { font-variant-numeric: tabular-nums; }
#rojmed_list_table tbody td.hm-cell { position: relative; isolation: isolate; }
#rojmed_list_table tbody td.hm-cell::before {
  content: ""; position: absolute; inset: 4px 6px; border-radius: 6px;
  background: var(--hm-hue, transparent); opacity: var(--hm-op, 0);
  z-index: -1; pointer-events: none;
}
#rojmed_list_table tbody td.hm-bal { font-weight: 600; }

/* Legend caption under the table: quiet muted info line. */
.ds-heatmap-note {
  display: flex; align-items: center; gap: 8px;
  margin: 12px 4px 2px; font-size: 12.5px; color: var(--ds-muted);
}
.ds-heatmap-note i { color: var(--ds-info); }

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .ds-toast, .modal.ds-drawer.fade .modal-dialog, div#global-loader .whirly-loader:not(:required) { animation: none !important; transition: none !important; }
}

/* =============================================================================
   DARK MODE gap fixes (scoped to :root[data-theme="dark"]; reuse tokens only —
   nothing fires in light mode). Kept as cascade tail per absorption map.
   ============================================================================= */
:root[data-theme="dark"] body { background: var(--ds-page); color: var(--ds-ink); }
:root[data-theme="dark"] .page-item:not(.active) .page-link { background-color: var(--ds-surface-2); border-color: var(--ds-border); color: var(--ds-ink-2); }
:root[data-theme="dark"] .page-item.disabled .page-link { background-color: var(--ds-surface-2); color: var(--ds-muted); }
:root[data-theme="dark"] .btn-outline-dark { color: var(--ds-ink-2); border-color: var(--ds-border-strong); }
:root[data-theme="dark"] .btn-outline-dark:hover { background-color: var(--ds-surface-2); color: var(--ds-ink); }
:root[data-theme="dark"] tr[style*="cfc5c4"] { background-color: var(--ds-surface-2) !important; color: var(--ds-ink) !important; }
:root[data-theme="dark"] .header-class { background-color: var(--ds-surface-2) !important; color: var(--ds-ink) !important; }
:root[data-theme="dark"] .apexcharts-text, :root[data-theme="dark"] .apexcharts-title-text { fill: var(--ds-ink-2) !important; }
:root[data-theme="dark"] .apexcharts-legend-text { color: var(--ds-ink-2) !important; }
:root[data-theme="dark"] .apexcharts-menu { background: var(--ds-surface) !important; border-color: var(--ds-border) !important; color: var(--ds-ink) !important; }
:root[data-theme="dark"] .apexcharts-menu-item:hover { background: var(--ds-surface-2) !important; }
:root[data-theme="dark"] .modal-content { background-color: var(--ds-surface); color: var(--ds-ink); border-color: var(--ds-border); }
:root[data-theme="dark"] .modal-header { border-bottom-color: var(--ds-border); background-color: var(--ds-surface); }
:root[data-theme="dark"] .modal-title, :root[data-theme="dark"] .modal-body { color: var(--ds-ink); }
:root[data-theme="dark"] .modal-footer { background: var(--ds-surface-2); border-top-color: var(--ds-border-strong); }
:root[data-theme="dark"] .modal.ds-drawer .modal-body .card { background-color: var(--ds-surface); color: var(--ds-ink); }
:root[data-theme="dark"] .table-responsive table > tfoot > tr > th:last-child { background-color: var(--ds-surface-2); }
:root[data-theme="dark"] .login-wrapper .login-content .form-login .form-addons input,
:root[data-theme="dark"] .login-wrapper .login-content .form-login .pass-group input { background: var(--ds-surface-2) !important; color: var(--ds-ink) !important; border-color: var(--ds-border-strong); }
:root[data-theme="dark"] .login-wrapper .login-content .form-login input::placeholder { color: var(--ds-muted) !important; }
:root[data-theme="dark"] .login-wrapper .login-content .login-userheading h3 { color: var(--ds-ink); }
:root[data-theme="dark"] .login-wrapper .login-content .login-userheading h4 { color: var(--ds-ink-2); }
:root[data-theme="dark"] .login-wrapper .login-content .form-login label { color: var(--ds-ink-2); }

/* =============================================================================
   7. WIREFRAME-PARITY PASS 2 (appended override layer)
   Beats: (a) index.html inline <style> blocks that load AFTER this file
   (#d8d0d0 hover, OFFICE_SIDEBAR_COLOR), and (b) Bootstrap .table-striped /
   Reboot <a> underline / DataTables sort arrows. Selectors are intentionally
   high-specificity or !important-scoped ONLY where they must win that cascade.
   ============================================================================= */

/* ---- [D1/D2] Sidebar nav: never underline (Reboot underlines all <a>); the
   dark-plum gradient active + subtle hover already live in layer 2 — this only
   removes the stray underline in every state and keeps labels crisp. ---- */
.main-wrapper .sidebar .sidebar-menu a,
.main-wrapper .sidebar .sidebar-menu > ul > li > a:hover,
.main-wrapper .sidebar .sidebar-menu > ul > li > a.active,
.main-wrapper .sidebar .sidebar-menu > ul > li.active > a,
.sidebar .sidebar-menu > ul > li.submenu ul li a { text-decoration: none !important; }

/* ---- [D9] Amount / token links inside table cells: keep the color, drop the
   underline; underline only on hover. ---- */
.table td a, .table tbody td a, table.dataTable td a { text-decoration: none; }
.table td a:hover, table.dataTable td a:hover { text-decoration: underline; }
/* Some list JS wraps link text in a literal <u> (e.g. sales token no.) — same rule. */
.table td a u, table.dataTable td a u { text-decoration: none; }
.table td a:hover u, table.dataTable td a:hover u { text-decoration: underline; }

/* ---- [D3] Table body: kill zebra striping; clean white rows with subtle
   horizontal hairlines only; more generous row height. ---- */
table.dataTable.table-striped > tbody > tr > *,
.table.table-striped > tbody > tr > *,
.table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-bg-type: transparent;
  --bs-table-accent-bg: transparent;
  --bs-table-color-type: initial;
  background-color: transparent;
  box-shadow: none;
}
.table-responsive table > tbody > tr > td { padding-top: 14px; padding-bottom: 14px; border-top: 1px solid var(--ds-border); }
/* row hover (beat inline `.table.dataTable tr:hover{background:#d8d0d0;color:#333}`) */
table.dataTable tbody tr:hover > td,
.table.dataTable tbody tr:hover > td,
.table tbody tr:hover > td { background-color: var(--ds-surface-2) !important; color: var(--ds-ink) !important; }
/* sticky ACTION cell tracks plain white rows + the surface-2 hover (no stripe) */
.table-responsive table > tbody > tr > td:last-child { background-color: var(--ds-surface); }
.table-responsive table > tbody > tr:hover > td:last-child { background-color: var(--ds-surface-2); }
/* totals tfoot: keep it DISTINCT but on-theme (override inline #cfc5c4 row bg) */
table.dataTable tfoot th, table.dataTable tfoot td, .table tfoot th, .table tfoot td {
  background-color: var(--ds-surface-2) !important; color: var(--ds-ink) !important;
  border-top: 2px solid var(--ds-border-strong);
}
.table-responsive table > tfoot > tr > th:last-child { background-color: var(--ds-surface-2) !important; }

/* ---- [D4] Table header: keep the light surface-2 fill + uppercase muted
   labels (spec §3.8), but mute the DataTables sort carets — small + faint,
   prominent (accent) only on the actively sorted column. ---- */
table.dataTable > thead .sorting:before, table.dataTable > thead .sorting:after,
table.dataTable > thead .sorting_asc:before, table.dataTable > thead .sorting_asc:after,
table.dataTable > thead .sorting_desc:before, table.dataTable > thead .sorting_desc:after,
table.dataTable > thead .sorting_asc_disabled:before, table.dataTable > thead .sorting_desc_disabled:after {
  font-size: 8px; opacity: .2; bottom: 1.1em;
}
table.dataTable > thead .sorting_asc:before,
table.dataTable > thead .sorting_desc:after { opacity: .95 !important; color: var(--ds-accent); }

/* ---- [D5] Row action buttons: light ghost icon buttons (subtle hairline
   border, transparent fill, accent on hover), always visible, square 32px. ---- */
.table-responsive table > tbody > tr > td:last-child .btn,
.table td:last-child .btn.btn-outline-dark {
  min-width: 32px; height: 32px; padding: 0 6px;
  border: 1px solid var(--ds-border); background: transparent;
  color: var(--ds-ink-2); box-shadow: none; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
}
.table-responsive table > tbody > tr > td:last-child .btn:hover,
.table td:last-child .btn.btn-outline-dark:hover {
  background: var(--ds-accent-tint); color: var(--ds-accent); border-color: var(--ds-accent);
}

/* ---- [D6] Status / payment tabs -> segmented pill control (spec §3.7).
   Covers Sales/Purchase payment tabs (.ds-status-tabs) AND Customers status
   tabs (.nav-tabs-solid.nav-tabs-rounded). ---- */
.nav-tabs.nav-tabs-solid, .ds-status-tabs.nav-tabs {
  display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; margin-bottom: 16px;
  background: var(--ds-surface-2); border: 1px solid var(--ds-border);
  border-radius: var(--radius-sm); border-bottom: 1px solid var(--ds-border);
}
.nav-tabs.nav-tabs-solid .nav-item, .ds-status-tabs.nav-tabs .nav-item { margin: 0; }
.nav-tabs-solid .nav-link, .ds-status-tabs .nav-link, .tab-nav-link {
  border: 0 !important; border-radius: var(--radius-xs) !important;
  padding: 6px 13px; font-size: 13px; font-weight: 600;
  color: var(--ds-ink-2); background: transparent;
  display: inline-flex; align-items: center;
}
.nav-tabs-solid .nav-link:hover, .ds-status-tabs .nav-link:hover, .tab-nav-link:hover { color: var(--ds-ink); }
.nav-tabs-solid .nav-link.active, .ds-status-tabs .nav-link.active, .tab-nav-link.active {
  background: var(--ds-surface) !important; color: var(--ds-ink) !important;
  box-shadow: var(--ds-shadow-sm); border: 0 !important;
}
/* count chips inline; active chip fills accent */
.ds-status-tabs .nav-link.active .ds-tab-count { background: var(--ds-accent); color: #fff; }

/* ---- [D7] Cash-on-hand card value: fit long negatives — wrap instead of
   ellipsis truncation of money; slightly smaller for the long case. ---- */
.sidebar .ds-sidebar-cash-text { overflow: visible; }
.sidebar .ds-sidebar-cash-text b {
  white-space: normal; overflow: visible; text-overflow: clip;
  font-size: 13px; line-height: 1.25; letter-spacing: -.3px;
  word-break: normal; overflow-wrap: normal;
}

/* ---- [D8] Topbar user chip: bordered rounded chip around avatar+name+role. ---- */
.user-menu .nav-link.userset {
  border: 1px solid var(--ds-border); border-radius: var(--radius-pill);
  background: var(--ds-surface); padding: 4px 14px 4px 5px; height: 44px;
}
.user-menu .nav-link.userset:hover { background: var(--ds-surface-2); border-color: var(--ds-border-strong); }
.user-menu.nav > li > a.dropdown-toggle.nav-link.userset.show { border-radius: var(--radius-pill); }

/* ---- [D11] Wide list tables: tighten horizontal cell padding + header
   letter-spacing so more columns fit (Status visible ~1440); may still scroll. ---- */
.table-responsive table > thead > tr > th,
.table-responsive table > tbody > tr > td,
.table-responsive table > tfoot > tr > th {
  padding-left: 9px; padding-right: 9px;
}
.table-responsive table > thead > tr > th { letter-spacing: .15px; }
.table-responsive table.dataTable > thead > tr > th:not(.sorting_disabled) { padding-right: 20px; }

/* ---- [D12] Date-range filter chip: compact to chip proportions. ---- */
.ds-filterbar #date_time_filter {
  padding: 0 12px; gap: 6px; font-size: 12.5px; min-width: 0;
  white-space: nowrap; width: auto;
}

/* =============================================================================
   8. POLISH PASS 3 — add-sales entry grid, entry-form header rows, right
   summary card, products toolbar order + compact range filters + qty/slab
   link recolor. CSS-only; scoped via :has() to the exact entry inputs so both
   add-sales and add-purchase (same #item_*_input ids) are fixed consistently.
   ============================================================================= */

/* ---- [A5/A2] Entry-form top row (title · toggle · customer · date · upload):
   one flex baseline, even gaps; customer select grows, date fits a full date,
   upload/download grouped hard-right. ---- */
.ds-form-card .card-body > .page-header.row {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-bottom: 20px;
}
.ds-form-card .card-body > .page-header.row > [class*="col-"] {
  width: auto; max-width: none; flex: 0 1 auto; margin: 0; padding-left: 0; padding-right: 0;
}
.ds-form-card .card-body > .page-header.row > .page-title { flex: 0 0 auto; }
.ds-form-card .card-body > .page-header.row > [class*="col-"]:has(.customer-select),
.ds-form-card .card-body > .page-header.row > [class*="col-"]:has(.supplier-select) { flex: 1 1 220px; }
.ds-form-card .card-body > .page-header.row > [class*="col-"]:has(#date_time_filter) { flex: 1 1 170px; }
.ds-form-card #date_time_filter { width: 100%; min-width: 150px; text-overflow: clip; }
.ds-form-card .card-body > .page-header.row > [class*="col-"]:has([id^="upload_"]) { margin-left: auto; }
.ds-form-card .card-body > .page-header.row .form-group { margin-bottom: 0; }
/* SPT toggle cell + label sit on the shared baseline, not floating high */
.ds-form-card .card-body > .page-header.row > .page-title:has(.is_active_toggle) { align-self: flex-end; }

/* ---- [A1] Item-entry row: all four inputs equal-width on one aligned grid
   row, labels one line above each, "+" aligned to the input height. ---- */
.ds-form-card .card-body > .row:has(#item_total_input) {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; margin: 0 0 2px;
}
.ds-form-card .card-body > .row:has(#item_total_input) > [class*="col-"] {
  width: auto; max-width: none; margin: 0; padding-left: 0; padding-right: 0;
}
.ds-form-card .card-body > .row:has(#item_total_input) .form-group { margin-bottom: 0; }
.ds-form-card .card-body > .row:has(#item_total_input) .form-group > label { white-space: nowrap; }
.ds-form-card .card-body > .row:has(#item_total_input) .btn-group .btn { white-space: nowrap; }
/* Sales/Purchase-type + Select-items block keeps a comfortable left column */
.ds-form-card .card-body > .row:has(#item_total_input) > [class*="col-"]:has(.btn-check) { flex: 1 1 200px; }
/* single field cells (In Stock / Quantity / Base Price) — equal width */
.ds-form-card .card-body > .row:has(#item_total_input) > [class*="col-"]:has(#item_stock_input):not(:has(#item_qty_input)),
.ds-form-card .card-body > .row:has(#item_total_input) > [class*="col-"]:has(#item_qty_input):not(:has(#item_stock_input)),
.ds-form-card .card-body > .row:has(#item_total_input) > [class*="col-"]:has(#item_price_input) {
  flex: 1 1 92px; min-width: 88px;
}
/* combined In-Stock+Quantity cell (add-purchase nests both in one col) */
.ds-form-card .card-body > .row:has(#item_total_input) > [class*="col-"]:has(#item_stock_input):has(#item_qty_input) {
  flex: 1 1 200px; display: flex; gap: 12px;
}
.ds-form-card .card-body > .row:has(#item_total_input) > [class*="col-"]:has(#item_stock_input):has(#item_qty_input) > [class*="col-"] {
  flex: 1 1 0; width: auto; max-width: none; padding: 0;
}
/* Total-price cell holds the 4th input + the "+" button beside it */
.ds-form-card .card-body > .row:has(#item_total_input) > [class*="col-"]:has(#item_total_input) {
  flex: 1 1 150px; min-width: 140px;
}
.ds-form-card .card-body > .row:has(#item_total_input) [class*="col-"]:has(#item_total_input) > .form-group > .row {
  display: flex; flex-wrap: nowrap; align-items: flex-end; gap: 10px; margin: 0;
}
.ds-form-card .card-body > .row:has(#item_total_input) [class*="col-"]:has(#item_total_input) > .form-group > .row > [class*="col-"]:first-child {
  flex: 1 1 auto; width: auto; max-width: none; padding: 0;
}
.ds-form-card .card-body > .row:has(#item_total_input) [class*="col-"]:has(#item_total_input) > .form-group > .row > [class*="col-"]:last-child {
  flex: 0 0 auto; width: auto; max-width: none; padding: 0;
}
/* the "+" add button matches the input control height for a clean baseline */
.add_sales_button, .add_purchase_button, .add_quotation_button, .add_purchase_quote_button {
  width: var(--ctl-h); height: var(--ctl-h);
}
.ds-form-card .add-icon { line-height: 0; }

/* ---- [A3] Comments card: collapse the big empty band above Display Name. ---- */
.ds-form-card:has(#display_name_input) .card-body > .form-group.mt-5 { margin-top: 18px !important; }
.ds-form-card:has(#display_name_input) .card-body > .form-group.mt-5:first-of-type { margin-top: 0 !important; }

/* ---- [A4] Right summary card: give label cells room so each row is one clean
   line, roomier row padding, even-gapped action row. ---- */
.ds-sticky-summary .total-order ul li h4 { width: 62%; padding: 11px 13px; font-size: 13.5px; }
.ds-sticky-summary .total-order ul li h5 { width: 38%; padding: 11px 13px; }
.ds-sticky-summary .row.text-end .btn, .ds-sticky-summary .row.text-end .btn-cancel { margin-right: 0 !important; }

/* ---- [C1] Products header actions: Manage Category · Export · Import … Add
   Product (primary, right edge). Flatten the nested grid, reorder with flex. ---- */
.page-header.row:has(.add_item_button) {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
}
.page-header.row:has(.add_item_button) > .col-md-5.row { display: contents; }
.page-header.row:has(.add_item_button) [class*="col-"] {
  width: auto; max-width: none; flex: 0 0 auto; padding-left: 0; padding-right: 0; margin: 0;
}
.page-header.row:has(.add_item_button) .page-title { margin-right: auto; }
.page-header.row:has(.add_item_button) .col-md-2:empty { display: none; }
.page-header.row:has(.add_item_button) [class*="col-"]:has(#category-model-button) { order: 1; }
.page-header.row:has(.add_item_button) [class*="col-"]:has(.dropdown-toggle) { order: 2; }
.page-header.row:has(.add_item_button) [class*="col-"]:has([id^="upload_item"]) { order: 3; }
.page-header.row:has(.add_item_button) [class*="col-"]:has(.add_item_button) { order: 4; }

/* ---- [C1b] Generalized list toolbar: title + records LEFT, action group RIGHT
   (secondary buttons … then PRIMARY anchoring the right edge). Opt-in via the
   .ds-toolbar class on .page-header; flattens any bootstrap col wrappers so the
   header reads as one clean flex row on every list screen. ---- */
.page-header.ds-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
}
.page-header.ds-toolbar > [class*="col-"] {
  width: auto; max-width: none; flex: 0 0 auto; padding-left: 0; padding-right: 0; margin: 0;
}
.page-header.ds-toolbar > .page-title { margin-right: auto; flex: 1 1 auto; }
.page-header.ds-toolbar .ds-header-actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px; justify-content: flex-end;
}
/* Bootstrap `.row > *` forces width:100% on children — neutralize it so the
   action group shares the title's row instead of wrapping to its own line. */
.page-header.ds-toolbar > .ds-header-actions {
  margin-left: auto; width: auto; max-width: none; flex: 0 0 auto;
}
/* Primary add control (plum) always anchors the right edge of the action group */
.page-header.ds-toolbar .ds-header-actions .btn-added { order: 99; }
/* Neutralize legacy inline float hacks now that flex owns the ordering */
.page-header.ds-toolbar .ds-header-actions .btn { float: none !important; margin-left: 0 !important; }

/* ---- [C2] Products range-filter groups: quiet inline pills at chip height,
   no card look; page-size chip right-aligned on its row. ---- */
.ds-filterbar .dr-wrap {
  display: flex; flex-direction: row; align-items: center; gap: 10px;
  min-width: 0; height: var(--ctl-h); padding: 0 12px;
  border: 1px solid var(--ds-border); border-radius: var(--radius-pill);
  background: var(--ds-surface-2); font-size: 12.5px;
}
.ds-filterbar .dr-wrap > div:first-child { margin-bottom: 0 !important; gap: 6px; flex: 0 0 auto; }
.ds-filterbar .dr-wrap .dr-label { margin: 0 !important; color: var(--ds-ink-2); font-weight: 600; }
.ds-filterbar .dr-wrap input[type=number] { height: 24px !important; background: var(--ds-surface); border-color: var(--ds-border); }
.ds-filterbar .dr-wrap .dr-slider-area { margin-top: 0 !important; width: 84px; flex: 0 0 84px; height: 20px !important; }
.ds-filterbar .dr-wrap .dr-track, .ds-filterbar .dr-wrap .dr-fill { top: 8px !important; }
.ds-filterbar .dr-wrap .dr-input { top: 3px !important; }
.ds-filterbar .page-length { margin-left: auto; }

/* ---- [C3] Products date-range chip: fit its full text, don't clip the year. ---- */
.ds-filterbar #date_time_filter { min-width: 188px; }

/* ---- [C4] Products qty / slab table links: theme plum link, not raw Bootstrap
   warning/info/success tints (which ship as !important). ---- */
.table td a.purchase-qty-link, .table td a.sales-qty-link, .table td a.tier-price-link,
table.dataTable td a.purchase-qty-link, table.dataTable td a.sales-qty-link, table.dataTable td a.tier-price-link {
  color: var(--ds-accent) !important; font-weight: 600;
}
.table td a.purchase-qty-link:hover, .table td a.sales-qty-link:hover, .table td a.tier-price-link:hover,
table.dataTable td a.purchase-qty-link:hover, table.dataTable td a.sales-qty-link:hover, table.dataTable td a.tier-price-link:hover {
  color: var(--ds-accent-hover) !important;
}

/* ---- [D-nit] Segmented radio groups (btn-check + .btn-outline-primary):
   force the CHECKED chip to theme plum, not Bootstrap blue. Applies to every
   such group (Customer Status Active/In Active/Freeze, etc.). ---- */
.btn-check:checked + .btn-outline-primary,
.btn-check:active + .btn-outline-primary,
.btn-check:checked + .btn.btn-outline-primary,
.btn-check:active + .btn.btn-outline-primary {
  background-color: var(--ds-accent) !important;
  border-color: var(--ds-accent) !important;
  color: var(--ds-on-accent) !important;
  box-shadow: none;
}
.btn-check:focus-visible + .btn-outline-primary { outline: 2px solid var(--ds-accent); outline-offset: 2px; }

/* ---- [D-nit] Input-group prefix (+91) + control must sit on ONE row at
   control height, not wrap. ---- */
.modal .input-group { flex-wrap: nowrap; }
.input-group > .input-group-text {
  height: var(--ctl-h); display: inline-flex; align-items: center;
  border: 1px solid var(--ds-border-strong); background: var(--ds-surface-2);
  color: var(--ds-ink); font-size: 13.5px;
}
.input-group > .form-control { min-width: 0; }

/* ---- Product drawer: supplier rows as a clean grid (select grows, price
   fixed, delete as a quiet ghost); ADD NEW as a left-aligned tertiary link. ---- */
.ds-supplier-table { margin-bottom: 10px; }
.ds-supplier-table > thead > tr > th {
  border: 0; border-bottom: 1px solid var(--ds-border);
  padding: 4px 8px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px; color: var(--ds-muted);
}
.ds-supplier-table > tbody > tr > td { border: 0; padding: 5px 8px; vertical-align: middle; }
.ds-supplier-table > tbody > tr:hover { background: transparent; }
.ds-supplier-table th:nth-child(2), .ds-supplier-table td:nth-child(2) { width: 140px; }
.ds-supplier-table th:nth-child(3), .ds-supplier-table td:nth-child(3) { width: 52px; text-align: center; }
.ds-supplier-table td .form-select, .ds-supplier-table td .form-control { width: 100%; }
.ds-supplier-table td .btn-outline-danger {
  background: transparent; border-color: transparent; color: var(--ds-muted);
  box-shadow: none; width: var(--ctl-h); padding: 0;
}
.ds-supplier-table td .btn-outline-danger:hover { background: var(--ds-surface-2); color: var(--ds-due); }
.ds-add-supplier {
  background: transparent; border: 0; box-shadow: none; padding: 4px 2px;
  color: var(--ds-accent); font-weight: 600;
}
.ds-add-supplier:hover { background: transparent; color: var(--ds-accent-hover); text-decoration: underline; }

/* ---- Product drawer: Options toggle row — align switches + assembled check
   on one tidy line; explanatory text as a small muted line. ---- */
.ds-toggle-row .form-group { margin-bottom: 6px; }
.ds-toggle-row .form-group > label { display: block; }
.ds-toggle-row .ds-assembled-check { display: flex; align-items: center; gap: 8px; height: var(--ctl-h); }
.ds-toggle-row .ds-assembled-check .form-check-input { width: 20px; height: 20px; margin: 0; cursor: pointer; flex: 0 0 20px; }
.ds-toggle-row .ds-assembled-check .form-check-label { cursor: pointer; font-weight: 600; }
.ds-toggle-row small.form-text { margin-top: 2px; }

/* ---- [C6] Analysis filter rows (SPT / Profit / Sales / Purchase charts):
   replace the `display:ruby-text` label-inline layout with a tidy flex chip row.
   Labels become small muted uppercase captions above each control; every
   control sits on the shared --ctl-h baseline; page-size chip floats right. ---- */
.ds-analysis-filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 15px;
}
.ds-analysis-filters .form-group {
  margin-bottom: 0; display: flex; flex-direction: column; gap: 4px; justify-content: flex-end;
}
.ds-analysis-filters .form-group > label {
  margin: 0; font-size: 10.5px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; color: var(--ds-muted); white-space: nowrap; line-height: 1.2;
}
.ds-analysis-filters .form-group > br { display: none; }
.ds-analysis-filters .form-control,
.ds-analysis-filters .form-select,
.ds-analysis-filters #profit_date_time_filter,
.ds-analysis-filters #sales_date_time_filter,
.ds-analysis-filters #purchase_date_time_filter,
.ds-analysis-filters .btn {
  height: var(--ctl-h); border-radius: var(--radius-sm);
}
.ds-analysis-filters .form-select-sm { min-width: 130px; width: auto; }
.ds-analysis-filters input[type=search].form-control-sm { min-width: 150px; }
.ds-analysis-filters input[type=number].form-control-sm { width: 68px; min-width: 68px; text-align: center; }
.ds-analysis-filters [id$="date_time_filter"] {
  display: inline-flex; align-items: center; gap: 6px; width: auto !important; max-width: none !important; min-width: 188px;
}
.ds-analysis-filters .btn.btn-rounded { border-radius: var(--radius-pill); }
.ds-analysis-filters .page-length { margin-left: auto; }
/* bootstrap-multiselect renders a .btn-group in place of the <select multiple> */
.ds-analysis-filters .btn-group { display: inline-flex; }
.ds-analysis-filters .btn-group .multiselect.btn { min-width: 130px; }
/* The three horizon %-inputs (30/15/7 days) read as one bordered cluster */
.ds-analysis-filters .ds-pct-cluster {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 5px 12px 7px; border: 1px solid var(--ds-border);
  border-radius: var(--radius-sm); background: var(--ds-surface-2);
}
.ds-analysis-filters .ds-pct-cluster .form-group { gap: 3px; }

/* ---- Bootstrap .text-primary is blue; the theme's primary is Plum. Override
   globally so utility-classed links/text (e.g. sales token links) stay on-palette. ---- */
.text-primary { color: var(--ds-accent) !important; }
a.text-primary:hover, a.text-primary:focus { color: var(--ds-accent-strong, var(--ds-accent)) !important; }

/* ---- Drawer: two sections side by side (Slab price + Supplier details).
   Each child keeps its own .ds-dsection card; when one hides (supplier section
   hides for assembled products) the other naturally takes the full row. ---- */
.ds-dsection-pair { display: flex; gap: 14px; align-items: flex-start; }
.ds-dsection-pair > .ds-dsection { flex: 1 1 0; min-width: 0; margin-bottom: 0; }
.ds-dsection-pair { margin-bottom: 14px; }
@media (max-width: 860px) { .ds-dsection-pair { flex-direction: column; } }
/* In the paired (half-width) layout the slab/supplier numeric inputs are narrow —
   trim padding + right-align so 4-5 digit prices stay fully visible. */
.ds-dsection-pair .ds-slab-table input,
.ds-dsection-pair .ds-supplier-table input { padding-left: 8px; padding-right: 8px; }
.ds-dsection-pair .ds-slab-table input { text-align: right; min-width: 58px; }

/* ============================================================
   MINI-SIDEBAR COMPLETENESS FIX
   The collapse toggled correctly (body.mini-sidebar) but rail
   internals kept their 200px design: pills/menu/cash-card bled
   over the content, the logo box stayed wide, and the reopen
   toggle was invisible (opacity 0). body.mini-sidebar prefix
   outranks the .main-wrapper pill selectors.
   ============================================================ */
@media (min-width: 991.98px) {
  /* rail internals track the 80px width */
  body.mini-sidebar .sidebar .sidebar-menu { width: 80px; padding: 6px 8px; }
  body.mini-sidebar .main-wrapper .sidebar .sidebar-menu > ul,
  body.mini-sidebar .sidebar .sidebar-menu > ul { width: auto; }
  body.mini-sidebar .main-wrapper .sidebar .sidebar-menu > ul > li > a,
  body.mini-sidebar .main-wrapper .sidebar .sidebar-menu > ul > li.active > a,
  body.mini-sidebar .main-wrapper .sidebar .sidebar-menu > ul > li > a.active {
    width: auto; padding: 10px; justify-content: center;
  }
  /* section labels + submenus have no room at 80px */
  body.mini-sidebar .sidebar .sidebar-menu > ul > li.ds-nav-section { display: none; }
  body.mini-sidebar .sidebar .sidebar-menu ul li.submenu ul { display: none !important; }
  /* cash card: icon-only chip, centered */
  body.mini-sidebar .sidebar .ds-sidebar-cash { width: auto; margin: 6px 8px; padding: 10px 0; justify-content: center; }
  body.mini-sidebar .sidebar .ds-sidebar-cash .ds-sidebar-cash-text { display: none; }
  /* header: logo box shrinks, glyph-only logo, reopen toggle ALWAYS visible */
  body.mini-sidebar .header-left { width: 80px; padding: 0 8px; display: flex; align-items: center; justify-content: center; }
  body.mini-sidebar .header-left .logo-normal,
  body.mini-sidebar .header-left .logo-white { display: none; }
  body.mini-sidebar .header-left .logo-small { display: inline-flex; }
  body.mini-sidebar .header-left #toggle_btn { opacity: 1 !important; }
  /* hover-expand (expand-menu) restores full-width internals */
  body.mini-sidebar.expand-menu .sidebar .sidebar-menu { width: 200px; padding: 6px 12px; }
  body.mini-sidebar.expand-menu .main-wrapper .sidebar .sidebar-menu > ul > li > a,
  body.mini-sidebar.expand-menu .main-wrapper .sidebar .sidebar-menu > ul > li.active > a {
    padding: 8px 12px; justify-content: flex-start;
  }
  body.mini-sidebar.expand-menu .sidebar .sidebar-menu > ul > li.ds-nav-section { display: list-item; }
  body.mini-sidebar.expand-menu .sidebar .ds-sidebar-cash { justify-content: flex-start; padding: 8px; }
  body.mini-sidebar.expand-menu .sidebar .ds-sidebar-cash .ds-sidebar-cash-text { display: block; }
}
@media (min-width: 991.98px) {
  /* hover-expand overrides the earlier collapse-crop guard: rail widens to
     200px while hovered (page margin stays 80 — overlay expand, standard UX) */
  body.mini-sidebar.expand-menu .sidebar { width: 200px; }
  body.mini-sidebar.expand-menu .sidebar .sidebar-menu ul > li > a span { display: inline; }
  body.mini-sidebar.expand-menu .sidebar .sidebar-menu ul li a .badge { display: inline-flex; }
  body.mini-sidebar.expand-menu .header-left { width: 200px; }
  body.mini-sidebar.expand-menu .header-left .logo-normal { display: inline-flex; }
  body.mini-sidebar.expand-menu .header-left .logo-small { display: none; }
}
@media (min-width: 991.98px) {
  /* the logo-small asset is a raw 1528x1893 PNG — constrain it; unconstrained
     it covered the page and shoved #toggle_btn across the topbar */
  body.mini-sidebar .header-left .logo-small img { height: 30px; width: auto; }
  body.mini-sidebar .header-left { gap: 6px; }
}
@media (min-width: 991.98px) {
  /* slimScroll writes inline width:200px on its wrappers at init — the dark
     band that overflowed the collapsed rail. !important beats inline. */
  body.mini-sidebar .sidebar .slimScrollDiv,
  body.mini-sidebar .sidebar .sidebar-inner { width: 80px !important; }
  body.mini-sidebar.expand-menu .sidebar .slimScrollDiv,
  body.mini-sidebar.expand-menu .sidebar .sidebar-inner { width: 200px !important; }
  body.mini-sidebar .sidebar { overflow: hidden; }
}
@media (min-width: 991.98px) {
  /* Collapsed rail, properly: one uniform column of 44px square icon buttons,
     all centered — active is a filled square, not a stretched pill. */
  body.mini-sidebar .sidebar .sidebar-menu > ul > li { display: flex; justify-content: center; }
  body.mini-sidebar .main-wrapper .sidebar .sidebar-menu > ul > li > a,
  body.mini-sidebar .main-wrapper .sidebar .sidebar-menu > ul > li.active > a,
  body.mini-sidebar .main-wrapper .sidebar .sidebar-menu > ul > li > a.active {
    width: 44px; height: 44px; padding: 0; margin: 2px 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
  }
  body.mini-sidebar .sidebar .sidebar-menu > ul > li > a svg,
  body.mini-sidebar .sidebar .sidebar-menu > ul > li > a img {
    width: 20px; height: 20px; margin: 0;
  }
  /* subtle divider where each section label was */
  /* cash chip matches the icon-button geometry */
  body.mini-sidebar .sidebar .ds-sidebar-cash {
    width: 44px; height: 44px; padding: 0; margin: 8px auto;
    display: flex; align-items: center; justify-content: center; border-radius: 10px;
  }
}
@media (min-width: 991.98px) {
  /* v2 dividers: hide the label element entirely; draw a hairline above the
     next item instead (the font-size:0 crop leaked letter-spaced text). */
  body.mini-sidebar .sidebar .sidebar-menu > ul > li.ds-nav-section { display: none; }
  body.mini-sidebar .sidebar .sidebar-menu > ul > li.ds-nav-section + li { margin-top: 11px; position: relative; }
  body.mini-sidebar .sidebar .sidebar-menu > ul > li.ds-nav-section + li::before {
    content: ''; position: absolute; top: -6px; left: 18px; right: 18px;
    height: 1px; background: rgba(255,255,255,.08);
  }
  body.mini-sidebar.expand-menu .sidebar .sidebar-menu > ul > li.ds-nav-section + li { margin-top: 0; }
  body.mini-sidebar.expand-menu .sidebar .sidebar-menu > ul > li.ds-nav-section + li::before { display: none; }
}

/* ---- hover-expand (mini-sidebar.expand-menu) must FULLY mirror the normal
   expanded sidebar — earlier restores left the collapse geometry (44px
   squares, centered li) in place, producing the ragged hover state. ---- */
@media (min-width: 991.98px) {
  body.mini-sidebar.expand-menu .sidebar .sidebar-menu > ul > li {
    display: block; margin-bottom: 2px;
  }
  body.mini-sidebar.expand-menu .main-wrapper .sidebar .sidebar-menu > ul > li > a,
  body.mini-sidebar.expand-menu .main-wrapper .sidebar .sidebar-menu > ul > li.active > a,
  body.mini-sidebar.expand-menu .main-wrapper .sidebar .sidebar-menu > ul > li > a.active {
    width: auto; height: auto; margin: 0;
    display: flex; align-items: center; gap: 11px;
    padding: 8px 12px; justify-content: flex-start;
    border-radius: var(--radius-sm);
  }
  body.mini-sidebar.expand-menu .sidebar .sidebar-menu > ul > li > a img {
    width: 18px; height: auto; margin: 0;
  }
  /* nav svgs carry height="24" attributes — pinned renders them 18x24; height:auto
     would rescale to 18x18 and shrink the row 4px, drifting everything below */
  body.mini-sidebar.expand-menu .sidebar .sidebar-menu > ul > li > a svg {
    width: 18px; height: 24px; margin: 0;
  }
  body.mini-sidebar.expand-menu .sidebar .ds-sidebar-cash {
    width: auto; height: auto;
    display: flex; align-items: center; gap: 10px;
    margin: 10px 12px 14px; padding: 12px 13px;
    justify-content: flex-start; border-radius: var(--radius-sm);
  }
  body.mini-sidebar.expand-menu .sidebar .ds-sidebar-cash .ds-sidebar-cash-text { display: block; }
  body.mini-sidebar.expand-menu .sidebar .sidebar-menu > ul > li.ds-nav-section {
    display: list-item; height: auto; padding: 14px 12px 6px; margin: 0; background: transparent;
  }
  body.mini-sidebar.expand-menu .sidebar .sidebar-menu > ul > li.ds-nav-section:first-of-type { padding-top: 6px; }
}
@media (min-width: 991.98px) {
  /* Icon misalignment root cause: notification <div>s inside nav anchors
     (sales-order/transfer/misc badges) stay flex siblings — 0-20px wide plus
     a phantom 11px gap slot each, shoving icons off-axis. In rail mode they
     become corner dots; gap collapses to 0 (single visible child anyway). */
  body.mini-sidebar .main-wrapper .sidebar .sidebar-menu > ul > li > a,
  body.mini-sidebar .main-wrapper .sidebar .sidebar-menu > ul > li.active > a,
  body.mini-sidebar .main-wrapper .sidebar .sidebar-menu > ul > li > a.active { gap: 0; }
  body.mini-sidebar .sidebar .sidebar-menu > ul > li > a > div {
    position: absolute; top: 3px; right: 3px; margin: 0;
  }
  /* hover-expand restores flow */
  body.mini-sidebar.expand-menu .main-wrapper .sidebar .sidebar-menu > ul > li > a,
  body.mini-sidebar.expand-menu .main-wrapper .sidebar .sidebar-menu > ul > li.active > a,
  body.mini-sidebar.expand-menu .main-wrapper .sidebar .sidebar-menu > ul > li > a.active { gap: 11px; }
  body.mini-sidebar.expand-menu .sidebar .sidebar-menu > ul > li > a > div { position: static; }
}

/* ---- Topbar breadcrumb (wireframe: "Home › Page") ---- */
.ds-crumbs { display: flex; align-items: center; gap: 8px; }
.ds-crumbs .ds-crumb-home {
  font-size: var(--fs-md); font-weight: 500; color: var(--ds-muted);
  text-decoration: none; letter-spacing: -.2px;
}
.ds-crumbs .ds-crumb-home:hover { color: var(--ds-accent); }
.ds-crumbs .ds-crumb-sep { color: var(--ds-muted); font-size: var(--fs-md); line-height: 1; opacity: .7; }

   ======================================================================
   AUDIT WAVE C — add/edit SALES & PURCHASE entry-form alignment (#89)
   Restructures the two entry forms into structural twins:
     top header row · segmented Type row · single Item-entry axis ·
     summary card (span labels, uniform rows) · contained detail tables.
   Self-contained + appended last so it overrides the POLISH-PASS-3 :has()
   rules above (whose original markup was replaced). Scoped to entry forms.
   ====================================================================== */

/* [C0] Right summary column takes its natural height (no stretched
   dead-space under the sticky card). */
.ds-form-layout { align-items: flex-start; }

/* [C1] Upload | Download group — flex, Upload first, pinned right.
   Replaces the old float:right inline styles (removed from markup). */
.ds-form-card .ds-updl-cell {
  display: flex; gap: 8px; align-items: flex-end; justify-content: flex-end;
  flex-wrap: wrap; margin-left: auto;
}
.ds-form-card .ds-updl-cell .btn {
  float: none !important; margin: 0 !important; white-space: nowrap;
}

/* [C2] Sales/Purchase TYPE — its own row, themed segmented control
   (plum active, neutral inactive). Styles the existing btn-outline-*
   classes the JS toggles by :checked — no class/id changes. */
.ds-form-card .card-body > .ds-type-row { margin: 2px 0 14px; }
.ds-form-card .ds-type-row .form-group { margin-bottom: 0; }
.ds-form-card .ds-type-row > .form-group > label {
  display: block; margin-bottom: 5px;
}
.ds-type-seg {
  display: inline-flex; border: 1px solid var(--ds-border-strong);
  border-radius: var(--radius-sm); overflow: hidden; background: var(--ds-surface-2);
}
.ds-form-card .ds-type-seg .btn.btn-outline-success,
.ds-form-card .ds-type-seg .btn.btn-outline-danger,
.ds-form-card .ds-type-seg .btn.btn-outline-secondary {
  height: var(--ctl-h); display: inline-flex; align-items: center;
  border: 0; border-left: 1px solid var(--ds-border); border-radius: 0; margin: 0;
  background: transparent; color: var(--ds-ink-2);
  font-weight: 600; font-size: 13px; padding: 0 18px; box-shadow: none;
}
.ds-form-card .ds-type-seg > .btn-check:first-child + .btn { border-left: 0; }
.ds-form-card .ds-type-seg .btn:hover { background: var(--ds-surface); color: var(--ds-ink); }
.ds-form-card .ds-type-seg .btn-check:checked + .btn.btn-outline-success,
.ds-form-card .ds-type-seg .btn-check:checked + .btn.btn-outline-danger,
.ds-form-card .ds-type-seg .btn-check:checked + .btn.btn-outline-secondary {
  background: var(--ds-accent); color: #fff; border-color: var(--ds-accent);
}
.ds-form-card .ds-type-seg .btn-check:checked + .btn:hover { background: var(--ds-accent-hover); }
.ds-form-card .ds-type-seg .btn-check:focus-visible + .btn { box-shadow: inset 0 0 0 2px var(--ds-accent-tint); }

/* [C3] ITEM-ENTRY AXIS — one aligned row, labels above each field:
   [ Item select ][ In Stock ][ Quantity ][ Base Price ][ Total Price ][ + ] */
.ds-form-card .card-body > .ds-entry-axis {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 2px;
}
.ds-entry-axis .ds-entry-cell {
  display: flex; flex-direction: column; flex: 1 1 0; min-width: 92px;
}
.ds-entry-axis .ds-entry-cell > label {
  color: var(--ds-ink-2); font-weight: 600; font-size: 13px;
  margin: 0 0 5px; white-space: nowrap;
}
.ds-entry-axis .ds-entry-cell--item { flex: 2.2 1 220px; min-width: 200px; }
.ds-entry-axis .ds-entry-cell--add { flex: 0 0 auto; min-width: 0; }
/* bare entry inputs (no .form-control) — themed to match the controls */
.ds-entry-axis .ds-entry-cell input[type=text] {
  width: 100%; height: var(--ctl-h);
  border: 1px solid var(--ds-border-strong); border-radius: var(--radius-sm);
  background: var(--ds-surface-2); color: var(--ds-ink);
  font-size: 13.5px; padding: 0 12px;
}
.ds-entry-axis .ds-entry-cell input[type=text]:focus {
  border-color: var(--ds-accent); background: var(--ds-surface);
  box-shadow: 0 0 0 3px var(--ds-accent-tint); outline: none;
}
.ds-entry-axis .ds-entry-cell input[type=text]:disabled,
.ds-entry-axis .ds-entry-cell input[type=text][readonly] {
  color: var(--ds-muted); background: var(--ds-surface-2);
}
/* select2 (item picker) fills its cell at control height */
.ds-entry-axis .ds-entry-cell--item .select2-container { width: 100% !important; }
/* + add button aligned to the input baseline */
.ds-entry-axis .ds-entry-cell--add .add-icon {
  height: var(--ctl-h); display: inline-flex; align-items: center; justify-content: center;
}
.ds-entry-axis .ds-entry-cell--add .add-icon a { display: inline-flex; line-height: 0; }
.ds-entry-axis .ds-entry-cell--add .add-icon img { width: 30px; height: 30px; }

/* [C3b] EDITABLE ROW PRICE + DERIVED DISCOUNT FLAG (#138b)
   The price is typed per line and the discount band is derived from it, so the
   cell has to hold both the input and its verdict. They sit on one baseline and
   the flag is allowed to be absent — an ordinary full-price line shows nothing,
   which is what makes a Staff/Owner line register at a glance. The flag column
   is reserved (min-width) so a row does not jump sideways as the pill appears. */
.ds-price-cell {
  white-space: nowrap;
}
.ds-price-cell > .row_price_input {
  display: inline-block;
  width: 84px;
  height: var(--ctl-h, 38px);
  padding: 4px 8px;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}
.ds-price-cell > .row_price_input:focus {
  border-color: var(--ds-accent, #8a3d6b);
  box-shadow: 0 0 0 3px rgba(138, 61, 107, .12);
}
.ds-price-cell > .ds-price-flag {
  display: inline-block;
  margin-left: 6px;
  text-align: left;
  vertical-align: middle;
}
/* The price cell grew by an input's worth of width, and an auto-layout table
   pays for that out of its neighbours — the quantity box collapsed to a sliver
   with its number clipped. Give it a floor it cannot be squeezed below. */
.table .item_qty {
  min-width: 58px;
}

/* [C4] SUMMARY CARD — <h4> labels became <span class="ds-sum-label">.
   Uniform row heights (single top border on the <ul>, none per-row). */
.total-order ul { border-top: 1px solid var(--ds-border); }
.total-order ul li { border-top: 0; box-sizing: border-box; }
.total-order ul li:first-child { border-top: 0; }
.total-order ul li .ds-sum-label {
  flex: 1 1 auto; margin: 0; color: var(--ds-ink-2); font-size: 13px; font-weight: 500;
  padding: 11px 13px; border-right: 1px solid var(--ds-border); background: var(--ds-surface-2);
  display: flex; align-items: center; gap: 6px; min-height: 42px;
}
.total-order ul li.total .ds-sum-label { color: var(--ds-ink); font-weight: 700; }
.total-order ul li .ds-sum-label input[type=checkbox] { margin: 0; }
.total-order ul li .ds-sum-op { margin-left: auto; font-weight: 800; }
.ds-sticky-summary .total-order ul li h5 { flex: 0 0 38%; width: 38%; }
.total-order ul li h5 { min-height: 42px; }

/* [C5] Summary action row — even 8px gaps (Submit · Save & Print · Cancel) */
.ds-sticky-summary .row.text-end { gap: 8px; }
.ds-sticky-summary .row.text-end .btn,
.ds-sticky-summary .row.text-end .btn-cancel { margin: 0 !important; }

/* [C6] Detail tables — contain overflow inside the card (fixes the
   clipped right columns on the purchase table). */
.ds-form-card .table-responsive { overflow-x: auto; width: 100%; }
.ds-form-card [id$="-table-div"] > .row { margin-left: 0; margin-right: 0; }
.ds-form-card [id$="-table-div"] > .row > .table-responsive { padding-left: 0; padding-right: 0; }

/* [C7] Small screens — axis + type control stack cleanly */
@media (max-width: 767.98px) {
  .ds-form-card .card-body > .ds-entry-axis { gap: 10px; }
  .ds-entry-axis .ds-entry-cell { flex: 1 1 100%; min-width: 0; }
  .ds-entry-axis .ds-entry-cell--add { flex: 1 1 100%; align-items: flex-start; }
  .ds-form-card .ds-updl-cell { justify-content: flex-start; }
}

/* [C1b] Two-row header — title line (+ SPT toggle / invoice icons) then a
   controls line [Party · Lead(sales) · Date · Upload-right]. Keeps the
   sibling forms structural twins and stops Date stretching full-width. */
.ds-form-card .card-body > .ds-form-head {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 14px;
}
.ds-form-head > .page-title { flex: 0 0 auto; margin: 0; }
.ds-form-head > .page-title h4 { margin: 0; }
.ds-form-head > .ds-spt-toggle { display: flex; align-items: center; gap: 10px; margin: 0; }
.ds-form-head > .ds-spt-toggle > label { margin: 0; white-space: nowrap; }
.ds-form-head > .wordset { margin: 0; }
.ds-form-card .card-body > .page-header.row.ds-form-controls { margin-bottom: 4px; }
.ds-form-card .ds-form-controls > [class*="col-"] { flex: 1 1 180px; max-width: none; }
.ds-form-card .ds-form-controls > .ds-updl-cell { flex: 0 0 auto; }
.ds-form-card .ds-form-controls #date_time_filter { width: 100%; }

/* =============================================================================
   ===  AUDIT WAVE B  — template/JS polish (#89). Self-contained section.     ===
   ===  A parallel wave also appends CSS below/above; keep this block intact. ===
   ============================================================================= */

/* [B1] Groups SLABS count link + customer sales-amount link: plum, not raw
   Bootstrap-info cyan (which the retired text-info shipped !important). Mirrors
   the products qty/tier link treatment [C4]. */
.table td a.sales-amount-link, table.dataTable td a.sales-amount-link {
  color: var(--ds-accent) !important; font-weight: 600;
}
.table td a.sales-amount-link:hover, table.dataTable td a.sales-amount-link:hover {
  color: var(--ds-accent-hover) !important;
}

/* [B5] Toolbar normalization: right-docked cluster inside .ds-filterbar that
   holds export + page-size, so page-size docks right on the SAME flex row (no
   stranded .wordset row). Replaces the per-page .wordset containers. */
.ds-filterbar .ds-fb-end {
  margin-left: auto; display: inline-flex; align-items: center; gap: 10px;
}
.ds-filterbar .ds-fb-end > .page-length,
.ds-filterbar .ds-fb-end > .dt-page-length,
.ds-filterbar .ds-fb-end > .page-dropdown { margin-left: 0; display: inline-flex; align-items: center; }
.ds-filterbar .ds-fb-end .btn { height: var(--ctl-h); display: inline-flex; align-items: center; justify-content: center; }
.ds-filterbar .ds-fb-end select[name$="_length"] {
  width: auto; min-width: 64px; max-width: 82px; padding: 0 8px; text-align: center;
  height: var(--ctl-h); border-radius: var(--radius-pill);
  background-color: var(--ds-surface-2); border: 1px solid var(--ds-border); color: var(--ds-ink-2);
}
/* Analysis SPT filters aren't a .ds-filterbar; dock its page-size chip right too. */
.ds-analysis-filters .page-length { margin-left: auto; }
.ds-analysis-filters .page-length select[name$="_length"] {
  width: auto; min-width: 64px; max-width: 82px; padding: 0 8px; text-align: center;
}

/* [B6b] Sidebar people-icon SVGs ship width="24" height="24"; the base rule sets
   width:18 but not height, so they render 18x24 and inflate the row to 40px.
   Constrain to an 18x18 box so those rows match the 36px img-icon rows — this
   also evens out the collapsed section-gap pitch [B6c]. */
.sidebar .sidebar-menu > ul > li > a svg { height: 18px; flex: 0 0 18px; }

/* [B7] Notifications dropdown: wider panel, themed Clear-All, muted empty state,
   and hide the count badge when it reads 0/empty. */
.dropdown-menu.notifications { width: 320px; min-width: 320px; }
.topnav-dropdown-header .clear-noti {
  color: var(--ds-accent); font-weight: 600; padding: 3px 10px;
  border-radius: var(--radius-pill); text-decoration: none;
}
.topnav-dropdown-header .clear-noti:hover { background: var(--ds-accent-tint); color: var(--ds-accent-hover); }
.ds-noti-empty { display: block; padding: 26px 15px; text-align: center; font-size: 13px; color: var(--ds-muted); }
.noti-content .live_notify_list:not(:empty) ~ .ds-noti-empty { display: none; }
.live_notify_badge.is-empty { display: none !important; }

/* [B8] Assembled control aligns like the other ds-switch pills. */
.ds-assembled-check { display: inline-flex; align-items: center; min-height: var(--ctl-h); }

/* [B9] Lead-user cell: ghost/outline initials chip (32x32, r8) instead of a
   solid-colour avatar square, so it reads with the outline icon buttons. */
.ds-leaduser .ds-ci.ds-ci-ghost {
  background: transparent !important; border: 1px solid var(--ds-border-strong);
  color: var(--ds-ink-2); width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: 8px; font-size: 12px; font-weight: 600;
}

/* [B10] Sticky last-column seam should only show when the table actually
   overflows horizontally. ds-render.js toggles .ds-scrollx on .table-responsive;
   without it, hide the seam/shadow. */
.table-responsive:not(.ds-scrollx) table > tbody > tr > td:last-child,
.table-responsive:not(.ds-scrollx) table > thead > tr > th:last-child,
.table-responsive:not(.ds-scrollx) table > tfoot > tr > th:last-child {
  border-left-color: transparent;
}

/* =============================================================================
   AUDIT WAVE A — systemic spacing / sizing normalization (#89)
   CSS-ONLY. A 4-agent measured audit found recurring drift across list tables,
   toolbars, pills, drawers and the dashboard. Every rule below is appended
   last so it wins the cascade at equal-or-higher specificity vs the earlier
   layers it corrects. Numbers in comments are the measured "before" values.
   ============================================================================= */

/* ---- [A-1] Numeric header/value right-edge alignment (every list table).
   Before: thead th padding-right 20 (sort-caret reserve) vs tbody td
   padding-right 9 → right-aligned values sat +11px right of their right-aligned
   headers. Fix: one shared right padding (12px) on th/td/tfoot-th so the right
   edges line up, and pull the faint sort carets tight to the edge so they still
   fit inside the reduced reserve (measured caret glyph ~5px @ 8px/opacity.2). ---- */
.table-responsive table.dataTable > thead > tr > th:not(.sorting_disabled),
table.dataTable > thead > tr > th:not(.sorting_disabled) { padding-right: 12px; }
.table-responsive table > tbody > tr > td,
.table-responsive table > tfoot > tr > th { padding-right: 12px; }
table.dataTable > thead .sorting:before, table.dataTable > thead .sorting:after,
table.dataTable > thead .sorting_asc:before, table.dataTable > thead .sorting_asc:after,
table.dataTable > thead .sorting_desc:before, table.dataTable > thead .sorting_desc:after,
table.dataTable > thead .sorting_asc_disabled:before, table.dataTable > thead .sorting_desc_disabled:after {
  right: 4px;
}

/* Rojmed: thead th were CENTERED over right-aligned money cells (30-50px off).
   Right-align every numeric header (all but the first Username column) so each
   header sits over its column, and force tfoot totals onto one line (a long
   "-₹16,96,946.95" was wrapping to two rows). ---- */
/* rojmed-class.js headerCallback adds .text-center (Bootstrap !important) to
   every th on each draw — override the numeric ones with id+!important. */
#rojmed_list_table thead th:not(:first-child),
#rojmed_list_table tfoot th:not(:first-child) { text-align: right !important; }
#rojmed_list_table tfoot th { white-space: nowrap; }

/* ---- [A-2] One search-input recipe. Before: the toolbar search rendered
   radius 20/8, font 12.5/13.5, pad-left 8/38, width 93/200 depending on whether
   the input sat in a .search-input wrapper. This single rule (specificity
   0,0,3,1, placed last, matches every .form-control[type=search] in a
   .ds-filterbar) normalizes all of them: pill radius, 13px, 38px pad-left for
   the inline magnifier icon, one width. ---- */
.ds-filterbar input[type=search].form-control {
  height: var(--ctl-h);
  width: 200px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  padding: 0 14px 0 38px;
  background-color: var(--ds-surface-2);
  border: 1px solid var(--ds-border);
  color: var(--ds-ink-2);
}
@media (max-width: 575px) { .ds-filterbar input[type=search].form-control { width: 100%; } }

/* ---- [A-3] One pill system. Before: .ds-typepill (Customers/Suppliers type,
   Users role, Misc category) rendered r7/h26 while the status pills on
   Sales/Purchase/Customers (.ds-pill) render r20/h24. Unify the geometry to the
   pill metrics; colours/border/type are unchanged. ---- */
.ds-typepill {
  height: 24px; padding: 0 10px;
  border-radius: var(--radius-pill);
  line-height: 1;
}

/* ---- [A-4] Row rhythm. Before: long company/name/description text wrapped to
   two lines, producing interleaved 62/78px rows (Sales / Customers / Misc). Cap
   the avatar-cell text block (dsAvatarCell → .ds-cust .ds-cmeta) and the Misc
   remarks cell to one ellipsized line so every row stays a uniform 62px. ---- */
.ds-cust .ds-cmeta { max-width: 230px; }
.ds-cust .ds-cmeta b, .ds-cust .ds-cmeta small {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ds-cust .ds-cmeta small { font-size: 12px; }   /* [A-5] normalize list sublines to 12px */
/* Non-avatar list body cells: keep on ONE line so long values (e.g. Sales
   "Login-Payment" = "PS - MC-KOTAK") widen the column + scroll rather than
   wrap a row to 71px. Higher specificity than the earlier nowrap so it wins
   over the per-page inline `table.dataTable td{white-space:normal}` blocks. */
.table-responsive table > tbody > tr > td:not(:has(.ds-cust)) { white-space: nowrap !important; }
#miscellaneous_transaction_table tbody td:nth-child(3) {
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---- [A-5] Off-scale token leaks. ds-chip-sm / ds-ai radius 9→10 (10px scale);
   Analysis & Rojmed card <h4> 24px→18px to match the dashboard .card-title;
   btn-added pinned to the control token (some render outside .btn at ~40px). ---- */
.ds-chip-sm, .ds-alert .ds-ai { border-radius: 10px; }
.card-header h4 { font-size: 18px; margin: 0; }
.btn-added, .btn.btn-added { height: var(--ctl-h); }

/* ---- [A-6] DataTables empty state (td.dataTables_empty exists in the plugin
   markup) — centered, muted, generous padding so "no records" reads as a state,
   not a stray cell. ---- */
table.dataTable td.dataTables_empty, td.dataTables_empty {
  text-align: center; color: var(--ds-muted);
  padding: 44px 16px; font-size: 13.5px; white-space: normal;
}

/* ---- [A-7] Drawer label gaps. Customer/Supplier drawer <label>s sat flush on
   their inputs (0px). Give the sectioned drawer labels a 6px bottom margin.
   Scoped to .ds-dsection and excluding the .btn radio labels (Status Active/In
   Active) so those stay inline. The payment drawer uses .form-label (its own
   8px) and is untouched — no double gap. ---- */
.modal.ds-drawer .ds-dsection label:not(.btn):not(.form-check-label) {
  display: inline-block; margin-bottom: 6px;
}

/* ---- [A-8] view-sales Payments table (#payments_table): the Amount column was
   left-aligned and the header carried a heavy dark rule. Right-align the money
   column and soften the header underline to the list-table hairline. ---- */
#payments_table th:nth-child(2), #payments_table td:nth-child(2) { text-align: right; }
#payments_table thead th { border-bottom: 1px solid var(--ds-border); }

/* ---- [A-9] Dashboard. (a) KPI tile row had a 24px horizontal gutter but only
   ~8px vertical gap on wrap → give the tile row a balanced 16px row-gap.
   (b) Top-performers segmented tabs: a roomier, consistent wrap gap so the 4+1
   wrap reads intentional. Card-header baseline offset ("Sales & Profit" vs
   "Company Balance") is resolved by the [A-5] h4→18px normalization. ---- */
.row:has(> [class*="col-"] > .dash-widget) { row-gap: 16px; }
.ds-perftabs { gap: 4px; }

/* ---- [A-10] Misc small.
   (a) Action-column cells uniform centre-aligned across list pages.
   (b) Product-drawer supplier <select> ("Select Supplier") pad-left 12→8 to
       match the slab inputs.
   (c) Slab-table delete icon: keep it muted (hover red) like the supplier
       table (already muted in markup; pinned here defensively at id
       specificity so no inline red can leak back). ---- */
.table-responsive table > tbody > tr > td:last-child,
.table-responsive table > thead > tr > th:last-child { text-align: center; }
.ds-supplier-table td .form-select { padding-left: 8px; }
#tier-price td .delete-slab { color: var(--ds-muted); }
#tier-price td .delete-slab:hover { color: var(--ds-due); }

/* =============================================================================
   GLOBAL SEARCH — ⌘K topbar search (wireframe #89)
   Centered recessed field in the header with a right-aligned ⌘K chip, plus a
   results dropdown. Field styling ports the prototype .search rule
   (docs/Moments-BMS-Redesign.html) onto ds- tokens; the panel is ds-native.
   Desktop-only (the markup carries d-lg-flex); never shown on the mobile header.
   ============================================================================= */
.ds-topsearch {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  height: 60px;
  width: 100%;
  max-width: 440px;
  align-items: center;
  z-index: 5;
}
.ds-topsearch-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 7px 11px;
  background: var(--ds-surface-2);
  border: 1px solid var(--ds-border);
  border-radius: 9px;
  color: var(--ds-muted);
  cursor: text;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.ds-topsearch-field:focus-within {
  border-color: var(--ds-accent);
  background: var(--ds-surface);
  box-shadow: 0 0 0 3px var(--ds-accent-tint);
}
.ds-topsearch-field svg { width: 15px; height: 15px; flex: 0 0 auto; }
.ds-topsearch-field input {
  border: 0;
  background: transparent;
  color: var(--ds-ink);
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  outline: none;
  padding: 0;
  height: auto;
}
.ds-topsearch-field input::placeholder { color: var(--ds-muted); opacity: 1; }
.ds-topsearch-kbd {
  font-family: var(--ds-mono);
  font-size: 11px;
  line-height: 1.4;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--ds-muted);
  flex: 0 0 auto;
}

/* ---- Results dropdown ---- */
.ds-search-panel {
  position: absolute;
  top: 52px;
  left: 0;
  width: 100%;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--radius);
  box-shadow: var(--ds-shadow-md);
  padding: 6px;
  z-index: 1001;
}
.ds-search-panel[hidden] { display: none; }
.ds-search-group + .ds-search-group { margin-top: 4px; }
.ds-search-group-head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--ds-muted);
  font-weight: 600;
  padding: 8px 10px 4px;
}
.ds-search-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  color: var(--ds-ink);
}
.ds-search-row:hover,
.ds-search-row.is-active {
  background: var(--ds-accent-tint);
}
.ds-search-row .ds-search-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ds-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ds-search-row .ds-search-sub {
  font-size: 12px;
  color: var(--ds-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ds-search-empty {
  padding: 16px 12px;
  text-align: center;
  color: var(--ds-muted);
  font-size: 13px;
}
/* Loading shimmer rows */
.ds-search-shimmer { padding: 8px 10px; }
.ds-search-shimmer .bar {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--ds-surface-2) 25%, var(--ds-border) 37%, var(--ds-surface-2) 63%);
  background-size: 400% 100%;
  animation: ds-search-shine 1.2s ease infinite;
  margin-bottom: 8px;
}
.ds-search-shimmer .bar:nth-child(odd) { width: 70%; }
.ds-search-shimmer .bar:nth-child(even) { width: 45%; }
@keyframes ds-search-shine {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .ds-search-shimmer .bar { animation: none; }
}
/* Keep the centered field from colliding with a long breadcrumb / user cluster
   on mid-width desktops — shrink it before it can overlap. */
@media (max-width: 1200px) { .ds-topsearch { max-width: 340px; } }
@media (max-width: 1050px) { .ds-topsearch { max-width: 260px; } }
/* ============================================================
   GUIDED ENTRY — quick-add customer/supplier + inline search
   (add-sales / add-purchase). New selectors only; no overrides.
   ============================================================ */
.qa-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.qa-label-row > label { margin: 0; }
.qa-newbtn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  color: var(--ds-accent);
  border: 1px dashed var(--ds-accent);
  border-radius: 6px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.qa-newbtn:hover {
  background: var(--ds-accent);
  color: #fff;
  border-style: solid;
}
.qa-newbtn i { font-size: 11px; }

.qa-similar {
  background: var(--ds-warn-bg);
  border: 1px solid var(--ds-warn);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.qa-similar-head {
  color: var(--ds-warn);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
}
.qa-similar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-top: 1px solid var(--ds-border);
}
.qa-similar-item:first-of-type { border-top: 0; }
.qa-similar-name {
  color: var(--ds-ink);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qa-use-btn {
  flex: 0 0 auto;
  background: var(--ds-accent);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.qa-use-btn:hover { background: var(--ds-accent-hover); }

/* =============================================================================
   SEARCH / TOOLBAR POLISH (#89) — branch polish-search-toolbars. CSS-ONLY.
   (1) inline search magnifier vertically centered on EVERY list search box via
   flex + translateY (retires the drift-prone hardcoded top:9px). (2) toolbar
   consolidation so filter rows fit at 1440 (slimmer multiselect chips, CDF +
   Analysis-SPT single-row docking). (3) Users BALANCE verify button → ghost
   icon-button. Appended last so it wins the cascade at equal specificity.
   ============================================================================= */

/* ---- [SP-1] Inline search magnifier — centered, uniform across all lists.
   The .search-input wrapper carries an absolutely-positioned .btn-searchset img
   icon; center it on the input's y-axis with translateY(-50%) instead of the
   old fixed top:9px/left:10px (which sat low-left when --ctl-h changed). Matches
   the earlier-file specificity (.scope .search-input .btn-searchset = 0,0,3,0)
   and loads later, so it wins. pointer-events:none so clicks reach the input. */
.ds-filterbar .search-input,
.search-set .search-input,
.ds-analysis-filters .search-input { position: relative; display: inline-flex; align-items: center; }
.ds-filterbar .search-input .btn-searchset,
.search-set .search-input .btn-searchset,
.ds-analysis-filters .search-input .btn-searchset {
  position: absolute; left: 12px; top: 50%; right: auto;
  transform: translateY(-50%);
  margin: 0; padding: 0; border: 0; box-shadow: none;
  background: transparent !important;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 0; pointer-events: none;
}
.ds-filterbar .search-input .btn-searchset img,
.search-set .search-input .btn-searchset img,
.ds-analysis-filters .search-input .btn-searchset img { width: 15px; height: 16px; display: block; }
/* input reserves room for the icon on every toolbar variant */
.ds-filterbar .search-input input[type=search],
.ds-filterbar .search-input input[type=search].form-control,
.search-set .search-input input[type=search],
.ds-analysis-filters .search-input input[type=search].form-control-sm { padding-left: 36px; }

/* ---- [SP-2] Filter-row fit at 1440. Slimmer multiselect chips (160→140) so the
   Sales lead-user chip no longer forces an unbalanced wrap; the summary text
   still ellipsizes. bootstrap-multiselect stamps inline width:100% on the button,
   so the fixed width must live on the .ds-ms-group wrapper (button fills it). ---- */
.ds-filterbar .ds-ms-group { width: 140px; }
.ds-filterbar .ds-ms-group .ds-ms-btn,
.ds-filterbar .ds-ms-group button.multiselect { width: 100%; min-width: 0; }

/* ---- [SP-3] Customers CDF (Unverified) toolbar: was a bare .row split into
   col-md-8 (search) / col-md-4 (Manage References etc.) → a big blank band and
   a 3-row fragment. Flatten to one .ds-filterbar flex row with a right-docked
   .ds-fb-end cluster (search left, actions right, no col-* gap). ---- */
.ds-filterbar.ds-cdf-bar { width: 100%; }

/* ---- [SP-4] Analysis-SPT filter row: the page-size chip carried margin-left:auto
   which flung it to the far right of whatever line it wrapped onto, stranding the
   download icon alone on row-2-left and "10" on row-2-right. Drop the auto so the
   trailing controls (submit, Reset, download, page-size) stay one contiguous
   cluster — download sits beside Reset, page-size right after it. ---- */
.ds-analysis-filters .page-length { margin-left: 0; }
.ds-analysis-filters #main_table_download { margin-left: 0; }

/* ---- [SP-5] Users BALANCE verify button. Was a solid btn-success/btn-danger
   pill; retreat to a 32x32 r8 ghost icon-button (muted default, intent colour
   on hover) mirroring the customer LEAD USER ghost chip [B9]. ---- */
.ds-verify-btn, .btn.ds-verify-btn {
  width: 32px; height: 32px; padding: 0; margin-left: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid var(--ds-border-strong);
  background: transparent; color: var(--ds-muted); line-height: 0;
  box-shadow: none;
}
.ds-verify-btn i { font-size: 14px; }
.ds-verify-btn.is-ok { color: var(--ds-pos); }
.ds-verify-btn.is-ok:hover { border-color: var(--ds-pos); background: var(--ds-pos-bg); color: var(--ds-pos); }
.ds-verify-btn.is-warn { color: var(--ds-due); border-color: var(--ds-due); }
.ds-verify-btn.is-warn:hover { border-color: var(--ds-due); background: var(--ds-due-bg); color: var(--ds-due); }

/* ---- [SP-6] Sales / Purchase list fit at 1440. With Previous Due + Total Due +
   Other Payment removed (derived-ledger cleanup — those were chained/stale stored
   fields, not the canonical derived party balance), the remaining 11 columns fit
   the container once the avatar customer cell is capped and cell padding trimmed.
   width:100% overrides the DataTables autoWidth inline px so the table never
   overflows → no sticky-ACTION clip, no horizontal scroll on the default view. ---- */
#sales_list_table.dataTable, #purchase_list_table.dataTable { width: 100% !important; }
#sales_list_table .ds-cust .ds-cmeta,
#purchase_list_table .ds-cust .ds-cmeta { max-width: 148px; }
#sales_list_table > thead > tr > th, #sales_list_table > tbody > tr > td, #sales_list_table > tfoot > tr > th,
#purchase_list_table > thead > tr > th, #purchase_list_table > tbody > tr > td, #purchase_list_table > tfoot > tr > th {
  padding-left: 7px; padding-right: 8px;
}
#sales_list_table .btn-rounded.btn-sm, #purchase_list_table .btn-rounded.btn-sm { margin-left: 3px; }
/* let the long "Login User / Payment User" header wrap so it stops forcing a
   ~190px column (data in it is short) — the last lever to fit Purchase at 1440. */
#sales_list_table > thead > tr > th, #purchase_list_table > thead > tr > th { white-space: normal; }

/* ---- [SP-7] Tabs + filter row on ONE line where they fit at 1440. The status
   pills and the filter chips were always stacked (pills row, then a half-empty
   filter row = dead band, e.g. Suppliers). Wrap both in .ds-toolhead (flex-wrap):
   pills left, filter chips flow after, right-cluster (export/page-size) docks
   right via the filterbar's own .ds-fb-end. When the combined width exceeds the
   row it wraps back to the original two-row stack, balanced. Tab markup/ids are
   unchanged (tab JS binds by id). ---- */
.ds-toolhead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 16px; }
.ds-toolhead > .ds-status-tabs { margin: 0; flex: 0 0 auto; }
.ds-toolhead > .table-top { flex: 1 1 auto; margin: 0; min-width: 0; }
.ds-toolhead > .search-set { flex: 1 1 auto; margin: 0; min-width: 0; }
.ds-toolhead > .table-top > .ds-filterbar { margin: 0; }

/* 