/* =============================================================================
   Artsays dashboards — UI layer
   Super Admin · Artist · Seller

   Loaded AFTER main.css (see public/index.html). Everything here is scoped to
   #wrapper (the dashboard frame) or body.dashboard-shell (added by
   src/Component/Dashboard/Shared/DashboardShell.jsx, so modals and menus that
   React portals into <body> are styled too). Nothing here touches the public
   site.

   The shell breakpoint is 992px. Keep it in step with SHELL_DESKTOP_MIN in
   src/Component/Dashboard/Sidebar/Handletooglesidebar.jsx.

   Colours come from main.css's theme variables (--primary-color, dark mode and
   high-contrast mode), so those switches keep working.
   ========================================================================== */

/* ── 1. Tokens ─────────────────────────────────────────────────────────────── */
body.dashboard-shell,
#wrapper {
  --sb-w: 264px;
  --bar-h: 64px;

  --ui-font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ui-font-display: Merriweather, Georgia, serif;

  --ui-canvas: #f6f3ef;
  --ui-surface: var(--card-color, #ffffff);
  --ui-surface-2: #faf8f5;
  --ui-border: #e8e2da;
  --ui-border-strong: #d6cec4;
  --ui-text: #2b211b;
  --ui-text-2: #62564e;
  --ui-muted: #776c64;

  --ui-brand: var(--primary-color, #48372d);
  --ui-brand-ink: var(--primary-color, #48372d);
  --ui-brand-soft: rgba(72, 55, 45, 0.08);
  --ui-accent: var(--secondary-color, #fb5934);
  --ui-accent-soft: rgba(251, 89, 52, 0.1);

  --ui-success: #1c8f60;
  --ui-warning: #d98e04;
  --ui-danger: #d13b3b;
  --ui-info: #22799f;

  --ui-radius: 16px;
  --ui-radius-md: 12px;
  --ui-radius-sm: 10px;
  --ui-shadow-sm: 0 1px 2px rgba(43, 33, 27, 0.05), 0 1px 3px rgba(43, 33, 27, 0.04);
  --ui-shadow: 0 8px 28px rgba(43, 33, 27, 0.1);
  --ui-ring: 0 0 0 3px rgba(251, 89, 52, 0.25);
}

html[data-theme="dark"] body.dashboard-shell,
html[data-theme="dark"] #wrapper {
  --ui-canvas: #16171a;
  --ui-surface: #212327;
  --ui-surface-2: #292b30;
  --ui-border: #34373d;
  --ui-border-strong: #454951;
  --ui-text: #eeeae6;
  --ui-text-2: #c3bfba;
  --ui-muted: #9ca1a7;
  --ui-brand: #8a6a55;
  --ui-brand-ink: #e4c9b4;
  --ui-brand-soft: rgba(228, 201, 180, 0.1);
  --ui-accent-soft: rgba(251, 89, 52, 0.16);
  --ui-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --ui-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

html[data-theme="high-contrast"] body.dashboard-shell,
html[data-theme="high-contrast"] #wrapper {
  --ui-canvas: #000;
  --ui-surface: #000;
  --ui-surface-2: #0d0d0d;
  --ui-border: #fff;
  --ui-border-strong: #fff;
  --ui-text: #fff;
  --ui-text-2: #fff;
  --ui-muted: #e6e6e6;
  --ui-brand: #fff;
  --ui-brand-ink: #fff;
  --ui-brand-soft: rgba(255, 255, 255, 0.14);
}

/* ── 2. Base ───────────────────────────────────────────────────────────────── */
#wrapper {
  min-height: 100vh;
  background: var(--ui-canvas);
  color: var(--ui-text-2);
  font-family: var(--ui-font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Icon fonts set their own family through class selectors, so inheriting the
   UI font from the wrapper can't break them. */
#wrapper h1, #wrapper h2, #wrapper h3 {
  font-family: var(--ui-font-display);
  color: var(--ui-text);
  letter-spacing: -0.005em;
}
#wrapper h4, #wrapper h5, #wrapper h6 {
  font-family: var(--ui-font);
  color: var(--ui-text);
  font-weight: 700;
}
#wrapper a:not(.btn):not(.badge):not(.dropdown-item):not(.page-link) { color: var(--ui-brand-ink); }
#wrapper a:not(.btn):not(.badge):not(.dropdown-item):not(.page-link):hover { color: var(--ui-accent); }
#wrapper .text-muted { color: var(--ui-muted) !important; }
#wrapper table,
#wrapper .number,
#wrapper .badge { font-variant-numeric: tabular-nums; }

#wrapper :focus-visible,
body.dashboard-shell .modal :focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: 2px;
}
#wrapper .form-control:focus-visible,
#wrapper .btn:focus-visible { outline: none; }

.shell-skip {
  position: absolute;
  left: 12px;
  top: 8px;
  clip-path: inset(50%);
  pointer-events: none;
  z-index: 3000;
  padding: 10px 16px;
  border-radius: var(--ui-radius-sm);
  background: var(--ui-text);
  color: var(--ui-surface) !important;
  font-weight: 600;
  text-decoration: none;
}
.shell-skip:focus { clip-path: none; pointer-events: auto; }

/* ── 3. Top bar ────────────────────────────────────────────────────────────── */
#wrapper .navbar-fixed-top {
  position: fixed;
  top: 0;
  left: var(--sb-w);
  right: 0;
  width: auto;
  height: var(--bar-h);
  padding: 0 28px;
  z-index: 1030;
  background: color-mix(in srgb, var(--ui-surface) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--ui-border);
  transition: left 0.25s ease;
}
body.layout-fullwidth #wrapper .navbar-fixed-top { left: 0; width: auto; }

/* Bootstrap's .navbar is itself a flex container; make the bar fill it. */
#wrapper .navbar-fixed-top { display: block; }
#wrapper .shell-bar {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1600px;
  margin: 0 auto;
}

.shell-icon-btn,
.shell-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  background: var(--ui-surface);
  color: var(--ui-text-2);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.shell-icon-btn { width: 40px; padding: 0; font-size: 16px; }
.shell-pill-btn { gap: 8px; padding: 0 16px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.shell-icon-btn:hover,
.shell-pill-btn:hover { background: var(--ui-surface-2); border-color: var(--ui-border-strong); color: var(--ui-text); }
.shell-pill-btn { border-color: var(--ui-accent); color: color-mix(in srgb, var(--ui-accent) 68%, var(--ui-text)); }
.shell-pill-btn:hover { background: var(--ui-accent); border-color: var(--ui-accent); color: #fff; }
.shell-pill-btn.is-warning { border-color: var(--ui-warning); color: color-mix(in srgb, var(--ui-warning) 60%, var(--ui-text)); }
.shell-pill-btn.is-warning:hover { background: var(--ui-warning); color: #fff; }

#wrapper .shell-brand {
  font-size: 26px;
  line-height: 1;
  color: var(--ui-brand-ink);
  text-decoration: none;
  white-space: nowrap;
  padding: 0 4px;
}
#wrapper .shell-brand:hover { color: var(--ui-accent); }

.shell-search { flex: 1 1 auto; max-width: 460px; min-width: 0; margin-left: 12px; }
.shell-search > div { width: 100%; }
.shell-search .search-form {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  width: 100%;
}
#wrapper .shell-search .form-control {
  height: 40px;
  width: 100%;
  padding: 0 40px 0 40px;
  border-radius: 999px;
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-border);
  font-size: 13.5px;
}
#wrapper .shell-search .form-control:focus { background: var(--ui-surface); }
.shell-search .shell-search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ui-muted);
  pointer-events: none;
  font-size: 13px;
}
#wrapper .shell-search .search-form .btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ui-border);
  color: var(--ui-text-2);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.shell-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.shell-search-btn { display: none; }
#wrapper .shell-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
#wrapper .shell-menu > li { display: flex; align-items: center; margin: 0; }

/* ── 4. Sidebar ────────────────────────────────────────────────────────────── */
#wrapper #left-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--sb-w);
  height: auto;
  padding: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--ui-surface);
  border-right: 1px solid var(--ui-border);
  box-shadow: none;
  transform: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
body.layout-fullwidth #wrapper #left-sidebar { left: 0; transform: translateX(-102%); }
/* main.css forces .sidebar.open to z-index 999 !important, which is under the
   drawer overlay; the sidebar must sit above it. */
#wrapper #left-sidebar,
#wrapper #left-sidebar.open { left: 0 !important; z-index: 1040 !important; }

.shell-profile { padding: 18px 16px 6px; position: relative; flex: 0 0 auto; }
.shell-drawer-close {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface);
  color: var(--ui-text-2);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.shell-user { position: relative; display: flex; align-items: center; gap: 12px; }
.shell-avatar {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--ui-surface), 0 0 0 3px var(--ui-border-strong);
}
.shell-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; background: var(--ui-surface-2); }
.shell-avatar-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ui-surface);
}
.shell-avatar-badge.is-verified { background: #2aa8e0; }
.shell-avatar-badge.is-unverified { background: var(--ui-danger); }

.shell-user-toggle {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin: -6px -8px;
  border: 0;
  border-radius: var(--ui-radius-sm);
  background: transparent;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.shell-user-toggle:hover { background: var(--ui-surface-2); }
.shell-user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 3px; }
.shell-user-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--ui-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shell-user-role {
  align-self: flex-start;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--ui-brand-soft);
  color: var(--ui-brand-ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.shell-user-caret { color: var(--ui-muted); transition: transform 0.2s; }
.shell-user-toggle[aria-expanded="true"] .shell-user-caret { transform: rotate(180deg); }

.shell-user-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 5;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  box-shadow: var(--ui-shadow);
}
.shell-user-menu a,
.shell-user-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--ui-radius-sm);
  background: transparent;
  color: var(--ui-text-2);
  font: inherit;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.shell-user-menu a:hover,
.shell-user-menu button:hover { background: var(--ui-surface-2); color: var(--ui-text); }
.shell-user-menu i { width: 16px; text-align: center; color: var(--ui-muted); }

.shell-profile-note { margin: 10px 0 0; font-size: 12px; color: var(--ui-muted); }
.shell-profile-note button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ui-accent);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

/* Loading placeholders (CSS only — no Tailwind on dashboard routes). */
.shell-skel {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--ui-border) 25%, var(--ui-surface-2) 37%, var(--ui-border) 63%);
  background-size: 400% 100%;
  animation: shell-shimmer 1.3s ease infinite;
}
.shell-skel-line { height: 11px; margin: 4px 0; }
@keyframes shell-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.shell-menu-skel { list-style: none; margin: 0; padding: 4px 0; }
.shell-menu-skel li { display: flex; align-items: center; gap: 12px; padding: 12px; }
.shell-skel-icon { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 7px; }
.shell-menu-skel .shell-skel-line { margin: 0; height: 12px; }

/* Menu / settings switch */
#wrapper #left-sidebar .sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 12px 28px;
  scrollbar-width: thin;
  scrollbar-color: var(--ui-border-strong) transparent;
}
#wrapper #left-sidebar .sidebar-scroll::-webkit-scrollbar { width: 6px; }
#wrapper #left-sidebar .sidebar-scroll::-webkit-scrollbar-thumb { background: var(--ui-border-strong); border-radius: 6px; }

.shell-tabs {
  display: flex;
  gap: 4px;
  margin: 8px 0 12px;
  padding: 4px;
  border-radius: var(--ui-radius-md);
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-border);
}
.shell-tab {
  flex: 1 1 auto;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ui-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.shell-tab-icon { flex: 0 0 40px; padding: 0; }
.shell-tab:hover { color: var(--ui-text); }
.shell-tab.is-active { background: var(--ui-surface); color: var(--ui-brand-ink); box-shadow: var(--ui-shadow-sm); }

/* Menu */
#wrapper .sidebar-nav ul,
#wrapper .sidebar-nav .metismenu { list-style: none; margin: 0; padding: 0; }
#wrapper .sidebar-nav .metismenu { display: block; }
#wrapper .sidebar-nav .metismenu > li {
  display: block;
  flex: none;
  margin: 2px 0;
  border-radius: var(--ui-radius-md);
  background: transparent;
}
#wrapper .sidebar-nav .metismenu > li.active { background: var(--ui-brand-soft); border-radius: var(--ui-radius-md); }

#wrapper .sidebar-nav .metismenu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 40px 10px 12px;
  border-radius: var(--ui-radius-sm);
  color: var(--ui-text-2);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  outline: 0;
  transition: background 0.15s, color 0.15s;
}
#wrapper .sidebar-nav .metismenu a:hover { background: var(--ui-surface-2); color: var(--ui-text); text-decoration: none; }
#wrapper .sidebar-nav .metismenu > li > a i {
  flex: 0 0 22px;
  width: 22px;
  text-align: center;
  font-size: 15px;
  color: var(--ui-muted);
  transition: color 0.15s;
}
#wrapper .sidebar-nav .metismenu > li.active > a,
#wrapper .sidebar-nav .metismenu > li .active > a {
  color: var(--ui-brand-ink);
  font-weight: 700;
  border-radius: var(--ui-radius-sm);
}
#wrapper .sidebar-nav .metismenu > li.active > a i { color: var(--ui-accent); }
#wrapper .sidebar-nav .metismenu > li.active > a:hover { background: transparent; }

/* the arrow follows the real open state, not the URL-active state */
#wrapper .metismenu .has-arrow::after {
  right: 14px;
  font-size: 11px;
  color: var(--ui-muted);
  transform: translateY(-50%);
  transform-origin: center;
  top: 50%;
}
#wrapper .metismenu .active > .has-arrow::after,
#wrapper .metismenu .has-arrow[aria-expanded="true"]::after { transform: translateY(-50%); }
#wrapper .metismenu li:has(> ul.in) > .has-arrow::after { transform: translateY(-50%) rotate(180deg); }

/* sub menu */
#wrapper .sidebar-nav .metismenu > li ul { margin: 0 0 6px; padding: 0 0 0 0; }
#wrapper .sidebar-nav .metismenu > li ul li {
  opacity: 1;
  transform: none;
  animation: none;
  position: relative;
}
#wrapper .sidebar-nav .metismenu ul.collapse { display: none; position: relative; margin-left: 22px; padding-left: 12px; border-left: 1px solid var(--ui-border-strong); }
#wrapper .sidebar-nav .metismenu ul.collapse.in { display: block; }
#wrapper .sidebar-nav .metismenu ul a {
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ui-text-2);
}
#wrapper .sidebar-nav .metismenu > li ul a,
#wrapper .sidebar-nav .metismenu > li ul li.active > a { border-radius: 0; }
#wrapper .sidebar-nav .metismenu ul a::before { display: none; }
#wrapper .sidebar-nav .metismenu ul li.active > a {
  background: var(--ui-surface);
  color: var(--ui-accent);
  font-weight: 700;
  box-shadow: var(--ui-shadow-sm);
}

/* appearance settings */
.settings-panel-container { padding: 4px 4px 0; }
.settings-panel-container hr { display: none; }
.settings-panel-container ul { margin-top: 0 !important; }
.settings-panel-container li { padding: 10px 6px; border-bottom: 1px solid var(--ui-border); }
.settings-panel-container li:last-child { border-bottom: 0; }

/* ── 5. Frame ──────────────────────────────────────────────────────────────── */
#wrapper #main-content {
  float: none !important;
  width: auto !important;
  margin: var(--bar-h) 0 0 var(--sb-w) !important;
  padding: 18px 20px 0 !important;
  min-height: calc(100vh - var(--bar-h));
  min-width: 0;
  background: transparent;
  transition: margin 0.25s ease;
}
body.layout-fullwidth #wrapper #main-content { margin-left: 0 !important; }
#wrapper #main-content > .flex-grow-1 { width: 100%; max-width: 1600px; margin: 0 auto; min-width: 0; }
#wrapper #main-content > .flex-grow-1 > .container-fluid { padding-left: 0; padding-right: 0; }

.shell-footer {
  margin-top: 28px !important;
  margin-bottom: 0 !important;
  padding: 18px 0 22px;
  border-top: 1px solid var(--ui-border);
  text-align: center;
  color: var(--ui-muted);
  font-size: 12.5px;
}
.shell-footer a { color: inherit; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1035;
  background: rgba(24, 16, 10, 0.5);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}

/* ── 6. Page header ────────────────────────────────────────────────────────── */
#wrapper .block-header { margin: 0 0 14px; padding: 0; }
#wrapper .block-header > .row { align-items: center; row-gap: 12px; }
#wrapper .block-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
#wrapper .block-header .breadcrumb {
  display: flex;
  flex-wrap: wrap;
  margin: 4px 0 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  font-size: 12px;
  color: var(--ui-muted);
}
#wrapper .breadcrumb-item { color: var(--ui-muted); }
#wrapper .breadcrumb-item a { color: var(--ui-text-2); text-decoration: none; }
#wrapper .breadcrumb-item a:hover { color: var(--ui-accent); }
#wrapper .breadcrumb-item.active { color: var(--ui-text-2); font-weight: 600; }
#wrapper .breadcrumb-item + .breadcrumb-item::before { color: var(--ui-border-strong); }

/* ── 7. Cards ──────────────────────────────────────────────────────────────── */
#wrapper .card {
  margin-bottom: 16px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
  color: var(--ui-text-2);
}
#wrapper .card > .header,
#wrapper .card .card-header {
  padding: 12px 16px 6px;
  border: 0;
  background: transparent;
}
#wrapper .card .header h2,
#wrapper .card .card-header h2,
#wrapper .card .card-title {
  margin: 0;
  font-family: var(--ui-font-display);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ui-text);
}
#wrapper .card .header h2 small {
  display: block;
  margin-top: 4px;
  font-family: var(--ui-font);
  font-size: 12.5px;
  font-weight: 400;
  color: var(--ui-muted);
}
#wrapper .card > .body,
#wrapper .card .card-body { padding: 12px 16px 16px; }
#wrapper .card > .body:has(> table),
#wrapper .card > .body:has(> .table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
#wrapper .card { min-width: 0; }
#wrapper [class*="col-"] { min-width: 0; }
#wrapper #main-content .row:not(.no-gutters) { margin-left: -10px; margin-right: -10px; }
#wrapper #main-content .row:not(.no-gutters) > [class*="col-"],
#wrapper #main-content .row:not(.no-gutters) > .col { padding-left: 10px; padding-right: 10px; }
#wrapper .row-deck > [class*="col-"] { display: flex; }
#wrapper .row-deck > [class*="col-"] > .card { width: 100%; }

/* KPI tiles ("top_widget"): text on the left, icon chip on the right — the
   icon used to sit on top of long labels. */
#wrapper .card.top_widget {
  container: kpi / inline-size;
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  color: #fff;
  box-shadow: var(--ui-shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
#wrapper .card.top_widget::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 100% at 100% 0%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 60%);
}
/* .primary-bg / .secondary-bg are the theme's tile colours; the plain .card
   surface above would otherwise win and leave white text on white. */
#wrapper .card.primary-bg { background: var(--primary-color, #48372d); }
#wrapper .card.secondary-bg { background: var(--secondary-color, #fb5934); }
/* Bootstrap-coloured tiles (Wallet Management etc.): same reason, plus their
   labels are plain divs that would otherwise take the dark body colour. */
#wrapper .card.top_widget.bg-primary { background: var(--primary-color, #48372d) !important; }
#wrapper .card.top_widget.bg-success { background: #1f8f5f !important; }
#wrapper .card.top_widget.bg-info { background: #1a8fa6 !important; }
#wrapper .card.top_widget.bg-danger { background: #cf3f4f !important; }
#wrapper .card.top_widget.bg-warning { background: #f2b01e !important; --tile-fg: #2b2116; }
#wrapper .card.top_widget .content,
#wrapper .card.top_widget .content > div,
#wrapper .card.top_widget .content > h4 { color: var(--tile-fg, #fff) !important; }
#wrapper .card.top_widget .content > .text-uppercase { font-weight: 700; letter-spacing: 0.08em; font-size: 11.5px !important; opacity: 0.92; }
#wrapper .card.top_widget:hover { transform: translateY(-2px); box-shadow: var(--ui-shadow); }
#wrapper .card.top_widget > .body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
}
#wrapper .top_widget .icon {
  position: static;
  order: 2;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  float: none;
}
#wrapper .top_widget .icon i { position: static; margin: 0; line-height: 1; font-size: 19px; }
#wrapper .top_widget .content { order: 1; flex: 1 1 auto; min-width: 0; margin: 0; padding: 0; text-align: left; }
#wrapper .top_widget .content .text {
  margin: 0 0 6px !important;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.3;
  opacity: 0.9;
  overflow-wrap: break-word;
}
#wrapper .top_widget .content .number,
#wrapper .top_widget .content h4 {
  margin: 0;
  font-family: var(--ui-font-display);
  font-size: clamp(16px, 7cqi, 24px);
  font-weight: 700;
  line-height: 1.1;
  color: inherit;
}
#wrapper .top_widget .content small { display: block; margin-top: 6px; font-size: 12px; opacity: 0.9; }

/* Narrow tiles (five across, or two per phone row): icon above, text full width. */
@container kpi (max-width: 235px) {
  #wrapper .card.top_widget > .body { flex-direction: column-reverse; align-items: stretch; gap: 8px; padding: 12px 14px; }
  #wrapper .top_widget .icon { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 11px; align-self: flex-end; }
  #wrapper .top_widget .icon i { font-size: 15px; }
  #wrapper .top_widget .content .text { font-size: 10.5px; letter-spacing: 0.06em; }
  #wrapper .top_widget .content .number,
  #wrapper .top_widget .content h4 { font-size: 18px; }
}

/* ── 8. Tables ─────────────────────────────────────────────────────────────── */
#wrapper .table-responsive {
  border-radius: var(--ui-radius-md);
  -webkit-overflow-scrolling: touch;
}
#wrapper .table {
  margin-bottom: 0;
  color: var(--ui-text-2);
  font-size: 13.5px;
}
#wrapper .table thead th,
#wrapper .table.thead-dark thead th,
#wrapper .thead-dark th {
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--ui-border);
  background: var(--ui-surface-2);
  color: var(--ui-muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}
#wrapper .table td,
#wrapper .table tbody th {
  padding: 8px 12px;
  border-top: 1px solid var(--ui-border);
  vertical-align: middle;
  color: var(--ui-text-2);
}
#wrapper .table tbody tr:first-child td { border-top: 0; }
#wrapper .table-hover tbody tr:hover,
#wrapper .table tbody tr:hover { background: var(--ui-surface-2); }
#wrapper .table-striped tbody tr:nth-of-type(odd) { background: transparent; }
#wrapper .table img { border-radius: 8px; }
#wrapper .table .btn-sm { white-space: nowrap; }

/* ── 9. Forms ──────────────────────────────────────────────────────────────── */
#wrapper .form-group { margin-bottom: 14px; }
#wrapper label,
#wrapper .form-label {
  margin-bottom: 5px;
  color: var(--ui-text);
  font-size: 12.5px;
  font-weight: 600;
}
#wrapper .form-control,
#wrapper .custom-select,
body.dashboard-shell .modal .form-control {
  height: 36px;
  padding: 5px 12px;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius-sm);
  background-color: var(--ui-surface);
  color: var(--ui-text);
  font-family: var(--ui-font);
  font-size: 13.5px;
  box-shadow: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#wrapper textarea.form-control { height: auto; min-height: 80px; line-height: 1.5; }
#wrapper .form-control-sm { height: 30px; padding: 3px 10px; font-size: 12.5px; border-radius: 8px; }
#wrapper .form-control::placeholder { color: var(--ui-muted); opacity: 1; }
#wrapper .form-control:focus,
#wrapper .custom-select:focus,
body.dashboard-shell .modal .form-control:focus {
  border-color: var(--ui-accent);
  box-shadow: var(--ui-ring);
  background-color: var(--ui-surface);
  color: var(--ui-text);
}
#wrapper .form-control:disabled,
#wrapper .form-control[readonly] { background-color: var(--ui-surface-2); color: var(--ui-muted); }
#wrapper .form-control.is-invalid { border-color: var(--ui-danger); }
#wrapper .input-group-text { border-color: var(--ui-border-strong); background: var(--ui-surface-2); color: var(--ui-text-2); }
#wrapper .form-check-input,
#wrapper input[type="checkbox"],
#wrapper input[type="radio"] { accent-color: var(--ui-accent); }
#wrapper .form-check-label { color: var(--ui-text-2); font-weight: 500; }
#wrapper .text-danger { color: var(--ui-danger) !important; }

/* ── 10. Buttons ───────────────────────────────────────────────────────────── */
#wrapper .btn,
body.dashboard-shell .modal .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: var(--ui-radius-sm);
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.1s;
}
#wrapper .btn:active { transform: translateY(1px); }
#wrapper .btn-sm { padding: 3px 10px; border-radius: 8px; font-size: 12px; }
#wrapper .btn-lg { padding: 8px 20px; font-size: 14px; }
#wrapper .btn:focus,
#wrapper .btn.focus { box-shadow: var(--ui-ring); }
#wrapper .btn:disabled,
#wrapper .btn.disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
#wrapper .btn-block { display: flex; width: 100%; }

/* ── 11. Pagination, badges, tabs, dropdowns, alerts ───────────────────────── */
#wrapper .pagination { flex-wrap: wrap; gap: 6px; margin: 0; }
#wrapper .page-link {
  min-width: 38px;
  padding: 7px 12px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm) !important;
  background: var(--ui-surface);
  color: var(--ui-text-2);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
#wrapper .page-link:hover { background: var(--ui-surface-2); color: var(--ui-text); border-color: var(--ui-border-strong); }
#wrapper .page-item.active .page-link { background: var(--ui-brand); border-color: var(--ui-brand); color: #fff; }
#wrapper .page-item.disabled .page-link { opacity: 0.45; background: var(--ui-surface); }

#wrapper .badge {
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.35;
  white-space: normal;
  text-align: center;
}

#wrapper .nav-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  border-bottom: 1px solid var(--ui-border);
  scrollbar-width: none;
}
#wrapper .nav-tabs::-webkit-scrollbar { display: none; }
#wrapper .nav-tabs .nav-link {
  padding: 10px 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ui-muted);
  font-weight: 600;
}
#wrapper .nav-tabs .nav-link:hover { color: var(--ui-text); }
#wrapper .nav-tabs .nav-link.active {
  border-bottom-color: var(--ui-accent);
  background: transparent;
  color: var(--ui-brand-ink);
}

#wrapper .dropdown-menu,
body.dashboard-shell .dropdown-menu {
  padding: 6px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow);
}
#wrapper .dropdown-item { padding: 8px 12px; border-radius: 8px; color: var(--ui-text-2); font-weight: 500; }
#wrapper .dropdown-item:hover { background: var(--ui-surface-2); color: var(--ui-text); }
#wrapper .alert { border-radius: var(--ui-radius-md); }

/* ── 12. Modals (react-bootstrap portals into <body>) ──────────────────────── */
body.dashboard-shell .modal-content {
  border: 0;
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  color: var(--ui-text-2);
  box-shadow: 0 24px 64px rgba(20, 12, 6, 0.28);
}
body.dashboard-shell .modal-header,
body.dashboard-shell .modal-footer { border-color: var(--ui-border); padding: 16px 22px; }
body.dashboard-shell .modal-header .modal-title {
  font-family: var(--ui-font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--ui-text);
}
body.dashboard-shell .modal-body { padding: 20px 22px; }
body.dashboard-shell .modal-footer { gap: 8px; flex-wrap: wrap; }
body.dashboard-shell .close { color: var(--ui-text-2); text-shadow: none; opacity: 0.7; }
body.dashboard-shell .modal-backdrop.show { opacity: 0.55; }

/* ── 12a. Confirm dialogs (SweetAlert2, portaled into <body>) ───────────────── */
body.dashboard-shell .swal2-container.swal2-backdrop-show,
body.dashboard-shell .swal2-container { background: rgba(28, 20, 14, 0.55); }
body.dashboard-shell .swal2-popup {
  width: min(400px, calc(100vw - 32px));
  padding: 30px 26px 24px;
  border-radius: 20px;
  background: var(--ui-surface);
  color: var(--ui-text-2);
  font-family: var(--ui-font);
  box-shadow: 0 24px 64px rgba(20, 12, 6, 0.32);
}
body.dashboard-shell .swal2-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-width: 0;
  border-radius: 50%;
}
body.dashboard-shell .swal2-icon .swal2-icon-content { font-size: 34px; font-weight: 700; }
body.dashboard-shell .swal2-icon.swal2-warning { background: rgba(217, 142, 4, 0.14); color: var(--ui-warning); }
body.dashboard-shell .swal2-icon.swal2-error { background: rgba(209, 59, 59, 0.12); color: var(--ui-danger); }
body.dashboard-shell .swal2-icon.swal2-question,
body.dashboard-shell .swal2-icon.swal2-info { background: var(--ui-brand-soft); color: var(--ui-brand-ink); }
body.dashboard-shell .swal2-icon.swal2-success { background: rgba(28, 143, 96, 0.12); color: var(--ui-success); }
body.dashboard-shell .swal2-icon.swal2-success [class^="swal2-success-line"] { background-color: var(--ui-success); }
body.dashboard-shell .swal2-icon.swal2-success .swal2-success-ring { border-color: transparent; }
body.dashboard-shell .swal2-icon.swal2-success [class^="swal2-success-circular-line"],
body.dashboard-shell .swal2-icon.swal2-success .swal2-success-fix { display: none; }
body.dashboard-shell .swal2-title {
  margin: 0 0 6px;
  padding: 0;
  font-family: var(--ui-font-display);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ui-text);
}
body.dashboard-shell .swal2-html-container {
  margin: 0;
  padding: 0;
  font-family: var(--ui-font);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ui-text-2);
}
body.dashboard-shell .swal2-actions { margin: 24px 0 0; gap: 10px; width: 100%; flex-wrap: wrap; }
body.dashboard-shell .swal2-styled {
  flex: 1 1 130px;
  min-height: 38px;
  margin: 0;
  padding: 0 16px;
  border-radius: var(--ui-radius-sm);
  font-family: var(--ui-font);
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
body.dashboard-shell .swal2-styled:focus-visible { outline: 0; box-shadow: var(--ui-ring); }
body.dashboard-shell .swal2-styled.swal2-confirm { background: var(--ui-brand) !important; border: 1px solid var(--ui-brand); color: #fff; }
body.dashboard-shell .swal2-styled.swal2-confirm:hover { filter: brightness(1.12); }
body.dashboard-shell .swal2-styled.swal2-deny { background: var(--ui-danger) !important; border: 1px solid var(--ui-danger); color: #fff; }
body.dashboard-shell .swal2-styled.swal2-cancel {
  background: transparent !important;
  border: 1px solid var(--ui-border-strong);
  color: var(--ui-text-2);
}
body.dashboard-shell .swal2-styled.swal2-cancel:hover { background: var(--ui-surface-2) !important; color: var(--ui-text); }
/* the confirm button is first in the DOM; put Cancel on the left, the action on the right */
body.dashboard-shell .swal2-actions:has(.swal2-cancel[style*="inline-block"]) { flex-direction: row-reverse; }
body.dashboard-shell .swal2-input,
body.dashboard-shell .swal2-textarea,
body.dashboard-shell .swal2-select {
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface);
  color: var(--ui-text);
  font-family: var(--ui-font);
  box-shadow: none;
}
body.dashboard-shell .swal2-input:focus,
body.dashboard-shell .swal2-textarea:focus { border-color: var(--ui-accent); box-shadow: var(--ui-ring); }

/* ── 12b. Toasts (react-toastify) and right-to-left mode ───────────────────── */
/* toasts start below the fixed top bar instead of covering it */
body.dashboard-shell .Toastify__toast-container--top-right,
body.dashboard-shell .Toastify__toast-container--top-center,
body.dashboard-shell .Toastify__toast-container--top-left { top: calc(var(--bar-h) + 10px); }
body.dashboard-shell .Toastify__toast { border-radius: var(--ui-radius-md); font-family: var(--ui-font); }

/* Settings > "Enable RTL Mode": main.css sets direction: rtl on <body>; the
   docked layout mirrors here. */
body.rtl_mode #wrapper #left-sidebar { left: auto !important; right: 0; border-right: 0; border-left: 1px solid var(--ui-border); }
body.rtl_mode.layout-fullwidth #wrapper #left-sidebar { transform: translateX(102%); }
body.rtl_mode #wrapper .navbar-fixed-top { left: 0; right: var(--sb-w); }
body.rtl_mode.layout-fullwidth #wrapper .navbar-fixed-top { right: 0; }
body.rtl_mode #wrapper #main-content { margin: var(--bar-h) var(--sb-w) 0 0 !important; }
body.rtl_mode.layout-fullwidth #wrapper #main-content { margin-right: 0 !important; }
body.rtl_mode .shell-user-toggle,
body.rtl_mode .shell-user-menu a,
body.rtl_mode .shell-user-menu button { text-align: right; }
body.rtl_mode #wrapper .metismenu .has-arrow::after { right: auto; left: 14px; }
body.rtl_mode #wrapper .sidebar-nav .metismenu a { padding: 10px 12px 10px 40px; }
body.rtl_mode #wrapper .sidebar-nav .metismenu ul.collapse { margin: 0 22px 0 0; padding: 0 12px 0 0; border-left: 0; border-right: 1px solid var(--ui-border-strong); }
body.rtl_mode .shell-drawer-close { right: auto; left: 12px; }
body.rtl_mode .shell-search .shell-search-icon { left: auto; right: 15px; }
body.rtl_mode #wrapper .shell-search .form-control { padding: 0 40px; }
body.rtl_mode #wrapper .shell-search .search-form .btn { right: auto; left: 6px; }
@media (max-width: 991.98px) {
  body.rtl_mode #wrapper #left-sidebar,
  body.rtl_mode.layout-fullwidth #wrapper #left-sidebar { transform: translateX(102%); }
  body.rtl_mode #wrapper #left-sidebar.open { transform: none; }
  body.rtl_mode #wrapper .navbar-fixed-top,
  body.rtl_mode.layout-fullwidth #wrapper .navbar-fixed-top { right: 0; }
  body.rtl_mode #wrapper #main-content,
  body.rtl_mode.layout-fullwidth #wrapper #main-content { margin-right: 0 !important; }
}

/* ── 13. Responsive ────────────────────────────────────────────────────────── */

/* Tablet and below: the sidebar becomes a drawer. */
@media (max-width: 991.98px) {
  #wrapper .navbar-fixed-top,
  body.layout-fullwidth #wrapper .navbar-fixed-top { left: 0; padding: 0 16px; }
  #wrapper #main-content,
  body.layout-fullwidth #wrapper #main-content { margin-left: 0 !important; padding: 14px 14px 0 !important; }

  #wrapper #left-sidebar {
    width: min(86vw, 320px);
    transform: translateX(-102%);
    box-shadow: none;
  }
  #wrapper #left-sidebar.open { transform: none; box-shadow: var(--ui-shadow); }
  .shell-drawer-close { display: inline-flex; }
  .shell-profile { padding-right: 60px; }

  .sidebar-overlay { display: block; }
  body.offcanvas-active .sidebar-overlay { opacity: 1; visibility: visible; }
  body.offcanvas-active { overflow: hidden; }

  .shell-search { max-width: none; }
  #wrapper .block-header h2 { font-size: 22px; }
}

/* Phones and small tablets. */
@media (max-width: 767.98px) {
  /* segmented tab strips (e.g. Wallet Management) wrap instead of forcing a sideways scroll */
  #wrapper #main-content .btn-group { flex-wrap: wrap; max-width: 100%; gap: 6px; }
  #wrapper #main-content .block-header:has(> h2 + .btn-group) { flex-direction: column; align-items: stretch !important; gap: 12px; }
  #wrapper #main-content .btn-group > .btn { flex: 1 1 auto; border-radius: var(--ui-radius-sm) !important; margin: 0 !important; }
  #wrapper .navbar-fixed-top { padding: 0 12px; }
  #wrapper .shell-bar { gap: 8px; }
  #wrapper .shell-brand { font-size: 23px; }

  .shell-search-btn { display: inline-flex; }
  .shell-search {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-width: none;
    margin: 0;
    padding: 10px 12px;
    background: var(--ui-surface);
    border-bottom: 1px solid var(--ui-border);
    box-shadow: var(--ui-shadow);
  }
  .shell-search.is-open { display: block; }
  #wrapper .shell-search .form-control { font-size: 16px; }

  .shell-pill-btn { width: 40px; padding: 0; }
  .shell-pill-btn .shell-label { display: none; }

  #wrapper #main-content,
  body.layout-fullwidth #wrapper #main-content { padding: 12px 10px 0 !important; }
  /* Bootstrap rows reach 15px past their container; the phone padding is
     12px, which made every page 3px wider than the screen. */
  #wrapper #main-content .row { margin-left: -10px; margin-right: -10px; }
  #wrapper #main-content .row > [class*="col-"],
  #wrapper #main-content .row > .col { padding-left: 10px; padding-right: 10px; }
  #wrapper .block-header { margin-bottom: 12px; }
  #wrapper .block-header h2 { font-size: 19px; }
  #wrapper .block-header .breadcrumb { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  #wrapper .block-header .breadcrumb::-webkit-scrollbar { display: none; }

  #wrapper .card { margin-bottom: 12px; border-radius: 12px; }
  #wrapper .card > .header,
  #wrapper .card .card-header { padding: 10px 12px 4px; }
  #wrapper .card > .body,
  #wrapper .card .card-body { padding: 10px 12px 12px; }

  /* inputs at 16px stop iOS from zooming the page on focus */
  #wrapper .form-control,
  #wrapper .custom-select,
  body.dashboard-shell .modal .form-control { font-size: 16px; }
  #wrapper .form-control-sm { font-size: 15px; }
  #wrapper .btn { min-height: 40px; }
  #wrapper .btn-sm { min-height: 34px; }

  #wrapper .table thead th,
  #wrapper .table td { padding: 10px 12px; }

  body.dashboard-shell .modal-dialog { margin: 12px; }
  body.dashboard-shell .modal-header,
  body.dashboard-shell .modal-footer { padding: 14px 16px; }
  body.dashboard-shell .modal-body { padding: 16px; }
}

/* Small phones: two KPI tiles per row instead of one very tall column. */
@media (max-width: 575.98px) {
  #wrapper .row > [class*="col-"]:has(> .card.top_widget) { flex: 0 0 50%; max-width: 50%; }
  #wrapper .card.top_widget { margin-bottom: 12px; border-radius: 16px; }
}

/* Wide desktops. */
@media (min-width: 1400px) {
  #wrapper .navbar-fixed-top { padding: 0 36px; }
  #wrapper #main-content { padding: 22px 28px 0 !important; }
}

@media (prefers-reduced-motion: reduce) {
  #wrapper *, #wrapper *::before, #wrapper *::after,
  .sidebar-overlay, .shell-skel { animation: none !important; transition: none !important; }
}

/* ── 14. AI Product Drafting (AIQuickCreate.jsx) ───────────────────────────── */
#wrapper .aiq .aiq-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  font-family: var(--ui-font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--ui-text);
}
#wrapper .aiq .aiq-title i {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
  font-size: 16px;
}
#wrapper .aiq .aiq-head-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
#wrapper .aiq .aiq-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--ui-brand-soft);
  color: var(--ui-brand-ink);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
#wrapper .aiq .aiq-pill i { color: var(--ui-accent); }

/* progress */
#wrapper .aiq .aiq-progress { margin-bottom: 18px; padding: 14px 16px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-md); background: var(--ui-surface); }
#wrapper .aiq .aiq-progress-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 13px; font-weight: 700; color: var(--ui-text); }
#wrapper .aiq .aiq-bar { height: 8px; border-radius: 999px; background: var(--ui-brand-soft); overflow: hidden; }
#wrapper .aiq .aiq-bar-fill { height: 100%; border-radius: inherit; background: var(--ui-accent); transition: width 0.4s ease; }
#wrapper .aiq .aiq-progress-count { display: flex; gap: 16px; margin-top: 8px; font-size: 12px; color: var(--ui-muted); }
#wrapper .aiq .aiq-progress-count i { margin-right: 4px; }

/* product card */
#wrapper .aiq .aiq-card {
  --aiq-state: var(--ui-border-strong);
  margin-bottom: 18px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
  overflow: hidden;
}
#wrapper .aiq .aiq-card.is-processing { --aiq-state: var(--ui-info); border-color: var(--ui-info); }
#wrapper .aiq .aiq-card.is-done { --aiq-state: var(--ui-success); border-color: var(--ui-success); }
#wrapper .aiq .aiq-card.is-error { --aiq-state: var(--ui-danger); border-color: var(--ui-danger); }
#wrapper .aiq .aiq-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ui-border);
  background: var(--ui-surface-2);
  cursor: pointer;
  user-select: none;
}
#wrapper .aiq .aiq-card-head.is-collapsed { border-bottom-color: transparent; }
#wrapper .aiq .aiq-num {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--aiq-state);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
#wrapper .aiq .aiq-card-title { flex: 1 1 auto; min-width: 0; }
#wrapper .aiq .aiq-card-name { font-size: 15px; font-weight: 700; color: var(--ui-text); }
#wrapper .aiq .aiq-card-meta { margin-left: 8px; font-size: 12px; font-weight: 500; color: var(--ui-muted); }
#wrapper .aiq .aiq-card-status { margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--aiq-state); overflow-wrap: anywhere; }
#wrapper .aiq .aiq-card-status i,
#wrapper .aiq .aiq-card-warn i { margin-right: 5px; }
#wrapper .aiq .aiq-card-warn { margin-top: 2px; font-size: 11.5px; font-weight: 600; color: #b45309; }
#wrapper .aiq .aiq-card-actions { display: flex; align-items: center; gap: 4px; }
#wrapper .aiq .aiq-icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: var(--ui-radius-sm);
  background: transparent;
  color: var(--ui-muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
#wrapper .aiq .aiq-icon-btn:hover { background: var(--ui-brand-soft); color: var(--ui-text); }
#wrapper .aiq .aiq-icon-btn.is-danger { color: var(--ui-danger); }
#wrapper .aiq .aiq-icon-btn.is-danger:hover { background: rgba(209, 59, 59, 0.1); }
#wrapper .aiq .aiq-icon-btn:focus-visible,
#wrapper .aiq .aiq-drop:focus-visible { outline: 0; box-shadow: var(--ui-ring); }
#wrapper .aiq .aiq-card-body { padding: 22px 20px 10px; }

/* fields */
#wrapper .aiq .aiq-field { margin-bottom: 20px; }
#wrapper .aiq .aiq-label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--ui-text); }
#wrapper .aiq .aiq-hint { margin-left: 6px; font-weight: 400; color: var(--ui-muted); }
#wrapper .aiq .aiq-row { margin-bottom: 16px; }
#wrapper .aiq .aiq-dims { margin: 0 -6px; }
#wrapper .aiq .aiq-dims > [class*="col-"] { padding: 0 6px; }
#wrapper .aiq .input-group .input-group-text {
  border-color: var(--ui-border-strong);
  border-radius: var(--ui-radius-sm) 0 0 var(--ui-radius-sm);
  background: var(--ui-surface-2);
  color: var(--ui-text-2);
  font-weight: 700;
}
#wrapper .aiq .input-group .form-control { border-radius: 0 var(--ui-radius-sm) var(--ui-radius-sm) 0; }
#wrapper .aiq .aiq-check { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; padding: 0; }
#wrapper .aiq .aiq-check .form-check-input { position: static; flex: 0 0 auto; margin: 3px 0 0; }
#wrapper .aiq .aiq-check .form-check-label { font-size: 13.5px; line-height: 1.5; color: var(--ui-text-2); }
#wrapper .aiq .aiq-variations { margin-bottom: 12px; }

/* image drop zone */
#wrapper .aiq .aiq-drop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-height: 104px;
  padding: 14px;
  border: 2px dashed var(--ui-border-strong);
  border-radius: var(--ui-radius-md);
  background: var(--ui-surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
#wrapper .aiq .aiq-drop:hover,
#wrapper .aiq .aiq-drop.is-empty { border-color: var(--ui-accent); background: color-mix(in srgb, var(--ui-accent) 4%, var(--ui-surface)); }
#wrapper .aiq .aiq-thumb { position: relative; width: 80px; height: 80px; }
#wrapper .aiq .aiq-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 10px; border: 1px solid var(--ui-border); }
#wrapper .aiq .aiq-thumb-remove {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid var(--ui-surface);
  border-radius: 50%;
  background: var(--ui-danger);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
#wrapper .aiq .aiq-thumb-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 80px;
  height: 80px;
  border: 2px dashed var(--ui-accent);
  border-radius: 10px;
  background: var(--ui-surface);
  color: var(--ui-accent);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
#wrapper .aiq .aiq-thumb-add i { font-size: 18px; }
#wrapper .aiq .aiq-drop-text { flex: 1 1 200px; font-size: 13.5px; font-weight: 500; color: var(--ui-text-2); }
#wrapper .aiq .aiq-drop-need { width: 100%; font-size: 12px; font-weight: 600; color: var(--ui-danger); }
#wrapper .aiq .aiq-drop-need i { margin-right: 5px; }

/* inline notices */
#wrapper .aiq .aiq-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: var(--ui-radius-sm);
  font-size: 12.5px;
  line-height: 1.5;
}
#wrapper .aiq .aiq-note i { flex: 0 0 auto; margin-top: 2px; font-size: 14px; }
#wrapper .aiq .aiq-note .spinner-border { flex: 0 0 auto; width: 14px; height: 14px; margin-top: 3px; border-width: 2px; }
#wrapper .aiq .aiq-note.is-info { background: rgba(34, 121, 159, 0.1); border-color: rgba(34, 121, 159, 0.28); color: var(--ui-info); }
#wrapper .aiq .aiq-note.is-error { background: rgba(209, 59, 59, 0.09); border-color: rgba(209, 59, 59, 0.3); color: var(--ui-danger); }
#wrapper .aiq .aiq-note.is-ok { background: rgba(28, 143, 96, 0.1); border-color: rgba(28, 143, 96, 0.28); color: var(--ui-success); }

/* add another + footer */
#wrapper .aiq .aiq-add-product {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  margin-bottom: 20px;
  border: 2px dashed var(--ui-border-strong);
  border-radius: var(--ui-radius);
  background: transparent;
  color: var(--ui-brand-ink);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
#wrapper .aiq .aiq-add-product:hover { border-color: var(--ui-accent); background: color-mix(in srgb, var(--ui-accent) 5%, var(--ui-surface)); color: var(--ui-accent); }
#wrapper .aiq .aiq-footer {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding: 14px 18px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: 0 8px 28px rgba(43, 33, 27, 0.14);
}
#wrapper .aiq .aiq-footer-note { font-size: 13px; color: var(--ui-muted); }
#wrapper .aiq .aiq-footer-note i { margin-right: 6px; }
#wrapper .aiq .aiq-footer-actions { display: flex; gap: 10px; }
#wrapper .aiq .aiq-submit { min-height: 36px; padding: 0 18px; font-weight: 700; }

/* Import from Excel dialog */
#wrapper .aiq .aiq-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(28, 20, 14, 0.55);
}
#wrapper .aiq .aiq-modal {
  width: 100%;
  max-width: 660px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 22px 24px 24px;
  border-radius: 20px;
  background: var(--ui-surface);
  color: var(--ui-text-2);
  box-shadow: 0 24px 64px rgba(20, 12, 6, 0.32);
}
#wrapper .aiq .aiq-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
#wrapper .aiq .aiq-modal-head h4 { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--ui-font-display); font-size: 18px; font-weight: 700; color: var(--ui-text); }
#wrapper .aiq .aiq-modal-head h4 i { color: var(--ui-success); }
#wrapper .aiq .aiq-modal-head .aiq-icon-btn { font-size: 24px; }
#wrapper .aiq .aiq-modal-help { margin-bottom: 16px; font-size: 13px; line-height: 1.55; }
#wrapper .aiq .aiq-modal-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
#wrapper .aiq .aiq-modal-intro p { margin: 0; }
#wrapper .aiq .aiq-modal-intro .btn { flex: 0 0 auto; margin: 0; }
#wrapper .aiq .aiq-code { padding: 9px 12px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-sm); background: var(--ui-surface-2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; overflow-x: auto; white-space: nowrap; }
#wrapper .aiq .aiq-code.is-pre { font-size: 11px; white-space: pre; }
#wrapper .aiq .aiq-rules { margin: 10px 0 0; padding-left: 18px; color: var(--ui-muted); }
#wrapper .aiq .aiq-example-label { margin: 12px 0 6px; color: var(--ui-muted); }
#wrapper .aiq .aiq-result-summary { margin-bottom: 8px; font-weight: 700; color: var(--ui-text); }
#wrapper .aiq .aiq-result-skipped { font-weight: 400; color: #b45309; }
#wrapper .aiq .aiq-result-table { max-height: 260px; overflow: auto; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-sm); }
#wrapper .aiq .aiq-result-table table { font-size: 12px; }
#wrapper .aiq .aiq-result-table thead th { position: sticky; top: 0; background: var(--ui-surface-2); }

@media (max-width: 767.98px) {
  #wrapper .aiq .aiq-title { font-size: 20px; }
  #wrapper .aiq .aiq-head-actions { justify-content: flex-start; margin-top: 12px; }
  #wrapper .aiq .aiq-card-head { padding: 12px 14px; }
  #wrapper .aiq .aiq-card-body { padding: 18px 14px 6px; }
  #wrapper .aiq .aiq-row > [class*="col-"] { margin-bottom: 14px; }
  #wrapper .aiq .aiq-row { margin-bottom: 2px; }
  #wrapper .aiq .aiq-footer { bottom: 8px; padding: 12px 14px; }
  #wrapper .aiq .aiq-footer-note { display: none; }
  #wrapper .aiq .aiq-footer-actions { flex: 1 1 100%; }
  #wrapper .aiq .aiq-footer-actions .btn { flex: 1 1 0; }
  #wrapper .aiq .aiq-modal { padding: 18px 16px 20px; }
  #wrapper .aiq .aiq-modal-intro { flex-direction: column; }
}

/* ── 15. Contrast fixes found by the light / dark / high-contrast audit ─────── */
/* tiles: small labels on saturated colours need >= 4.5:1 */
#wrapper .card.secondary-bg,
#wrapper .card.top_widget.secondary-bg { background: color-mix(in srgb, var(--secondary-color, #fb5934) 72%, #000); }
#wrapper .card.top_widget.bg-info { background: #15788b !important; }
#wrapper .card.top_widget.bg-success { background: #1b7d54 !important; }
/* Bootstrap's stock success / info buttons are ~3:1 with white text */
#wrapper .btn-success { background-color: #1a7f53; border-color: #1a7f53; color: #fff; }
#wrapper .btn-success:hover { background-color: #156843; border-color: #156843; color: #fff; }
#wrapper .btn-info { background-color: #137384; border-color: #137384; color: #fff; }
#wrapper .btn-info:hover { background-color: #0f5f6d; border-color: #0f5f6d; color: #fff; }
/* outline badges keep the theme colour off the surface, not off white */
#wrapper .badge-primary { color: var(--ui-brand-ink); border-color: var(--ui-brand-ink); }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .badge-danger { color: #ff8a8a; border-color: #ff8a8a; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .badge-success { color: #5fd4a0; border-color: #5fd4a0; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .badge-warning { color: #f5c04d; border-color: #f5c04d; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .badge-info { color: #6ac6e0; border-color: #6ac6e0; }
/* outline badges: the stock colours are ~2-4:1 on white */
#wrapper .badge.badge-success { color: #1a7f45; }
#wrapper .badge.badge-warning { color: #8a5b00; }
#wrapper .badge.badge-info { color: #22679f; }
#wrapper .badge.badge-danger { color: #c02f2f; }
/* dark mode: stock Bootstrap outline / danger / muted colours are too dim on the dark surface */
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .btn-outline-primary,
html:is([data-theme="dark"], [data-theme="high-contrast"]) body.dashboard-shell .modal .btn-outline-primary { color: var(--ui-brand-ink); border-color: var(--ui-brand-ink); background: transparent; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .btn-outline-primary:hover { background: var(--ui-brand-soft); color: var(--ui-brand-ink); }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .btn-outline-secondary,
html:is([data-theme="dark"], [data-theme="high-contrast"]) body.dashboard-shell .modal .btn-outline-secondary { color: var(--ui-text-2); border-color: var(--ui-border-strong); background: transparent; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .btn-outline-secondary:hover { background: var(--ui-surface-2); color: var(--ui-text); }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .btn-outline-danger { color: #ff8a8a; border-color: #ff8a8a; background: transparent; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .btn-outline-danger:hover { background: rgba(255, 138, 138, 0.14); color: #ffb0b0; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .text-danger,
html:is([data-theme="dark"], [data-theme="high-contrast"]) body.dashboard-shell .text-danger { color: #ff8a8a !important; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .page-item.disabled .page-link { color: var(--ui-muted); background: transparent; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .page-link { color: var(--ui-text-2); }
/* solid status badges whose colours are set inline with Bootstrap's stock hues (white text is ~2-3:1) */
#wrapper .badge[style*="background-color: rgb(23, 162, 184)"] { background-color: #137384 !important; }
#wrapper .badge[style*="background-color: rgb(40, 167, 69)"] { background-color: #1a7f45 !important; }
#wrapper .badge[style*="background-color: rgb(255, 102, 0)"] { background-color: #c24a00 !important; }
#wrapper .badge[style*="background-color: rgb(32, 201, 151)"] { background-color: #0f7a5c !important; }
/* headings and text inside coloured Bootstrap cards keep their own (white) colour */
#wrapper .text-white :is(h1, h2, h3, h4, h5, h6, p, small, span),
#wrapper .card[class*="bg-"]:not(.bg-light):not(.bg-white) :is(h1, h2, h3, h4, h5, h6) { color: #fff; }
#wrapper .card.bg-success { background-color: #1a7f45 !important; }
#wrapper .card.bg-warning { background-color: #f2b01e !important; }
#wrapper .card.bg-warning :is(h1, h2, h3, h4, h5, h6, p, small, span) { color: #2b211b; }
/* dark mode: alerts, required stars and muted text on stock light surfaces */
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .alert { background: var(--ui-surface-2); border-color: var(--ui-border-strong); color: var(--ui-text-2); }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .alert :is(h1, h2, h3, h4, h5, h6) { color: var(--ui-text); }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .alert-info { background: rgba(34, 121, 159, 0.16); border-color: rgba(106, 198, 224, 0.4); color: #c6e9f4; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .alert-success { background: rgba(28, 143, 96, 0.16); border-color: rgba(95, 212, 160, 0.4); color: #c4f0dd; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .alert-warning { background: rgba(217, 142, 4, 0.16); border-color: rgba(245, 192, 77, 0.4); color: #f8e2b0; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .alert-danger { background: rgba(209, 59, 59, 0.16); border-color: rgba(255, 138, 138, 0.4); color: #ffd0d0; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper span[style*="color: red"],
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper span[style*="color: rgb(255, 0, 0)"] { color: #ff8a8a !important; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .text-muted,
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .badge-default { color: var(--ui-muted) !important; }

/* high contrast: solid pills / active states take black text on the white token, and stock light cards follow the theme */
html[data-theme="high-contrast"] #wrapper .page-item.active .page-link { background: #fff; border-color: #fff; color: #000; }
html[data-theme="high-contrast"] #wrapper .aiq .aiq-num { color: #000; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .bg-light:not(.badge) { background-color: var(--ui-surface-2) !important; color: var(--ui-text); }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .bg-light :is(h1, h2, h3, h4, h5, h6) { color: var(--ui-text); }

/* remaining stock hues set inline on cards / badges */
#wrapper [style*="background-color: rgb(243, 111, 33)"],
#wrapper [style*="background: rgb(243, 111, 33)"] { background: #b8480a !important; }
#wrapper .badge[style*="background-color: rgb(0, 123, 255)"] { background-color: #0a58ca !important; }
#wrapper .card.top_widget.bg-info { background: #136f82 !important; }
/* react-select (used by the product forms) on dark / high-contrast surfaces */
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper div[class$="-control"] { background: var(--ui-surface); border-color: var(--ui-border-strong); }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper div[class$="-placeholder"] { color: var(--ui-muted); }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper div[class$="-singleValue"],
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper div[class$="-Input"] input { color: var(--ui-text); }
html:is([data-theme="dark"], [data-theme="high-contrast"]) body.dashboard-shell div[class$="-menu"] { background: var(--ui-surface); color: var(--ui-text); border: 1px solid var(--ui-border-strong); }
html:is([data-theme="dark"], [data-theme="high-contrast"]) body.dashboard-shell div[class$="-option"] { background: transparent; color: var(--ui-text); }
html:is([data-theme="dark"], [data-theme="high-contrast"]) body.dashboard-shell div[class$="-option"]:hover { background: var(--ui-brand-soft); }

/* high contrast: stat-tile icon chips and solid buttons need a visible edge */
html[data-theme="high-contrast"] #wrapper .top_widget .icon { background: #fff !important; color: #000 !important; }
html[data-theme="high-contrast"] #wrapper .top_widget .icon i { color: #000 !important; }
html[data-theme="high-contrast"] #wrapper .card.top_widget { border: 1px solid #fff; }
html[data-theme="high-contrast"] #wrapper .btn:not(.btn-link) { border: 1px solid #fff; }

/* dark / high contrast: negative amounts and chart legends coloured inline with light-mode hues */
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper [style*="color: rgb(220, 53, 69)"]:not([style*="background"]),
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper [style*="color: rgb(239, 68, 68)"]:not([style*="background"]) { color: #ff8a8a !important; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper strong[style*="color: rgb(99, 102, 241)"] { color: #a9acff !important; }
#wrapper .badge[style*="background-color: rgb(255, 140, 0)"] { background-color: #a85400 !important; }
#wrapper .badge[style*="background-color: rgb(253, 126, 20)"] { background-color: #b34a00 !important; }
#wrapper .badge[style*="background-color: rgb(220, 53, 69)"] { background-color: #b02a37 !important; }
/* notification count bubbles (white on stock red is 3.8:1) and Bootstrap 5 style badges used by the log viewer */
#wrapper span[style*="background: rgb(239, 68, 68)"] { background: #c62828 !important; }
#wrapper .badge.bg-warning,
#wrapper .badge[style*="background-color: rgb(255, 193, 7)"] { background-color: #f2b01e !important; color: #2b211b !important; }
#wrapper .badge.bg-primary { background-color: #0a58ca !important; color: #fff !important; }
#wrapper [style*="background"][style*="rgb(40, 167, 69)"] { background: #1a7f45 !important; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper [style*="color: rgb(185, 28, 28)"]:not([style*="background"]) { color: #ff8a8a !important; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper code { color: #ff9ac8; background: transparent; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper table td { color: var(--ui-text-2); }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper [style*="background: rgb(232, 245, 233)"] { background: rgba(28, 143, 96, 0.16) !important; color: var(--ui-text-2) !important; }
/* system log viewer and payment gateway page: greys / blues picked for a white page */
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper [style*="color: rgb(102, 102, 102)"]:not([style*="background"]),
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper [style*="color: rgb(85, 85, 85)"]:not([style*="background"]) { color: var(--ui-muted) !important; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper [style*="color: rgb(12, 99, 228)"]:not([style*="background"]) { color: #7db4ff !important; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper [style*="color: rgb(26, 127, 55)"]:not([style*="background"]) { color: #5fd4a0 !important; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .table td:not([class]) { color: var(--ui-text-2); }
#wrapper .badge.bg-secondary { background-color: #5c636a !important; color: #fff !important; }
#wrapper .badge.bg-success { background-color: #1a7f45 !important; color: #fff !important; }
#wrapper .badge.bg-danger { background-color: #b02a37 !important; color: #fff !important; }
#wrapper .badge.bg-info { background-color: #0b6a7c !important; color: #fff !important; }
/* amber status codes and dim grey cells in the log viewer */
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper [style*="color: rgb(180, 83, 9)"]:not([style*="background"]) { color: #f5a35c !important; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper [style*="color: rgb(136, 136, 136)"]:not([style*="background"]) { color: var(--ui-muted) !important; }
/* top bar notification bell icon (an svg that carries the brand brown) */
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .shell-menu svg { color: var(--ui-text) !important; }
/* dialogs portaled into body sit outside #wrapper: give them the same dark / high-contrast treatment */
html:is([data-theme="dark"], [data-theme="high-contrast"]) body.dashboard-shell .text-muted { color: var(--ui-muted) !important; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) body.dashboard-shell .modal-content .btn-outline-secondary { color: var(--ui-text-2); border-color: var(--ui-border-strong); background: transparent; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) body.dashboard-shell .modal-content .text-danger { color: #ff8a8a !important; }
html[data-theme="high-contrast"] body.dashboard-shell .swal2-styled.swal2-confirm { background: #fff !important; color: #000; border-color: #fff; }
html[data-theme="high-contrast"] body.dashboard-shell .swal2-styled.swal2-deny { background: #fff !important; color: #000; border-color: #fff; }
html[data-theme="high-contrast"] body.dashboard-shell .swal2-styled.swal2-cancel { border-color: #fff; color: #fff; }
html[data-theme="high-contrast"] body.dashboard-shell .swal2-popup,
html[data-theme="high-contrast"] body.dashboard-shell .modal-content { border: 2px solid #fff; }
/* plain .btn (no colour variant), e.g. the modal close cross, keeps Bootstrap's near-black text */
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .btn:not([class*="btn-"]),
html:is([data-theme="dark"], [data-theme="high-contrast"]) body.dashboard-shell .modal .btn:not([class*="btn-"]) { color: var(--ui-text); }

/* ── 16. Notifications pages (Super Admin, Artist, Seller) ─────────────────── */
#wrapper .nf { padding: 0; }
#wrapper .nf .nf-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 18px; }
#wrapper .nf .nf-title { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--ui-font-display); font-size: 24px; font-weight: 700; color: var(--ui-text); }
#wrapper .nf .nf-unread { padding: 3px 11px; border-radius: 999px; background: var(--ui-accent-soft); color: color-mix(in srgb, var(--ui-accent) 48%, var(--ui-text)); font-family: var(--ui-font); font-size: 12.5px; font-weight: 700; }
#wrapper .nf .nf-head-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
/* All | Unread segmented control */
#wrapper .nf .nf-seg { min-height: 32px; padding: 0 14px; border: 1px solid var(--ui-border-strong); background: var(--ui-surface); color: var(--ui-text-2); font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.15s, color 0.15s; }
#wrapper .nf .nf-seg:nth-of-type(1) { border-radius: var(--ui-radius-sm) 0 0 var(--ui-radius-sm); }
#wrapper .nf .nf-seg:nth-of-type(2) { margin-left: -11px; border-radius: 0 var(--ui-radius-sm) var(--ui-radius-sm) 0; }
#wrapper .nf .nf-seg.is-active { position: relative; background: var(--ui-brand); border-color: var(--ui-brand); color: #fff; }
#wrapper .nf .nf-mark-all { min-height: 32px; padding: 0 12px; border: 0; border-radius: var(--ui-radius-sm); background: transparent; color: var(--ui-brand-ink); font-size: 13px; font-weight: 700; cursor: pointer; }
#wrapper .nf .nf-mark-all:hover { background: var(--ui-brand-soft); }
#wrapper .nf button:focus-visible { outline: 0; box-shadow: var(--ui-ring); }

/* category tabs and priority chips: one scrolling row each */
#wrapper .nf .nf-tabs,
#wrapper .nf .nf-prio { display: flex; gap: 8px; margin-bottom: 12px; padding-bottom: 2px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
#wrapper .nf .nf-tabs::-webkit-scrollbar,
#wrapper .nf .nf-prio::-webkit-scrollbar { display: none; }
#wrapper .nf .nf-tab,
#wrapper .nf .nf-chip { flex: 0 0 auto; min-height: 30px; padding: 0 12px; border-radius: 999px; background: var(--ui-surface); white-space: nowrap; cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; }
#wrapper .nf .nf-tab { border: 1px solid var(--ui-border-strong); color: var(--ui-text-2); font-size: 13px; font-weight: 600; }
#wrapper .nf .nf-tab:hover { background: var(--ui-surface-2); color: var(--ui-text); }
#wrapper .nf .nf-tab.is-active { background: var(--ui-brand); border-color: var(--ui-brand); color: #fff; }
#wrapper .nf .nf-prio { margin-bottom: 16px; }
#wrapper .nf .nf-chip { --nf-c: var(--ui-muted); min-height: 26px; padding: 0 10px; border: 1px solid var(--nf-c); color: color-mix(in srgb, var(--nf-c) 62%, var(--ui-text)); font-size: 12px; font-weight: 600; }
#wrapper .nf .nf-chip.is-active { background: color-mix(in srgb, var(--nf-c) 68%, #000); border-color: transparent; color: #fff; }
#wrapper .nf .nf-count { margin: 0 0 12px; font-size: 13px; color: var(--ui-muted); }

/* notification rows */
#wrapper .nf .nf-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 10px;
  padding: 14px 16px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#wrapper .nf .nf-card:hover { border-color: var(--ui-border-strong); box-shadow: var(--ui-shadow); }
#wrapper .nf .nf-card.is-unread { background: color-mix(in srgb, var(--ui-brand-ink) 5%, var(--ui-surface)); border-color: var(--ui-border-strong); }
#wrapper .nf .nf-icon { --nf-c: var(--ui-muted); display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: color-mix(in srgb, var(--nf-c) 14%, var(--ui-surface)); font-size: 20px; line-height: 1; }
#wrapper .nf .nf-body { min-width: 0; }
#wrapper .nf .nf-card-title { margin-bottom: 3px; font-size: 14.5px; font-weight: 600; line-height: 1.4; color: var(--ui-text); }
#wrapper .nf .nf-card-title.is-unread { font-weight: 700; }
#wrapper .nf .nf-msg { margin-bottom: 8px; font-size: 13.5px; line-height: 1.5; color: var(--ui-text-2); overflow-wrap: anywhere; }
#wrapper .nf .nf-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; font-size: 12px; color: var(--ui-muted); }
#wrapper .nf .nf-cat,
#wrapper .nf .nf-pri { --nf-c: var(--ui-muted); padding: 2px 8px; border-radius: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
#wrapper .nf .nf-cat { background: color-mix(in srgb, var(--nf-c) 14%, var(--ui-surface)); color: color-mix(in srgb, var(--nf-c) 45%, var(--ui-text)); }
#wrapper .nf .nf-pri { background: color-mix(in srgb, var(--nf-c) 68%, #000); color: #fff; }
#wrapper .nf .nf-actions { display: flex; align-items: center; gap: 4px; }
#wrapper .nf .nf-dot { width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: var(--ui-accent); }
#wrapper .nf .nf-act { min-height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ui-brand-ink); font-size: 12.5px; font-weight: 700; cursor: pointer; }
#wrapper .nf .nf-act:hover { background: var(--ui-brand-soft); }
#wrapper .nf .nf-act.is-danger { color: #b52a2a; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .nf .nf-act.is-danger { color: #ff8a8a; }
#wrapper .nf .nf-act.is-danger:hover { background: rgba(209, 59, 59, 0.1); }
#wrapper .nf .nf-act:disabled { opacity: 0.5; cursor: wait; }

/* loading and empty states */
#wrapper .nf .nf-loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 48px 16px; color: var(--ui-muted); font-size: 14px; }
#wrapper .nf .nf-spinner { width: 20px; height: 20px; border: 3px solid var(--ui-border-strong); border-top-color: var(--ui-accent); border-radius: 50%; animation: nf-spin 0.8s linear infinite; }
@keyframes nf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #wrapper .nf .nf-spinner { animation-duration: 2.4s; } }
#wrapper .nf .nf-empty { padding: 56px 20px; border: 1px dashed var(--ui-border-strong); border-radius: var(--ui-radius); text-align: center; color: var(--ui-muted); }
#wrapper .nf .nf-empty-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: var(--ui-brand-soft); font-size: 28px; }
#wrapper .nf .nf-empty h4 { margin: 0 0 6px; font-family: var(--ui-font-display); font-size: 17px; color: var(--ui-text); }
#wrapper .nf .nf-empty p { margin: 0; font-size: 14px; }

/* pagination */
#wrapper .nf .nf-pages { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 22px; }
#wrapper .nf .nf-page { min-width: 32px; min-height: 32px; padding: 0 10px; border: 1px solid var(--ui-border-strong); border-radius: var(--ui-radius-sm); background: var(--ui-surface); color: var(--ui-text-2); font-size: 13px; font-weight: 600; cursor: pointer; }
#wrapper .nf .nf-page:hover:not(:disabled) { background: var(--ui-surface-2); color: var(--ui-text); }
#wrapper .nf .nf-page.is-active { background: var(--ui-brand); border-color: var(--ui-brand); color: #fff; }
#wrapper .nf .nf-page:disabled { opacity: 0.45; cursor: not-allowed; }
#wrapper .nf .nf-gap { padding: 0 4px; color: var(--ui-muted); }

html[data-theme="high-contrast"] #wrapper .nf .nf-page.is-active,
html[data-theme="high-contrast"] #wrapper .nf .nf-seg.is-active,
html[data-theme="high-contrast"] #wrapper .nf .nf-tab.is-active { background: #fff; border-color: #fff; color: #000; }

@media (max-width: 767.98px) {
  #wrapper .nf .nf-title { font-size: 20px; }
  #wrapper .nf .nf-card { grid-template-columns: 38px minmax(0, 1fr); gap: 10px 12px; padding: 12px; }
  #wrapper .nf .nf-icon { width: 38px; height: 38px; font-size: 18px; }
  #wrapper .nf .nf-actions { grid-column: 2; justify-content: flex-start; margin: 2px 0 0 -10px; }
}
/* light-mode success / amber text and outline buttons were 2-3:1 on white; dark modes get the light variants back */
#wrapper .text-success,
#wrapper .btn-outline-success { color: #1a7f45; }
#wrapper .btn-outline-success { border-color: #1a7f45; }
#wrapper .btn-outline-success:hover { background: #1a7f45; color: #fff; }
#wrapper .btn.btn-secondary { color: color-mix(in srgb, var(--ui-accent) 68%, var(--ui-text)); border-color: var(--ui-accent); }
#wrapper .btn.btn-secondary:hover { background: var(--ui-accent); color: #fff; }
#wrapper [style*="color: rgb(245, 158, 11)"]:not([style*="background"]) { color: #a15c00 !important; }
#wrapper [style*="color: rgb(16, 185, 129)"]:not([style*="background"]) { color: #0e7a56 !important; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .text-success,
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .btn-outline-success { color: #5fd4a0; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .btn-outline-success { border-color: #5fd4a0; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper .btn-outline-success:hover { background: #5fd4a0; color: #000; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper [style*="color: rgb(245, 158, 11)"]:not([style*="background"]) { color: #f5b342 !important; }
html:is([data-theme="dark"], [data-theme="high-contrast"]) #wrapper [style*="color: rgb(16, 185, 129)"]:not([style*="background"]) { color: #5fd4a0 !important; }
/* phones: card headers that carry filters (title + selects / search) wrap instead of pushing the page wider */
@media (max-width: 767.98px) {
  #wrapper .card > .header.d-flex,
  #wrapper .card .header.d-flex.justify-content-between { flex-wrap: wrap; gap: 10px; }
  #wrapper .card .header.d-flex > .d-flex { flex-wrap: wrap; min-width: 0; max-width: 100%; }
  #wrapper .card .body .d-flex.align-items-center > div:not([style*="width"]) { min-width: 0; }
  #wrapper #main-content .card .body :is(h1, h2, h3, h4, h5, .text-uppercase) { overflow-wrap: anywhere; }
  #wrapper .card .header select.form-control,
  #wrapper .card .header .form-control[style*="width"] { max-width: 100%; flex: 1 1 140px; width: auto !important; }
}
/* status badges inside table cells: one compact line (several pages set 5px 10px / 12px inline) */
#wrapper td .badge,
#wrapper td .badge[style] {
  display: inline-block;
  padding: 1px 7px !important;
  font-size: 10px !important;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border-radius: 999px !important;
  margin: 0 4px 0 0 !important;
}
#wrapper td .badge.ml-1,
#wrapper td .badge.ml-2 { margin-left: 8px !important; }
/* all other badges (cards, headers, lists, dialogs): same compact pill, keeping the wrap so a long label can't widen a tile */
#wrapper .badge:not(td .badge),
#wrapper .badge[style]:not(td .badge),
body.dashboard-shell .modal .badge {
  padding: 2px 8px !important;
  font-size: 10.5px !important;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.02em;
  border-radius: 999px !important;
}
/* touch screens keep a comfortable tap target even though buttons are compact */
@media (pointer: coarse) {
  #wrapper .btn { min-height: 36px; }
  #wrapper .btn-sm { min-height: 32px; min-width: 32px; }
}

/* Wallet & Payments card on the Super Admin dashboard: figures were 28px / 20px */
#wrapper .wallet-summary h3 { font-size: 21px; line-height: 1.2; }
#wrapper .wallet-summary h5 { font-size: 15px; line-height: 1.3; }
#wrapper .wallet-summary .body > .d-flex.mb-3,
#wrapper .wallet-summary .body > .row.mb-3 { margin-bottom: 10px !important; }
#wrapper .wallet-summary .row > [class*="col-"].mb-2 { margin-bottom: 4px !important; }
#wrapper .wallet-summary .row .badge { margin-top: 4px !important; }
#wrapper .wallet-summary .font-12 { font-size: 11px; }
/* profile / settings pages: tab buttons that reset their own padding and border inline, and .body wrappers nested three deep
   (card > tab-content > .body > .body) that each added 15-20px of side padding and squeezed the form to 65% of a phone */
#wrapper .nav-tabs .nav-link[style] {
  padding: 10px 16px !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  background: transparent !important;
}
#wrapper .nav-tabs .nav-link.active[style] { border-bottom-color: var(--ui-accent) !important; }
#wrapper .nav-tabs .nav-item { margin-bottom: -1px; }
#wrapper .card .tab-content { padding: 0 16px 16px; }
#wrapper .card .tab-content .body { padding: 8px 0; }
#wrapper .card .tab-content .body .body { padding: 8px 0; }
#wrapper .card .tab-content h5,
#wrapper .card .tab-content h6 { font-family: var(--ui-font-display); font-weight: 700; color: var(--ui-text); }
#wrapper .card .tab-content .media { display: flex; align-items: flex-start; gap: 16px; }
#wrapper .card .tab-content .media-left { margin: 0; flex: 0 0 auto; border-radius: 16px; }
#wrapper .card .tab-content .media-body { min-width: 0; }
@media (max-width: 575.98px) {
  #wrapper .card .tab-content { padding: 0 12px 12px; }
  #wrapper .card .tab-content .media { flex-direction: column; align-items: center; text-align: center; }
  #wrapper .card .tab-content .media-body p { margin-bottom: 10px; }
}
/* Basic Information row of the profile forms: two independent columns (First name, Gender, Birthdate, Address 2, Location | Last name,
   Set address, Address 1, Landmark, Pincode). Stacked on a phone that put Last name after City. Below lg the columns dissolve and their
   fields interleave, so related fields stay together (First / Last / Gender / Set address / Birthdate / ...). */
@media (max-width: 991.98px) {
  #wrapper .row:has(#firstName) { display: flex; flex-wrap: wrap; }
  #wrapper .row:has(#firstName) > [class*="col-"] { display: contents; }
  #wrapper .row:has(#firstName) > [class*="col-"] > * { flex: 0 0 100%; max-width: 100%; padding: 0 10px; }
  #wrapper .row:has(#firstName) > [class*="col-"]:nth-child(1) > :nth-child(1) { order: 1; }
  #wrapper .row:has(#firstName) > [class*="col-"]:nth-child(2) > :nth-child(1) { order: 2; }
  #wrapper .row:has(#firstName) > [class*="col-"]:nth-child(1) > :nth-child(2) { order: 3; }
  #wrapper .row:has(#firstName) > [class*="col-"]:nth-child(2) > :nth-child(2) { order: 4; }
  #wrapper .row:has(#firstName) > [class*="col-"]:nth-child(1) > :nth-child(3) { order: 5; }
  #wrapper .row:has(#firstName) > [class*="col-"]:nth-child(2) > :nth-child(3) { order: 6; }
  #wrapper .row:has(#firstName) > [class*="col-"]:nth-child(1) > :nth-child(4) { order: 7; }
  #wrapper .row:has(#firstName) > [class*="col-"]:nth-child(2) > :nth-child(4) { order: 8; }
  #wrapper .row:has(#firstName) > [class*="col-"]:nth-child(1) > :nth-child(5) { order: 9; }
  #wrapper .row:has(#firstName) > [class*="col-"]:nth-child(2) > :nth-child(5) { order: 10; }
  #wrapper .row:has(#firstName) > [class*="col-"]:nth-child(1) > :nth-child(6) { order: 11; }
  #wrapper .row:has(#firstName) > [class*="col-"]:nth-child(2) > :nth-child(6) { order: 12; }
  #wrapper .row:has(#firstName) > [class*="col-"]:nth-child(1) > :nth-child(7) { order: 13; }
  #wrapper .row:has(#firstName) > [class*="col-"]:nth-child(2) > :nth-child(7) { order: 14; }
  #wrapper .row:has(#firstName) > [class*="col-"]:nth-child(1) > :nth-child(8) { order: 15; }
  #wrapper .row:has(#firstName) > [class*="col-"]:nth-child(2) > :nth-child(8) { order: 16; }
  #wrapper .row:has(#firstName) > [class*="col-"]:nth-child(1) > :nth-child(9) { order: 17; }
  #wrapper .row:has(#firstName) > [class*="col-"]:nth-child(2) > :nth-child(9) { order: 18; }
}
#wrapper .card > .body:empty { display: none; }
