/* ==========================================================================
   BUTCHER'S CUT LLC — LIVE WHOLESALE ENGINE
   Design System: shadcn/ui + Tremor.so Enterprise SaaS Architecture
   Aesthetic: Minimalist Monochromatic Framing, 8-Point Grid & Soft Depth
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600;700&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

:root {
  --font-display: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Strict 8-Point / 4-Point Spatial Grid Tokens */
  --space-1: 4px;              /* Tight inline elements: icon-to-label gaps, badge padding */
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;

  /* Strict 4-Size Type Scale & 2-Weight Tier Tokens */
  --type-display: 22px;        /* Display / Page Heading: 20px–24px (Bold 700) */
  --type-heading: 16px;        /* Section Heading / Subtitle: 15px–16px (Semi-Bold 600) */
  --type-body: 14px;           /* Body / Standard Data: 13px–14px (Regular/Medium 400/500) */
  --type-caption: 12px;        /* Caption / Secondary Metadata: 11px–12px (Regular/Medium 400/500) */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  
  /* Single-Hue 60-30-10 Brand-Tinted Neutrals (2%–4% H=226° Brand Hue Saturation) */
  --brand-hue: 226;
  --bg-app: #f6f8fc;           /* 60% Dominant Brand-Tinted Neutral Canvas */
  --surface-card: #fcfdff;     /* 30% Secondary Brand-Tinted Card Surface */
  --surface-subtle: #eef2f8;   /* 30% Secondary Subtle Neutral Container Fill */
  --border-card: rgba(218, 226, 238, 0.85); /* 1px Structural Hairline Separation */
  --border-hover: rgba(191, 203, 222, 0.95);
  --text-main: #0f172a;        /* Deep Charcoal Primary Typography (Never #000000) */
  --text-muted: #64748b;       /* Secondary Typography (Slate-500) */
  --text-dim: #94a3b8;         /* Tertiary / Caption Typography (Slate-400) */
  --brand-shell: #0b1120;      /* Quiet Brand-Tinted Framing Shell */
  --brand-shell-border: #1e293b;
  --brand-accent: #0f172a;     /* 10% High-Intent Brand Accent */
  --brand-accent-hover: #1e293b;
  
  /* Ultra-Subtle Elevation (Max 8% Alpha — No Muddy Gray Drop Shadows) */
  --shadow-stripe: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --shadow-stripe-hover: 0 4px 8px -2px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-float: 0 12px 24px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -4px rgba(15, 23, 42, 0.04);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  max-width: 100%;
  overflow-x: clip !important;
}

body {
  font-family: var(--font-sans);
  letter-spacing: -0.011em;
  background-color: var(--bg-app);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11", "tnum";
}

/* Zero-FOUC Hidden Fallback (Zero specificity :where() so responsive sm:/md:/lg:block utilities win cleanly) */
:where(.hidden) {
  display: none;
}

#authWelcomeMomentOverlay.hidden,
#authLockModal.hidden {
  display: none !important;
}

/* Typography Foundation: Inter UI Sans, Plus Jakarta Display Headings & JetBrains Mono Telemetry */
body, input, select, textarea, button {
  font-family: var(--font-sans);
}

.font-mono, .font-mono *, td.font-mono, span.font-mono, input.font-mono, code, kbd {
  font-family: var(--font-mono) !important;
  font-variant-numeric: tabular-nums !important;
  letter-spacing: -0.015em;
}

input[type="number"], #prodCost, #prodPrice, #prodQty, #invoiceNumInput,
table, tr, td, th {
  font-feature-settings: "tnum" 1, "cv02" 1, "cv03" 1, "cv04" 1, "cv11" 1 !important;
  font-variant-numeric: tabular-nums !important;
}

/* shadcn/ui & Tremor Cards: Clean White Surfaces with Soft Drop Shadows */
.bg-white.rounded-lg, .bg-white.rounded-xl, .bg-white.rounded-2xl, #basketCard, .erp-surface-card {
  background: var(--surface-card) !important;
  border: 1px solid var(--border-card) !important;
  box-shadow: var(--shadow-stripe) !important;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.16s ease, box-shadow 0.16s ease;
}

.bg-white.rounded-lg:hover, .bg-white.rounded-xl:hover, .bg-white.rounded-2xl:hover, #basketCard:hover, .erp-surface-card:hover {
  border-color: var(--border-hover) !important;
}

/* Actionable Cards & Interactive Tiles: Subtle -1px Lift & Soft Shadow Increase */
.erp-interactive-card {
  background: var(--surface-card) !important;
  border: 1px solid var(--border-card) !important;
  box-shadow: var(--shadow-stripe) !important;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.16s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.16s ease, background-color 0.16s ease !important;
}

.erp-interactive-card:hover {
  transform: translateY(-1px) !important;
  box-shadow: var(--shadow-stripe-hover) !important;
  border-color: var(--border-hover) !important;
}

/* Quiet Monochromatic Framing Header */
header#mainAppHeader {
  background: var(--brand-shell) !important;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--brand-shell-border) !important;
}

/* Form Controls (Linear & Stripe Precision — zero-specificity :where() wrapper preserves component overrides) */
:where(input:not([type="checkbox"]):not([type="radio"]):not(#universalSearchInput)),
textarea {
  font-family: var(--font-sans);
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  color: #0f172a !important;
  box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.03), inset 0 1px 0 0 rgba(255, 255, 255, 0.9) !important;
  transition: border-color 0.16s ease, box-shadow 0.18s ease, background-color 0.16s ease !important;
  max-width: 100%;
}

:where(input:not([type="checkbox"]):not([type="radio"]):not(#universalSearchInput)):hover,
textarea:hover {
  border-color: #94a3b8 !important;
}

:where(input:not([type="checkbox"]):not([type="radio"]):not(#universalSearchInput)):focus,
textarea:focus {
  outline: none !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3.5px rgba(16, 185, 129, 0.15), 0 4px 12px -4px rgba(16, 185, 129, 0.14) !important;
}

/* Custom Native-Replacement Select Dropdowns (8-Point Grid & 4-Size Type Scale) */
select {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  background-size: 16px 16px !important;
  padding-right: 32px !important;
  padding-left: 12px !important;
  height: 40px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  font-family: var(--font-sans) !important;
  font-size: var(--type-body) !important;
  font-weight: var(--weight-medium) !important;
  color: #0f172a !important;
  cursor: pointer !important;
  box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.03) !important;
  transition: all 0.16s ease !important;
  text-overflow: ellipsis !important;
  max-width: 100%;
}

select:hover {
  border-color: #94a3b8 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230f172a' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
}

select:focus {
  outline: none !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3.5px rgba(16, 185, 129, 0.15), 0 4px 12px -4px rgba(16, 185, 129, 0.14) !important;
}

select:disabled {
  background-color: #f1f5f9 !important;
  color: #94a3b8 !important;
  cursor: not-allowed !important;
  border-color: #e2e8f0 !important;
}

/* Consistent input height & padding (Strict 8-Point Multiple: 40px / 32px) */
input:not([type="checkbox"]):not([type="radio"]):not(table input):not(:where(#universalSearchInput)),
select:not(table select) {
  height: 40px !important;
  font-size: var(--type-body) !important;
}

table input:not([type="checkbox"]):not([type="radio"]),
table select {
  height: 32px !important;
  font-size: var(--type-caption) !important;
}

/* High-Visibility Focus States for Live Data Entry (Spec 2 — Frontier Emerald Precision Halo) */
#prodCost:focus,
#prodPrice:focus,
#prodQty:focus,
#prodOrderedCases:focus,
#invoiceNumInput:focus {
  background-color: #ffffff !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3.5px rgba(16, 185, 129, 0.18), 0 4px 12px -4px rgba(16, 185, 129, 0.16) !important;
}

/* Tabular Figures for strict financial and weight alignment (Spec 3) */
.tabular-nums, .tnum, [data-tnum] {
  font-variant-numeric: tabular-nums !important;
  font-feature-settings: "tnum" 1 !important;
}

/* Interactive Micro-Transitions (shadcn/ui & Tremor Tactile Lift) */
button {
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.15s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease !important;
}

#mainAppContent button.cursor-pointer:hover:not(:disabled),
.erp-fullpage-workspace button.cursor-pointer:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(0) scale(0.98) !important;
}

/* Stripe Tables: Clean borders and 8-point grid padding */
table thead th {
  background-color: #f6f8fc !important;
  color: #475569 !important;
  font-size: var(--type-caption) !important;
  font-weight: var(--weight-semibold) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.12s ease !important;
}

table tbody tr:hover {
  background-color: rgba(246, 248, 252, 0.85) !important;
}

table tbody td {
  padding-top: 8px;
  padding-bottom: 8px;
}

/* Clean Custom Scrollbars (8px Grid) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Apple Frosted Glass Modal Backdrop */
.modal-backdrop,
.bg-black\/50, .bg-slate-900\/50, .bg-black\/60, .bg-slate-950\/50, .bg-slate-950\/60, .bg-slate-900\/60 {
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  background-color: rgba(15, 23, 42, 0.45) !important;
}

/* Modal Dialog Cards (True Pop-Up Dialogs Only) */
div[id$="Modal"]:not(.erp-fullpage-workspace) > div:not(.absolute) {
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25) !important;
  border-radius: 16px !important;
}

/* Laser sweep animation for barcode scanner */
@keyframes laserSweep {
  0% { top: 12%; opacity: 0.85; }
  50% { top: 82%; opacity: 1; }
  100% { top: 12%; opacity: 0.85; }
}
.laser-line {
  position: absolute;
  left: 6%;
  right: 6%;
  height: 2px;
  background: #10b981;
  box-shadow: 0 0 12px #10b981, 0 0 4px #34d399;
  animation: laserSweep 2s infinite ease-in-out;
}

/* Shake error animation */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}
.shake-error {
  animation: shake 0.35s ease-in-out;
  border-color: #e11d48 !important;
  background-color: #fff1f2 !important;
}

/* ==========================================================================
   FULL-APPLICATION THEME ENGINE (v3.3.3)
   Transforms the entire ERP (Command Shell, Sidebar, Workspace Canvas, Cards,
   Tables, Modals & Inputs) — Not just the top header bar.
   ========================================================================== */

/* 1. COOLER NIGHT SHIFT (FULL APPLICATION DARK MODE — SURFACE ELEVATION VIA LIGHTER SHADES & SOFT OFF-WHITE BODY TEXT) */
html.colorway-midnight,
body.colorway-midnight {
  --bg-app: #090d16;
  --surface-card: #111827;
  --surface-subtle: #1e293b;
  --border-card: #1e293b;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  background-color: #090d16 !important;
  color: #e2e8f0 !important;
  color-scheme: dark;
}
.colorway-midnight header#mainAppHeader {
  background: rgba(5, 8, 17, 0.98) !important;
  border-bottom: 1px solid #1e293b !important;
}
.colorway-midnight #erpAppSidebar {
  background-color: #060a12 !important;
  border-right-color: #1e293b !important;
}
@media screen {
  .colorway-midnight #mainAppContent,
  .colorway-midnight .erp-fullpage-workspace,
  .colorway-midnight .erp-fullpage-workspace > div {
    background-color: #090d16 !important;
    color: #e2e8f0 !important;
  }
  .colorway-midnight :not(:where(#printArea)) h1,
  .colorway-midnight :not(:where(#printArea)) h2 {
    color: #ffffff !important;
  }
  .colorway-midnight :not(:where(#printArea)) .bg-white:not(.rounded-full),
  .colorway-midnight .erp-card {
    background-color: #111827 !important;
    border-color: #1e293b !important;
    color: #e2e8f0 !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05) !important;
  }
  .colorway-midnight :not(:where(#printArea)) .bg-slate-50,
  .colorway-midnight :not(:where(#printArea)) .bg-slate-50\/80,
  .colorway-midnight :not(:where(#printArea)) .bg-slate-50\/90,
  .colorway-midnight :not(:where(#printArea)) .bg-slate-50\/60,
  .colorway-midnight :not(:where(#printArea)) .bg-slate-100,
  .colorway-midnight :not(:where(#printArea)) .bg-slate-100\/80 {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
  }
  .colorway-midnight :not(:where(#printArea)) .border-slate-200,
  .colorway-midnight :not(:where(#printArea)) .border-slate-200\/80,
  .colorway-midnight :not(:where(#printArea)) .border-slate-300,
  .colorway-midnight :not(:where(#printArea)) .border-slate-100,
  .colorway-midnight :not(:where(#printArea)) .divide-slate-200 > :not([hidden]) ~ :not([hidden]),
  .colorway-midnight :not(:where(#printArea)) .divide-slate-100 > :not([hidden]) ~ :not([hidden]) {
    border-color: #1e293b !important;
  }
  .colorway-midnight :not(:where(#printArea)) .text-slate-900,
  .colorway-midnight :not(:where(#printArea)) .text-slate-950,
  .colorway-midnight :not(:where(#printArea)) .text-slate-800 {
    color: #e2e8f0 !important;
  }
  .colorway-midnight :not(:where(#printArea)) .text-slate-700,
  .colorway-midnight :not(:where(#printArea)) .text-slate-600 {
    color: #cbd5e1 !important;
  }
  .colorway-midnight :not(#printArea) .text-slate-500 {
    color: #94a3b8 !important;
  }
  .colorway-midnight :not(#printArea) input:not([type="checkbox"]):not([type="radio"]),
  .colorway-midnight :not(#printArea) select,
  .colorway-midnight :not(#printArea) textarea {
    background-color: #0b1120 !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
  }
  .colorway-midnight :not(#printArea) input::placeholder,
  .colorway-midnight :not(#printArea) textarea::placeholder {
    color: #64748b !important;
  }
  .colorway-midnight :not(#printArea) table thead,
  .colorway-midnight :not(#printArea) table thead tr,
  .colorway-midnight :not(#printArea) table thead th {
    background-color: #0b1120 !important;
    color: #94a3b8 !important;
    border-color: #1e293b !important;
  }
  .colorway-midnight :not(#printArea) table tbody tr {
    border-color: #1e293b !important;
  }
  .colorway-midnight :not(#printArea) table tbody tr:hover {
    background-color: rgba(30, 41, 59, 0.55) !important;
  }
  .colorway-midnight .erp-sidebar-link.bg-blue-600 {
    background-color: #0891b2 !important;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25) !important;
  }
}

/* 2. LOADING DOCK HIGH-CONTRAST (BOLD BORDERS & DEEP CHARCOAL — ZERO PURE #000000 ON SCREEN) */
html.colorway-industrial,
body.colorway-industrial {
  --bg-app: #f6f8fc;
  --surface-card: #fcfdff;
  --border-card: #0f172a;
  --text-main: #0f172a;
  --text-muted: #334155;
  background-color: #f6f8fc !important;
  color: #0f172a !important;
}
.colorway-industrial header#mainAppHeader {
  background: #0f172a !important;
  border-bottom: 2px solid #f59e0b !important;
}
.colorway-industrial #erpAppSidebar {
  background-color: #0f172a !important;
  border-right: 2px solid #334155 !important;
}
@media screen {
  .colorway-industrial #mainAppContent .bg-white,
  .colorway-industrial .erp-fullpage-workspace .bg-white,
  .colorway-industrial .erp-card {
    border: 1px solid #0f172a !important;
    box-shadow: var(--shadow-stripe) !important;
  }
  .colorway-industrial :not(#printArea) input:not([type="checkbox"]):not([type="radio"]),
  .colorway-industrial :not(#printArea) select,
  .colorway-industrial :not(#printArea) textarea {
    border: 1px solid #0f172a !important;
    color: #0f172a !important;
    font-weight: 600;
  }
  .colorway-industrial .erp-sidebar-link.bg-blue-600 {
    background-color: #d97706 !important;
    color: #0f172a !important;
    font-weight: 700 !important;
  }
}

/* 3. SMOKEHOUSE WARM BUTCHER BLOCK (ARTISAN STEAKHOUSE & WARM PARCHMENT) */
html.colorway-smokehouse,
body.colorway-smokehouse {
  --bg-app: #f6f1e7;
  --surface-card: #fffdf9;
  --border-card: #dfd5c5;
  --text-main: #1c140d;
  --text-muted: #6b5744;
  background-color: #f6f1e7 !important;
  color: #1c140d !important;
}
.colorway-smokehouse header#mainAppHeader {
  background: #1f1209 !important;
  border-bottom: 1px solid #92400e !important;
}
.colorway-smokehouse #erpAppSidebar {
  background-color: #26170c !important;
  border-right: 1px solid #452712 !important;
}
.colorway-smokehouse #erpSidebarFooter {
  background-color: #170d06 !important;
}
@media screen {
  .colorway-smokehouse #mainAppContent .bg-white,
  .colorway-smokehouse .erp-fullpage-workspace .bg-white,
  .colorway-smokehouse .erp-card {
    background-color: #fffdf9 !important;
    border-color: #e2d7c5 !important;
  }
  .colorway-smokehouse #mainAppContent .bg-slate-50,
  .colorway-smokehouse #mainAppContent .bg-slate-100,
  .colorway-smokehouse .erp-fullpage-workspace .bg-slate-50 {
    background-color: #f3ece0 !important;
    border-color: #dfd5c5 !important;
  }
  .colorway-smokehouse .erp-sidebar-link.bg-blue-600 {
    background-color: #d97706 !important;
  }
}

/* 4. USDA PASTURE & COLD-CHAIN GREEN (FOODSERVICE & FSIS COMPLIANCE PALETTE, H=162°) */
html.colorway-emerald,
body.colorway-emerald {
  --brand-hue: 162;
  --bg-app: #effaf5;
  --surface-card: #ffffff;
  --surface-subtle: #e6f7ef;
  --border-card: #bbf7d0;
  --text-main: #052e16;
  --text-muted: #3f6251;
  --brand-shell: #042f24;
  --brand-shell-border: #065f46;
  --brand-accent: #059669;
  background-color: #effaf5 !important;
  color: #052e16 !important;
}
.colorway-emerald header#mainAppHeader {
  background: #042f24 !important;
  border-bottom: 1px solid #059669 !important;
}
.colorway-emerald #erpAppSidebar {
  background-color: #06392c !important;
  border-right: 1px solid #065f46 !important;
}
.colorway-emerald #erpSidebarFooter {
  background-color: #022018 !important;
}
@media screen {
  .colorway-emerald #mainAppContent .bg-white,
  .colorway-emerald .erp-fullpage-workspace .bg-white,
  .colorway-emerald .erp-card {
    background-color: #ffffff !important;
    border-color: #bbf7d0 !important;
  }
  .colorway-emerald #mainAppContent .bg-slate-50,
  .colorway-emerald .erp-fullpage-workspace .bg-slate-50 {
    background-color: #ecfdf5 !important;
    border-color: #a7f3d0 !important;
  }
  .colorway-emerald .erp-sidebar-link.bg-blue-600 {
    background-color: #059669 !important;
  }
}

/* 5. PRIME OXBLOOD RESERVE (HERITAGE BUTCHER & STEAKHOUSE SINGLE-HUE PALETTE, H=352°) */
html.colorway-crimson,
body.colorway-crimson {
  --brand-hue: 352;
  --bg-app: #fbf5f6;
  --surface-card: #ffffff;
  --surface-subtle: #f6eaec;
  --border-card: #ead5d8;
  --border-hover: #dcb8be;
  --text-main: #240a0e;
  --text-muted: #6e444b;
  --brand-shell: #21090d;
  --brand-shell-border: #4c141d;
  --brand-accent: #be123c;
  background-color: #fbf5f6 !important;
  color: #240a0e !important;
}
.colorway-crimson header#mainAppHeader {
  background: #21090d !important;
  border-bottom: 1px solid #881337 !important;
}
.colorway-crimson #erpAppSidebar {
  background-color: #2a0c11 !important;
  border-right: 1px solid #4c141d !important;
}
.colorway-crimson #erpSidebarFooter {
  background-color: #160508 !important;
}
@media screen {
  .colorway-crimson #mainAppContent .bg-white,
  .colorway-crimson .erp-fullpage-workspace .bg-white,
  .colorway-crimson .erp-card {
    background-color: #ffffff !important;
    border-color: #ead5d8 !important;
  }
  .colorway-crimson #mainAppContent .bg-slate-50,
  .colorway-crimson #mainAppContent .bg-slate-100,
  .colorway-crimson .erp-fullpage-workspace .bg-slate-50 {
    background-color: #f8eef0 !important;
    border-color: #ead5d8 !important;
  }
  .colorway-crimson :not(#printArea) table thead th {
    background-color: #f8eef0 !important;
    color: #54232b !important;
    border-bottom-color: #ead5d8 !important;
  }
  .colorway-crimson .erp-sidebar-link.bg-blue-600 {
    background-color: #be123c !important;
  }
}

/* 6. RESERVE COBALT INDIGO (DEFAULT SINGLE-HUE SHADE DERIVATION, H=226°) */
html.colorway-classic,
body.colorway-classic {
  --brand-hue: 226;
  --bg-app: #f4f6fb;
  --surface-card: #ffffff;
  --surface-subtle: #edf1f9;
  --border-card: #d8e0f0;
  --border-hover: #b8c6e3;
  --text-main: #0c1428;
  --text-muted: #4b5a78;
  --brand-shell: #0c1428;
  --brand-shell-border: #1c2847;
  --brand-accent: #3656d4;
  background-color: #f4f6fb !important;
  color: #0c1428 !important;
}
.colorway-classic header#mainAppHeader {
  background: #0c1428 !important;
  border-bottom: 1px solid #1c2847 !important;
}
.colorway-classic #erpAppSidebar {
  background-color: #0c1428 !important;
  border-right: 1px solid #1c2847 !important;
}
.colorway-classic #erpSidebarFooter {
  background-color: #070c1a !important;
}
@media screen {
  .colorway-classic #mainAppContent .bg-slate-50,
  .colorway-classic .erp-fullpage-workspace .bg-slate-50 {
    background-color: #edf1f9 !important;
    border-color: #d8e0f0 !important;
  }
  .colorway-classic :not(#printArea) table thead th {
    background-color: #edf1f9 !important;
    color: #2c3a57 !important;
    border-bottom-color: #d8e0f0 !important;
  }
  .colorway-classic .erp-sidebar-link.bg-blue-600 {
    background-color: #3656d4 !important;
  }
}


/* Print Styles */
#printArea {
  display: none;
}
@page {
  size: letter portrait;
  margin: 8mm 10mm 10mm 10mm;
}
@media print {
  html, body {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    overflow: visible !important;
    font-family: var(--font-sans) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  header, main, footer, nav,
  #mainAppHeader, #mainAppContent, #validationBanner,
  #catalogModal, #paymentModal, #securityModal, #twoStepDeleteModal,
  #authLockModal, #boxScannerModal, #qboGuideModal, #qboExportModal, #qboImportModal, #universalSearchModal, #shortageClaimModal, #quickAddVendorModal, #executiveSummaryModal, #themeStudioModal,
  #truckLoadManifestModal, #weeklyPriceSheetModal, #routeManagementModal, #stockMethodologyModal, #reorderReminderModal, #driverManifestModal, #podModal, #rmaModal,
  .no-print {
    display: none !important;
  }
  #printArea {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    box-sizing: border-box !important;
  }
  #printArea * {
    box-sizing: border-box !important;
  }
  #printArea .hidden {
    display: none !important;
  }
  #printArea table {
    width: 100% !important;
    border-collapse: collapse !important;
  }
  #printArea th, #printArea td {
    border-color: #334155 !important;
  }
  tr, .print-card, #printArea .grid {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  thead {
    display: table-header-group !important;
  }
}

/* Leaflet Interactive Fleet Map Integration */
#routingLeafletMapContainer {
  min-height: 480px !important;
  height: 520px !important;
  width: 100% !important;
  background-color: #f1f5f9 !important;
  position: relative !important;
}
.leaflet-container {
  font-family: inherit;
  z-index: 10 !important;
  width: 100% !important;
  height: 100% !important;
}
.leaflet-pane {
  z-index: 15 !important;
}
.leaflet-top, .leaflet-bottom {
  z-index: 20 !important;
}
.leaflet-popup-content-wrapper {
  border-radius: 1rem !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.leaflet-popup-content {
  margin: 0 !important;
  line-height: 1.4 !important;
}
.custom-depot-pin {
  display: flex;
  align-items: center;
  justify-content: center;
}
.custom-stop-pin {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Bulletproof Real-Road Optimizer Action Buttons (High-contrast emerald-teal gradient with crisp white text) */
#btnRoutingTabRunOptimizer, #btnRunOptimizerTSP {
  background-color: #059669 !important;
  background-image: linear-gradient(135deg, #059669 0%, #0d9488 100%) !important;
  color: #ffffff !important;
  border: 1px solid #047857 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06) !important;
}
#btnRoutingTabRunOptimizer:hover, #btnRunOptimizerTSP:hover {
  background-color: #047857 !important;
  background-image: linear-gradient(135deg, #047857 0%, #0f766e 100%) !important;
  color: #ffffff !important;
}
#btnRoutingTabRunOptimizer svg, #btnRunOptimizerTSP svg {
  color: #fde047 !important;
}

/* ==========================================================================
   ENTERPRISE INDUSTRIAL SUITE & SAAS CONSOLE HIGH-CONTRAST UTILITIES (v2.9.8)
   Prevents Flexbox Tab Bar Squeezing & Guarantees High-Contrast Button Colors
   ========================================================================== */
.shrink-0 {
  flex-shrink: 0 !important;
}

#enterpriseIndustrialModalTopHeader {
  flex-shrink: 0 !important;
}

#enterpriseIndustrialModalTabBar {
  flex-shrink: 0 !important;
  min-height: 48px !important;
}

#enterpriseIndustrialModalScrollArea {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  overflow-y: auto !important;
}

#btnCoolerEnterpriseSuite {
  background-color: #0f172a !important;
  background-image: none !important;
  color: #ffffff !important;
  border: 1px solid #1e293b !important;
}

#btnCoolerEnterpriseSuite:hover {
  background-color: #1e293b !important;
  background-image: none !important;
  color: #ffffff !important;
}

#btnCommitCutRoomBatch,
#btnPrintZebraLabel {
  background-color: #2563eb !important;
  background-image: none !important;
  color: #ffffff !important;
  border: 1px solid #1d4ed8 !important;
}

#btnCommitCutRoomBatch:hover,
#btnPrintZebraLabel:hover {
  background-color: #1d4ed8 !important;
  background-image: none !important;
  color: #ffffff !important;
}

.bg-fuchsia-50, .bg-fuchsia-50\/70, .bg-fuchsia-50\/60 { background-color: #f8fafc !important; }
.bg-fuchsia-100 { background-color: #f1f5f9 !important; }
.bg-fuchsia-500 { background-color: #334155 !important; color: #ffffff !important; }
.bg-fuchsia-600 { background-color: #1e293b !important; color: #ffffff !important; }
.bg-fuchsia-700 { background-color: #0f172a !important; color: #ffffff !important; }
.bg-purple-700 { background-color: #1e293b !important; color: #ffffff !important; }
.bg-purple-600 { background-color: #334155 !important; color: #ffffff !important; }
.bg-violet-950 { background-color: #0f172a !important; }
.text-fuchsia-200 { color: #e2e8f0 !important; }
.text-fuchsia-300 { color: #cbd5e1 !important; }
.text-fuchsia-700 { color: #334155 !important; }
.text-fuchsia-800 { color: #1e293b !important; }
.text-fuchsia-900 { color: #0f172a !important; }
.text-fuchsia-950 { color: #020617 !important; }
.border-fuchsia-200 { border-color: #e2e8f0 !important; }
.border-fuchsia-300 { border-color: #cbd5e1 !important; }
.border-fuchsia-600 { border-color: #334155 !important; }

/* ==========================================================================
   DEDICATED FULL-PAGE WORKSPACE & DYNAMIC VIEWPORT ARCHITECTURE (v3.2.1)
   Converts former heavy modals into inline, full-width page workspaces
   and ensures 100% fluid scaling across phones, tablets, laptops, ultrawides,
   and all browser zoom levels (50% - 250%).
   ========================================================================== */
.erp-fullpage-workspace:not(.hidden) {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 15 !important;
  display: block !important;
  width: 100% !important;
  max-width: min(1440px, 100vw) !important;
  margin: 0 auto !important;
  padding: 1.25rem clamp(0.75rem, 2.5vw, 1.5rem) 4rem !important;
  background: transparent !important;
  background-color: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
  box-sizing: border-box !important;
}

.erp-fullpage-workspace:not(.hidden) > div {
  max-width: 100% !important;
  width: 100% !important;
  min-width: 0 !important;
  max-height: none !important;
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
  background: transparent !important;
  background-color: transparent !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

.erp-fullpage-workspace:not(.hidden) > div > .overflow-y-auto,
.erp-fullpage-workspace:not(.hidden) #enterpriseIndustrialModalScrollArea,
.erp-fullpage-workspace:not(.hidden) #execReportScrollArea {
  max-height: none !important;
  overflow-y: visible !important;
  padding: 0 !important;
}

/* True Micro-Modals: Dynamic Viewport Height & Width Protection for Short/Zoomed Screens */
div[id$="Modal"]:not(.erp-fullpage-workspace) {
  padding: clamp(0.5rem, 2vw, 1rem) !important;
  overflow-y: auto !important;
}

div[id$="Modal"]:not(.erp-fullpage-workspace):not(#authLockModal) > div:not(.absolute) {
  max-height: min(92dvh, calc(100vh - 1.5rem)) !important;
  min-width: 0 !important;
}

#authLockModal {
  background: radial-gradient(circle at 18% 20%, rgba(54, 86, 212, 0.16) 0%, rgba(12, 20, 40, 0.96) 55%, #070c1a 100%) !important;
  padding: clamp(0.75rem, 2.5vw, 2rem) !important;
  overflow-y: auto !important;
}

#authLockModal > #authLockCard {
  max-width: 58rem !important;
  width: 100% !important;
  min-width: 0 !important;
}

/* Fluid Flex & Grid Protection Across All Zoom Levels & Aspect Ratios */
#mainAppContent > div,
#mainAppContent .grid > div,
.erp-fullpage-workspace .grid > div {
  min-width: 0;
  max-width: 100%;
}

/* Ensure tables inside cards always scroll horizontally inside their wrapper rather than stretching the viewport */
.overflow-x-auto {
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

body.has-active-fullpage-workspace #mainAppContent {
  display: none !important;
}

#fullpageWorkspaceBreadcrumbBar,
body.has-active-fullpage-workspace #fullpageWorkspaceBreadcrumbBar {
  display: none !important;
}

/* ==========================================================================
   ADAPTIVE INDUSTRIAL COMMAND SHELL: COLLAPSIBLE SIDEBAR + MOBILE DRAWER (v3.3.3)
   Eliminates Top-Bar Tab Crowding, Zero Top Gap on Scroll, Hover-Expand & Blank-Click Toggle
   ========================================================================== */
header#mainAppHeader,
header#mainAppHeader:not(.hidden) {
  display: none !important;
  height: 0 !important;
}

body:not(:has(#erpAppSidebar:not(.hidden))) #btnToggleAppSidebar,
body.erp-mobile-drawer-open #btnToggleAppSidebar {
  display: none !important;
}

#erpAppSidebar {
  flex-direction: column !important;
  background-color: #0b1120 !important;
  color: #f8fafc !important;
  border-right: 1px solid #1e293b !important;
  overflow: visible !important;
  box-sizing: border-box !important;
  cursor: pointer;
}

#erpSidebarNavScrollArea {
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

#erpSidebarFooter {
  background-color: #020617 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  width: 100% !important;
  flex-shrink: 0 !important;
  overflow: visible !important;
}

@media (min-width: 1024px) {
  #erpAppSidebar:not(.hidden) {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100dvh !important;
    padding-top: 0 !important;     /* 0px top bar — full 100dvh sidebar height */
    width: 15rem !important;       /* 240px (8pt grid) */
    z-index: 35 !important;
    background-color: #0b1120 !important;
    border-right: 1px solid #1e293b !important;
    transform: none !important;
    overflow: visible !important;
    transition: width 0.18s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.18s ease !important;
  }

  #mobileQuickWorkspaceBar {
    display: none !important;
  }

  body:has(#erpAppSidebar:not(.hidden)) #mainAppContent,
  body:has(#erpAppSidebar:not(.hidden)) #fullpageWorkspaceBreadcrumbBar,
  body:has(#erpAppSidebar:not(.hidden)) .erp-fullpage-workspace:not(.hidden) {
    margin-left: 15rem !important;
    width: calc(100% - 15rem) !important;
    max-width: calc(100vw - 15rem) !important;
    transition: margin-left 0.18s cubic-bezier(0.4, 0, 0.2, 1), width 0.18s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  /* Compact Icon-Rail Mode on Desktop (64px = 8pt grid) */
  body.erp-sidebar-collapsed #erpAppSidebar:not(.hidden) {
    width: 4rem !important;
  }

  body.erp-sidebar-collapsed #erpAppSidebar:not(.sidebar-just-collapsed):hover {
    width: 15rem !important;
    box-shadow: 16px 0 32px -8px rgba(2, 6, 23, 0.45) !important;
  }

  body.erp-sidebar-collapsed #erpAppSidebar:not(:hover) .erp-sidebar-label,
  body.erp-sidebar-collapsed #erpAppSidebar:not(:hover) .erp-sidebar-badge,
  body.erp-sidebar-collapsed #erpAppSidebar:not(:hover) .sidebar-nav-badge,
  body.erp-sidebar-collapsed #erpAppSidebar:not(:hover) #navBadgeAi,
  body.erp-sidebar-collapsed #erpAppSidebar:not(:hover) .erp-sidebar-section-label,
  body.erp-sidebar-collapsed #erpAppSidebar:not(:hover) #sidebarLivePulsePod,
  body.erp-sidebar-collapsed #erpAppSidebar:not(:hover) #sidebarActiveModuleSubNav,
  body.erp-sidebar-collapsed #erpAppSidebar:not(:hover) #sidebarUtilityModeTabs,
  body.erp-sidebar-collapsed #erpAppSidebar:not(:hover) #sidebarQuickVoiceBtn,
  body.erp-sidebar-collapsed #erpAppSidebar:not(:hover) #sidebarQuickPasteBtn,
  body.erp-sidebar-collapsed #erpAppSidebar:not(:hover) #btnSidebarZenMode,
  body.erp-sidebar-collapsed #erpAppSidebar:not(:hover) #sidebarLiveRevBadge,
  body.erp-sidebar-collapsed #erpAppSidebar:not(:hover) [id^="sidebarDropdownMenu_"],
  body.erp-sidebar-collapsed #erpAppSidebar.sidebar-just-collapsed .erp-sidebar-label,
  body.erp-sidebar-collapsed #erpAppSidebar.sidebar-just-collapsed .erp-sidebar-badge,
  body.erp-sidebar-collapsed #erpAppSidebar.sidebar-just-collapsed .sidebar-nav-badge,
  body.erp-sidebar-collapsed #erpAppSidebar.sidebar-just-collapsed #navBadgeAi,
  body.erp-sidebar-collapsed #erpAppSidebar.sidebar-just-collapsed .erp-sidebar-section-label,
  body.erp-sidebar-collapsed #erpAppSidebar.sidebar-just-collapsed #sidebarLivePulsePod,
  body.erp-sidebar-collapsed #erpAppSidebar.sidebar-just-collapsed #sidebarActiveModuleSubNav,
  body.erp-sidebar-collapsed #erpAppSidebar.sidebar-just-collapsed #sidebarUtilityModeTabs,
  body.erp-sidebar-collapsed #erpAppSidebar.sidebar-just-collapsed #sidebarQuickVoiceBtn,
  body.erp-sidebar-collapsed #erpAppSidebar.sidebar-just-collapsed #sidebarQuickPasteBtn,
  body.erp-sidebar-collapsed #erpAppSidebar.sidebar-just-collapsed #btnSidebarZenMode,
  body.erp-sidebar-collapsed #erpAppSidebar.sidebar-just-collapsed #sidebarLiveRevBadge,
  body.erp-sidebar-collapsed #erpAppSidebar.sidebar-just-collapsed [id^="sidebarDropdownMenu_"] {
    display: none !important;
  }

  body.erp-sidebar-collapsed #erpAppSidebar:not(:hover) .erp-nav-item,
  body.erp-sidebar-collapsed #erpAppSidebar.sidebar-just-collapsed .erp-nav-item,
  body.erp-sidebar-collapsed #erpAppSidebar:not(:hover) #headerSearchInputShell,
  body.erp-sidebar-collapsed #erpAppSidebar.sidebar-just-collapsed #headerSearchInputShell {
    justify-content: center !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  body.erp-sidebar-collapsed #erpAppSidebar:not(:hover) #sidebarTopHeaderZone > div:first-child,
  body.erp-sidebar-collapsed #erpAppSidebar.sidebar-just-collapsed #sidebarTopHeaderZone > div:first-child {
    justify-content: center !important;
  }

  body.erp-sidebar-collapsed #erpAppSidebar:not(:hover) .erp-nav-item > span,
  body.erp-sidebar-collapsed #erpAppSidebar.sidebar-just-collapsed .erp-nav-item > span {
    justify-content: center !important;
    gap: 0 !important;
  }

  body.erp-sidebar-collapsed #sidebarCollapseIcon,
  body.erp-sidebar-collapsed #sidebarCollapseChevron {
    transform: rotate(180deg);
    display: inline-block;
  }

  body.erp-sidebar-collapsed:has(#erpAppSidebar:not(.hidden)) #mainAppContent,
  body.erp-sidebar-collapsed:has(#erpAppSidebar:not(.hidden)) #fullpageWorkspaceBreadcrumbBar,
  body.erp-sidebar-collapsed:has(#erpAppSidebar:not(.hidden)) .erp-fullpage-workspace:not(.hidden) {
    margin-left: 4rem !important;
    width: calc(100% - 4rem) !important;
    max-width: calc(100vw - 4rem) !important;
  }

  /* Custom Drag-Resizable Sidebar Width (220px–340px) */
  body.erp-sidebar-custom-width:not(.erp-sidebar-collapsed):not(.erp-zen-focus-mode) #erpAppSidebar:not(.hidden) {
    width: var(--erp-sidebar-width, 15rem) !important;
  }

  body.erp-sidebar-custom-width:not(.erp-sidebar-collapsed):not(.erp-zen-focus-mode):has(#erpAppSidebar:not(.hidden)) #mainAppContent,
  body.erp-sidebar-custom-width:not(.erp-sidebar-collapsed):not(.erp-zen-focus-mode):has(#erpAppSidebar:not(.hidden)) #fullpageWorkspaceBreadcrumbBar,
  body.erp-sidebar-custom-width:not(.erp-sidebar-collapsed):not(.erp-zen-focus-mode):has(#erpAppSidebar:not(.hidden)) .erp-fullpage-workspace:not(.hidden) {
    margin-left: var(--erp-sidebar-width, 15rem) !important;
    width: calc(100% - var(--erp-sidebar-width, 15rem)) !important;
    max-width: calc(100vw - var(--erp-sidebar-width, 15rem)) !important;
  }

  /* Zen Full-Canvas Focus Mode (Alt+Z): 100% Horizontal & Vertical Canvas with Left-Edge Auto-Summon */
  body.erp-zen-focus-mode #erpZenEdgeSensor {
    display: block !important;
  }

  body.erp-zen-focus-mode #erpZenEdgeSensor:hover {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.38) 0%, transparent 100%);
  }

  body.erp-zen-focus-mode #erpAppSidebar:not(.hidden) {
    transform: translateX(-102%) !important;
    z-index: 58 !important;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease !important;
  }

  body.erp-zen-focus-mode.erp-zen-peek-open #erpAppSidebar:not(.hidden),
  body.erp-zen-focus-mode #erpAppSidebar:not(.hidden):hover {
    transform: translateX(0) !important;
    box-shadow: 24px 0 48px -12px rgba(2, 6, 23, 0.72) !important;
  }

  body.erp-zen-focus-mode:has(#erpAppSidebar:not(.hidden)) #mainAppContent,
  body.erp-zen-focus-mode:has(#erpAppSidebar:not(.hidden)) #fullpageWorkspaceBreadcrumbBar,
  body.erp-zen-focus-mode:has(#erpAppSidebar:not(.hidden)) .erp-fullpage-workspace:not(.hidden) {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
  }
}

@media (max-width: 1023.98px) {
  #erpAppSidebar:not(.hidden) {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100dvh !important;
    width: min(17.5rem, 86vw) !important;
    z-index: 60 !important;
    background-color: #0f172a !important;
    border-right: 1px solid #1e293b !important;
    transform: translateX(-105%) !important;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  body.erp-mobile-drawer-open #erpAppSidebar:not(.hidden) {
    transform: translateX(0) !important;
    box-shadow: 0 25px 50px -12px rgba(2, 6, 23, 0.65) !important;
  }

  body.erp-mobile-drawer-open #erpSidebarBackdrop {
    display: block !important;
  }
}

/* Ensure Full-Application Theme Colorways Override Responsive Sidebar Backgrounds */
body.colorway-midnight #erpAppSidebar:not(.hidden) {
  background-color: #060a12 !important;
  border-right-color: #1e293b !important;
}
body.colorway-industrial #erpAppSidebar:not(.hidden) {
  background-color: #18181b !important;
  border-right-color: #3f3f46 !important;
}
body.colorway-smokehouse #erpAppSidebar:not(.hidden) {
  background-color: #26170c !important;
  border-right-color: #452712 !important;
}
body.colorway-emerald #erpAppSidebar:not(.hidden) {
  background-color: #06392c !important;
  border-right-color: #065f46 !important;
}
body.colorway-crimson #erpAppSidebar:not(.hidden) {
  background-color: #2a0c11 !important;
  border-right-color: #4c141d !important;
}
body.colorway-classic #erpAppSidebar:not(.hidden),
#erpAppSidebar:not(.hidden) {
  background-color: var(--brand-shell, #0c1428) !important;
  border-right-color: var(--brand-shell-border, #1c2847) !important;
}

/* ==========================================================================
   <100ms TACTILE MICRO-INTERACTIONS & OPTIMISTIC FEEDBACK STATES
   ========================================================================== */
button:active:not(:disabled),
.erp-nav-item:active {
  transform: scale(0.98);
}

@keyframes optimisticFlash {
  0% { background-color: rgba(16, 185, 129, 0.18); }
  100% { background-color: transparent; }
}

.optimistic-flash-success {
  animation: optimisticFlash 0.65s ease-out;
}

/* ==========================================================================
   KOLE JAIN & TIM GABE DESIGN SYSTEM (v3.3.6):
   1. "The Receipt Rule" & "Breaking the Commodity Ceiling" — Global Tabular Numerals
   2. 60-30-10 Tinted Neutrals & Unified Sub-Tab Pill Architecture
   3. High-Precision Focus & Micro-Interaction Discipline
   ========================================================================== */
.font-mono,
.tabular-nums,
table td,
table th,
input[type="number"],
#totRevenue,
#totCost,
#totProfit,
#totMargin,
#unitProfitDisplay,
#extProfitDisplay,
#marginBadge,
#finCardArTotal,
#finCardPaidTotal,
#finCardBilledTotal,
#kpiInvCases,
#kpiInvWeight,
#kpiInvValuation,
#kpiInvAlerts,
#clientKpiOrders,
#clientKpiBilled,
#clientKpiPaid,
#clientKpiOpen {
  font-variant-numeric: tabular-nums;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3.5px rgba(16, 185, 129, 0.15), 0 4px 12px -4px rgba(16, 185, 129, 0.14) !important;
}

/* ==========================================================================
   GLOBAL SHADCN/UI + TREMOR ENTERPRISE SAAS SYSTEM (v4.0 — FULL SITE OVERHAUL)
   1. Strict 8-Point Grid & Breathable Off-White Canvas
   2. Slate-900 / Slate-500 Typography Hierarchy
   3. Single Primary Accent (#0f172a) & Soft Semantic Status Badges
   4. Soft Drop Shadows Instead of Harsh Borders
   5. Tremor Category Bars, Progress Meters & Interactive Micro-Lifts
   ========================================================================== */

/* Normalize all cards & modal shells to clean shadcn/ui rounded-xl with soft shadows */
.rounded-2xl,
.rounded-3xl {
  border-radius: 0.75rem !important; /* 12px rounded-xl */
}

/* Remove harsh 2px borders on cards, modals, and inputs across the app */
.border-2:not([type="checkbox"]):not([type="radio"]) {
  border-width: 1px !important;
}

/* Global Modal Dialog Surface Normalization (shadcn/ui Dialog Pattern) */
div[id$="Modal"]:not(.erp-fullpage-workspace):not(#authLockModal) > div:not(.absolute) {
  background-color: #ffffff !important;
  border: 1px solid rgba(226, 232, 240, 0.85) !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06) !important;
}

/* Normalize loud saturated buttons into clean shadcn/ui Slate-900 primary or subtle semantic actions */
button.bg-indigo-600,
button.bg-indigo-700,
button.bg-purple-600,
button.bg-purple-700,
button.bg-blue-600:not(.erp-nav-item),
button.bg-blue-700:not(.erp-nav-item) {
  background-color: #0f172a !important;
  background-image: none !important;
  border-color: #0f172a !important;
  color: #ffffff !important;
  box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.08) !important;
}

button.bg-indigo-600:hover:not(:disabled),
button.bg-indigo-700:hover:not(:disabled),
button.bg-purple-600:hover:not(:disabled),
button.bg-purple-700:hover:not(:disabled),
button.bg-blue-600:hover:not(:disabled):not(.erp-nav-item),
button.bg-blue-700:hover:not(:disabled):not(.erp-nav-item) {
  background-color: #1e293b !important;
  border-color: #1e293b !important;
  color: #ffffff !important;
}

/* Neutralize loud indigo/purple/blue soft fills into clean Slate-50/100 surfaces */
.bg-indigo-50,
.bg-indigo-50\/40,
.bg-indigo-50\/50,
.bg-indigo-50\/60,
.bg-purple-50,
.bg-purple-50\/30,
.bg-purple-50\/50,
.bg-purple-50\/60 {
  background-color: #f8fafc !important;
}

.bg-indigo-100,
.bg-purple-100 {
  background-color: #f1f5f9 !important;
}

.border-indigo-100,
.border-indigo-200,
.border-indigo-300,
.border-purple-200,
.border-purple-300 {
  border-color: #e2e8f0 !important;
}

.text-indigo-600,
.text-indigo-700,
.text-indigo-800,
.text-indigo-900,
.text-purple-600,
.text-purple-700,
.text-purple-800,
.text-purple-900,
.text-purple-950 {
  color: #0f172a !important;
}

/* Tremor Metric Card & Interactive Progress / Category Bar Components */
.tremor-card {
  background: #ffffff !important;
  border: 1px solid rgba(226, 232, 240, 0.72) !important;
  border-radius: 0.75rem !important;
  box-shadow: var(--shadow-stripe) !important;
  padding: 1.25rem !important;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.16s ease, border-color 0.16s ease !important;
}

.tremor-card-interactive {
  cursor: pointer;
}

.tremor-card-interactive:hover {
  transform: translateY(-1px) !important;
  box-shadow: var(--shadow-stripe-hover) !important;
  border-color: rgba(203, 213, 225, 0.95) !important;
}

.tremor-bar-track {
  width: 100%;
  height: 0.5rem;
  background-color: #f1f5f9;
  border-radius: 9999px;
  overflow: hidden;
  display: flex;
  gap: 2px;
}

.tremor-bar-segment {
  height: 100%;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 9999px;
}

.tremor-marker-bar {
  position: relative;
  width: 100%;
  height: 0.5rem;
  background-color: #e2e8f0;
  border-radius: 9999px;
  overflow: visible;
}

.tremor-marker-pin {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 16px;
  transform: translateX(-50%);
  background-color: #0f172a;
  border-radius: 9999px;
  box-shadow: 0 0 0 2px #ffffff;
  transition: left 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 5;
  cursor: pointer;
}

.tremor-marker-pin:hover {
  transform: translateX(-50%) scaleY(1.2) scaleX(1.3);
}

.guardrail-pin-floor {
  background-color: #f59e0b !important;
}

.guardrail-pin-target {
  background-color: #10b981 !important;
}

/* Dynamic Coordinate Ruler Above Guardrail Margin Track */
.guardrail-ruler-endpoint {
  position: absolute;
  top: 0;
  font-size: var(--type-caption);
  font-weight: var(--weight-semibold);
  color: #64748b;
  background: transparent;
  border: none;
  padding: 0 4px;
  border-radius: 4px;
  line-height: 1.2;
}

.guardrail-marker-label {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 0 4px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--type-caption);
  font-weight: var(--weight-bold);
  line-height: 1.25;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  transition: left 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
              background-color 0.15s ease,
              box-shadow 0.15s ease;
  z-index: 6;
}

.guardrail-marker-label:hover {
  transform: translateX(-50%) translateY(-1px) scale(1.05);
}

.guardrail-marker-label-floor {
  background-color: rgba(254, 243, 199, 0.92);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.4);
}

.guardrail-marker-label-target {
  background-color: rgba(209, 250, 229, 0.92);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.4);
}

.guardrail-marker-tick {
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 1.5px;
  height: 5px;
  border-radius: 9999px;
  background-color: currentColor;
  opacity: 0.75;
}

/* Stagger labels cleanly if Floor & Target are configured very close together (<14% scale distance) */
#guardrailRulerHeader[data-tight-spacing="true"] .guardrail-marker-label-floor {
  transform: translateX(-85%);
}
#guardrailRulerHeader[data-tight-spacing="true"] .guardrail-marker-label-floor .guardrail-marker-tick {
  left: 85%;
}
#guardrailRulerHeader[data-tight-spacing="true"] .guardrail-marker-label-target {
  transform: translateX(-15%);
}
#guardrailRulerHeader[data-tight-spacing="true"] .guardrail-marker-label-target .guardrail-marker-tick {
  left: 15%;
}

/* Interactive Scrubber Track Zones & Playhead */
.guardrail-interactive-track {
  cursor: ew-resize;
  user-select: none;
}

.guardrail-track-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
  transition: left 0.25s ease, width 0.25s ease;
}

.guardrail-track-zone-reject {
  background-color: rgba(244, 63, 94, 0.12);
  border-top-left-radius: 9999px;
  border-bottom-left-radius: 9999px;
}

.guardrail-track-zone-warning {
  background-color: rgba(245, 158, 11, 0.14);
}

.guardrail-track-zone-approved {
  background-color: rgba(16, 185, 129, 0.12);
  border-top-right-radius: 9999px;
  border-bottom-right-radius: 9999px;
}

.guardrail-playhead-thumb {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  border-radius: 9999px;
  background-color: #ffffff;
  border: 2px solid #0f172a;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.16);
  z-index: 7;
  pointer-events: none;
  transition: left 0.12s cubic-bezier(0.16, 1, 0.3, 1), transform 0.15s ease;
}

.guardrail-interactive-track:hover .guardrail-playhead-thumb {
  transform: translate(-50%, -50%) scale(1.18);
}

/* Interactive Homepage Bento Widgets (KPI Cards, 7-Day Scrubber Stage, Receipt Ledgers, Acoustic Studio) */
.home-kpi-card,
.home-bento-card {
  position: relative;
  border: 1px solid rgba(226, 232, 240, 0.88) !important;
  box-shadow: var(--shadow-stripe) !important;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.2s ease,
              border-color 0.2s ease !important;
}

.home-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(148, 163, 184, 0.75) !important;
  box-shadow: var(--shadow-stripe-hover) !important;
}

.home-kpi-icon-well {
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.85), 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.15s ease, color 0.15s ease;
}

.home-kpi-card:hover .home-kpi-icon-well,
.home-workflow-card:hover .home-kpi-icon-well {
  transform: scale(1.08) translateY(-1px);
  filter: saturate(1.12) brightness(1.02);
}

.home-receipt-ledger-well {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96) 0%, rgba(241, 245, 249, 0.78) 100%);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.home-chart-stage {
  background-color: rgba(248, 250, 252, 0.72);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.home-line-chart-wrap {
  --home-chart-stroke: #0f172a;
  --home-chart-area-color: #0f172a;
  --home-chart-area-opacity: 0.11;
}

.home-line-chart-wrap[data-metric="lbs"] {
  --home-chart-stroke: #0284c7;
  --home-chart-area-color: #0284c7;
  --home-chart-area-opacity: 0.13;
}

.home-line-chart-wrap[data-metric="margin"] {
  --home-chart-stroke: #059669;
  --home-chart-area-color: #10b981;
  --home-chart-area-opacity: 0.15;
}

.home-line-chart-svg {
  position: absolute;
  left: 0;
  right: 0;
  top: 24px;
  width: 100%;
  height: 92px;
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}

.home-line-grad-stop-top {
  stop-color: var(--home-chart-area-color);
  stop-opacity: var(--home-chart-area-opacity);
}

.home-line-grad-stop-bottom {
  stop-color: var(--home-chart-area-color);
  stop-opacity: 0;
}

.home-line-grid-rule {
  stroke: rgba(148, 163, 184, 0.24);
  stroke-width: 1px;
}

.home-line-target-guide {
  stroke: rgba(5, 150, 105, 0.48);
  stroke-width: 1.25px;
  stroke-dasharray: 4 4;
}

.home-line-stroke-path {
  stroke: var(--home-chart-stroke);
  stroke-width: 2.25px;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.08));
}

.home-scrubber-bar-slot {
  width: 100%;
  height: 92px;
  min-height: 92px;
  position: relative;
  border-radius: 0.5rem;
  background-color: transparent;
  border: 1px solid transparent;
  overflow: visible;
  transition: background-color 0.16s ease;
}

.home-scrubber-bar-col:hover .home-scrubber-bar-slot,
.home-scrubber-bar-col.is-active-day .home-scrubber-bar-slot {
  background-color: rgba(226, 232, 240, 0.35);
}

.home-line-crosshair {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.1) 0%, rgba(100, 116, 139, 0.45) 50%, rgba(148, 163, 184, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.home-scrubber-bar-col:hover .home-line-crosshair,
.home-scrubber-bar-col.is-active-day .home-line-crosshair {
  opacity: 1;
}

.home-line-node {
  position: absolute;
  left: 50%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  border-radius: 9999px;
  background-color: #ffffff;
  border: 2px solid var(--home-chart-stroke, #0f172a);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
  z-index: 25 !important;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.15s ease, border-color 0.15s ease;
}

.home-line-node.is-emerald {
  border-color: #059669;
}

.home-line-node.is-amber {
  border-color: #d97706;
  background-color: #fffbeb;
}

.home-line-node.is-rose {
  border-color: #e11d48;
  background-color: #fff1f2;
}

.home-scrubber-bar-col:hover .home-line-node,
.home-scrubber-bar-col.is-active-day .home-line-node {
  transform: translate(-50%, -50%) scale(1.25);
  background-color: var(--home-chart-stroke, #0f172a);
}

.home-scrubber-bar-col:hover .home-line-node.is-emerald,
.home-scrubber-bar-col.is-active-day .home-line-node.is-emerald {
  background-color: #059669;
}

.home-scrubber-bar-col:hover .home-line-node.is-amber,
.home-scrubber-bar-col.is-active-day .home-line-node.is-amber {
  background-color: #d97706;
}

.home-scrubber-bar-col:hover .home-line-node.is-rose,
.home-scrubber-bar-col.is-active-day .home-line-node.is-rose {
  background-color: #e11d48;
}

.home-line-node-halo {
  position: absolute;
  left: 50%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%) scale(0.5);
  border-radius: 9999px;
  background-color: var(--home-chart-stroke, #0f172a);
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.18s ease;
}

.home-line-node-halo.is-emerald {
  background-color: #10b981;
}

.home-line-node-halo.is-amber {
  background-color: #f59e0b;
}

.home-line-node-halo.is-rose {
  background-color: #f43f5e;
}

.home-scrubber-bar-col:hover .home-line-node-halo,
.home-scrubber-bar-col.is-active-day .home-line-node-halo {
  transform: translate(-50%, -50%) scale(1);
  opacity: 0.18;
}

.home-voice-studio-well {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96) 0%, rgba(241, 245, 249, 0.78) 100%);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.home-sim-preset-btn.is-active-preset {
  box-shadow: 0 0 0 1.5px #0f172a, 0 2px 6px rgba(15, 23, 42, 0.12) !important;
  transform: translateY(-1px);
}

.home-workflow-lane {
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.85) 0%, rgba(248, 250, 252, 0.65) 100%);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.home-cooler-bay-tile {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.15s ease,
              background-color 0.15s ease,
              box-shadow 0.15s ease;
}

.home-cooler-bay-tile:hover {
  transform: translateY(-2px) scale(1.01);
}

.tactile-spell-btn {
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
              background-color 0.15s ease,
              color 0.15s ease,
              box-shadow 0.15s ease !important;
}

.tactile-spell-btn:hover {
  transform: translateY(-1px) scale(1.02);
}

/* Unified shadcn/ui Segmented Sub-Tab Control */
.shadcn-tabs-list {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background-color: #f1f5f9;
  padding: 0.25rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.shadcn-tab-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0.375rem;
  color: #64748b;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.shadcn-tab-trigger:hover {
  color: #0f172a;
}

.shadcn-tab-trigger.active {
  background-color: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.06);
}

/* ==========================================================================
   MACOS DOCK-STYLE HOVER MAGNIFICATION (SIDEBAR, SIDEBAR DROPDOWNS & TOOLS MENU)
   Center-origin spring expansion with generous container inset so hovered items
   never clip against the sidebar box or overflow past the user/tools dropdown
   ========================================================================== */
#erpAppSidebar .erp-nav-item,
#erpAppSidebar .sidebar-dropdown-item,
#erpAppSidebar .erp-sidebar-dropdown-trigger,
#headerToolsDropdown button,
#headerUserDropdown button {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              background-color 0.15s ease,
              color 0.15s ease,
              box-shadow 0.2s ease !important;
  transform-origin: center center !important;
}

#erpAppSidebar .erp-nav-item svg,
#erpAppSidebar .sidebar-dropdown-item svg,
#erpAppSidebar .erp-sidebar-dropdown-trigger svg:first-child,
#headerToolsDropdown button svg,
#headerUserDropdown button svg {
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.15s ease !important;
}

#erpAppSidebar .erp-nav-item:hover,
#erpAppSidebar .erp-sidebar-dropdown-trigger:hover {
  transform: scale(1.032) !important;
  z-index: 10;
  box-shadow: 0 6px 16px -4px rgba(2, 6, 23, 0.45) !important;
}

#erpAppSidebar .sidebar-dropdown-item:hover {
  transform: scale(1.032) !important;
  background-color: rgba(30, 41, 59, 0.9) !important;
  color: #ffffff !important;
  z-index: 10;
  box-shadow: 0 4px 12px -2px rgba(2, 6, 23, 0.4) !important;
}

#headerToolsDropdown button:hover,
#headerUserDropdown button:hover {
  transform: scale(1.026) !important;
  z-index: 10;
  box-shadow: 0 4px 12px -3px rgba(2, 6, 23, 0.35) !important;
}

#erpAppSidebar .erp-nav-item:hover svg,
#erpAppSidebar .sidebar-dropdown-item:hover svg,
#erpAppSidebar .erp-sidebar-dropdown-trigger:hover svg:first-child,
#headerToolsDropdown button:hover svg,
#headerUserDropdown button:hover svg {
  transform: scale(1.22) !important;
}

/* ==========================================================================
   VOICE DICTATION RECORDING ACTIVE STATE OVERRIDE
   Prevents global button normalization from turning the recording button black
   ========================================================================== */
#btnToggleVoiceRecording.is-recording {
  background-color: #e11d48 !important;
  background-image: linear-gradient(135deg, #e11d48 0%, #be123c 100%) !important;
  border-color: #fda4af !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.28), 0 8px 20px -4px rgba(225, 29, 72, 0.5) !important;
}

/* ==========================================================================
   COMPREHENSIVE DARK MODE (colorway-midnight) AUDIT & CONTRAST NORMALIZATION
   Enforces True Red (#dc2626/#ef4444), True Green (#16a34a/#22c55e), and
   True Yellow (#eab308/#facc15) across buttons, sliders, progress bars,
   badges, AR/Rep open-balance columns, and interactive Bento telemetry cards.
   ========================================================================== */
@media screen {
  /* 1. All fractional & solid light slate / white containers (excluding -500/-600 solid classes) */
  body.colorway-midnight :not(#printArea) [class*="bg-slate-50"]:not([class*="500"]):not([class*="600"]),
  body.colorway-midnight :not(#printArea) [class*="bg-slate-100"],
  body.colorway-midnight :not(#printArea) [class*="bg-slate-200"],
  body.colorway-midnight :not(#printArea) [class*="bg-gray-50"]:not([class*="500"]),
  body.colorway-midnight :not(#printArea) [class*="bg-gray-100"] {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
    color: #e2e8f0 !important;
  }

  body.colorway-midnight :not(#printArea) .bg-white:not(.rounded-full),
  body.colorway-midnight :not(#printArea) [class*="bg-white/"],
  body.colorway-midnight .tremor-card,
  body.colorway-midnight div[id$="Modal"]:not(.erp-fullpage-workspace):not(#authLockModal) > div:not(.absolute) {
    background-color: #111827 !important;
    border-color: #1e293b !important;
    color: #f1f5f9 !important;
  }

  /* 2. Semantic Light Tints (-50 / -100 only, strictly excluding -500/-600 solid buttons & bars) */
  body.colorway-midnight :not(#printArea) [class*="bg-emerald-50"]:not([class*="500"]):not([class*="600"]),
  body.colorway-midnight :not(#printArea) [class*="bg-emerald-100"],
  body.colorway-midnight :not(#printArea) [class*="bg-green-50"]:not([class*="500"]):not([class*="600"]),
  body.colorway-midnight :not(#printArea) [class*="bg-green-100"] {
    background-color: rgba(22, 163, 74, 0.22) !important;
    border-color: rgba(34, 197, 94, 0.55) !important;
    color: #22c55e !important;
  }

  body.colorway-midnight :not(#printArea) [class*="bg-rose-50"]:not([class*="500"]):not([class*="600"]),
  body.colorway-midnight :not(#printArea) [class*="bg-rose-100"],
  body.colorway-midnight :not(#printArea) [class*="bg-red-50"]:not([class*="500"]):not([class*="600"]),
  body.colorway-midnight :not(#printArea) [class*="bg-red-100"] {
    background-color: rgba(220, 38, 38, 0.22) !important;
    border-color: rgba(239, 68, 68, 0.55) !important;
    color: #ef4444 !important;
  }

  body.colorway-midnight :not(#printArea) [class*="bg-amber-50"]:not([class*="500"]):not([class*="600"]),
  body.colorway-midnight :not(#printArea) [class*="bg-amber-100"],
  body.colorway-midnight :not(#printArea) [class*="bg-yellow-50"]:not([class*="500"]):not([class*="600"]),
  body.colorway-midnight :not(#printArea) [class*="bg-yellow-100"] {
    background-color: rgba(234, 179, 8, 0.22) !important;
    border-color: rgba(250, 204, 21, 0.55) !important;
    color: #facc15 !important;
  }

  body.colorway-midnight :not(#printArea) [class*="bg-sky-50"]:not([class*="500"]),
  body.colorway-midnight :not(#printArea) [class*="bg-sky-100"],
  body.colorway-midnight :not(#printArea) [class*="bg-blue-50"]:not([class*="500"]),
  body.colorway-midnight :not(#printArea) [class*="bg-blue-100"],
  body.colorway-midnight :not(#printArea) [class*="bg-indigo-50"]:not([class*="500"]),
  body.colorway-midnight :not(#printArea) [class*="bg-indigo-100"],
  body.colorway-midnight :not(#printArea) [class*="bg-purple-50"]:not([class*="500"]),
  body.colorway-midnight :not(#printArea) [class*="bg-purple-100"] {
    background-color: rgba(30, 41, 59, 0.78) !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
  }

  /* 2b. Solid Vivid Semantic Buttons, Progress Bars, and Status Dots in Dark Mode
     Guarantees Reds are Actual Red, Greens are Actual Green, and Yellows are Actual Yellow */
  body.colorway-midnight :not(#printArea) .bg-rose-500,
  body.colorway-midnight :not(#printArea) .bg-rose-600,
  body.colorway-midnight :not(#printArea) .bg-rose-700,
  body.colorway-midnight :not(#printArea) .bg-red-500,
  body.colorway-midnight :not(#printArea) .bg-red-600,
  body.colorway-midnight :not(#printArea) .bg-red-700 {
    background-color: #dc2626 !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
  }

  body.colorway-midnight :not(#printArea) .bg-emerald-500,
  body.colorway-midnight :not(#printArea) .bg-emerald-600,
  body.colorway-midnight :not(#printArea) .bg-emerald-700,
  body.colorway-midnight :not(#printArea) .bg-green-500,
  body.colorway-midnight :not(#printArea) .bg-green-600,
  body.colorway-midnight :not(#printArea) .bg-green-700 {
    background-color: #16a34a !important;
    border-color: #22c55e !important;
    color: #ffffff !important;
  }

  body.colorway-midnight :not(#printArea) .bg-amber-400,
  body.colorway-midnight :not(#printArea) .bg-amber-500,
  body.colorway-midnight :not(#printArea) .bg-amber-600,
  body.colorway-midnight :not(#printArea) .bg-yellow-400,
  body.colorway-midnight :not(#printArea) .bg-yellow-500 {
    background-color: #eab308 !important;
    border-color: #facc15 !important;
    color: #090d16 !important;
  }

  /* 3. High-Contrast Text Legibility in Dark Mode with True Semantic Red, Green, Yellow */
  body.colorway-midnight :not(#printArea) .text-slate-950:not(.guardrail-amber-badge):not(.quick-price-pill-floor):not(.quick-price-pill-mid):not(.bg-amber-500):not(.bg-amber-400),
  body.colorway-midnight :not(#printArea) .text-slate-900,
  body.colorway-midnight :not(#printArea) .text-slate-800 {
    color: #f8fafc !important;
  }

  body.colorway-midnight :not(#printArea) .text-slate-700,
  body.colorway-midnight :not(#printArea) .text-slate-600 {
    color: #cbd5e1 !important;
  }

  body.colorway-midnight :not(#printArea) .text-slate-500,
  body.colorway-midnight :not(#printArea) .text-slate-400 {
    color: #94a3b8 !important;
  }

  body.colorway-midnight :not(#printArea) .text-emerald-950,
  body.colorway-midnight :not(#printArea) .text-emerald-900,
  body.colorway-midnight :not(#printArea) .text-emerald-800,
  body.colorway-midnight :not(#printArea) .text-emerald-700,
  body.colorway-midnight :not(#printArea) .text-emerald-600,
  body.colorway-midnight :not(#printArea) .text-emerald-500,
  body.colorway-midnight :not(#printArea) .text-green-700,
  body.colorway-midnight :not(#printArea) .text-green-600 {
    color: #22c55e !important;
  }

  body.colorway-midnight :not(#printArea) .text-rose-950,
  body.colorway-midnight :not(#printArea) .text-rose-900,
  body.colorway-midnight :not(#printArea) .text-rose-800,
  body.colorway-midnight :not(#printArea) .text-rose-700,
  body.colorway-midnight :not(#printArea) .text-rose-600,
  body.colorway-midnight :not(#printArea) .text-rose-500,
  body.colorway-midnight :not(#printArea) .text-red-700,
  body.colorway-midnight :not(#printArea) .text-red-600 {
    color: #ef4444 !important;
  }

  body.colorway-midnight :not(#printArea) .text-amber-950,
  body.colorway-midnight :not(#printArea) .text-amber-900,
  body.colorway-midnight :not(#printArea) .text-amber-800,
  body.colorway-midnight :not(#printArea) .text-amber-700,
  body.colorway-midnight :not(#printArea) .text-amber-600,
  body.colorway-midnight :not(#printArea) .text-amber-500,
  body.colorway-midnight :not(#printArea) .text-yellow-700,
  body.colorway-midnight :not(#printArea) .text-yellow-600 {
    color: #facc15 !important;
  }

  body.colorway-midnight :not(#printArea) .text-sky-800,
  body.colorway-midnight :not(#printArea) .text-sky-700,
  body.colorway-midnight :not(#printArea) .text-blue-950,
  body.colorway-midnight :not(#printArea) .text-blue-900,
  body.colorway-midnight :not(#printArea) .text-blue-800,
  body.colorway-midnight :not(#printArea) .text-blue-700,
  body.colorway-midnight :not(#printArea) .text-indigo-950,
  body.colorway-midnight :not(#printArea) .text-indigo-900,
  body.colorway-midnight :not(#printArea) .text-indigo-800,
  body.colorway-midnight :not(#printArea) .text-indigo-700,
  body.colorway-midnight :not(#printArea) .text-purple-950,
  body.colorway-midnight :not(#printArea) .text-purple-900,
  body.colorway-midnight :not(#printArea) .text-purple-800,
  body.colorway-midnight :not(#printArea) .text-purple-700 {
    color: #93c5fd !important;
  }

  /* 4. Segmented Sub-Tabs, Tremor Tracks, and Interactive Pill Containers in Dark Mode */
  body.colorway-midnight .shadcn-tabs-list {
    background-color: #0b1120 !important;
    border-color: #1e293b !important;
  }

  body.colorway-midnight .shadcn-tab-trigger {
    color: #94a3b8 !important;
  }

  body.colorway-midnight .shadcn-tab-trigger:hover {
    color: #f8fafc !important;
  }

  body.colorway-midnight .shadcn-tab-trigger.active {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.35) !important;
  }

  body.colorway-midnight .tremor-bar-track,
  body.colorway-midnight .tremor-marker-bar {
    background-color: #0b1120 !important;
    border: 1px solid #1e293b !important;
  }

  body.colorway-midnight .tremor-marker-pin {
    box-shadow: 0 0 0 2px #0b1120 !important;
  }

  body.colorway-midnight .guardrail-pin-floor {
    background-color: #eab308 !important;
  }

  body.colorway-midnight .guardrail-pin-target {
    background-color: #16a34a !important;
  }

  body.colorway-midnight .guardrail-playhead-thumb {
    background-color: #ffffff !important;
    border-color: #0f172a !important;
    box-shadow: 0 0 0 2px #f8fafc, 0 2px 6px rgba(0, 0, 0, 0.65) !important;
  }

  /* 5. Order Desk Guardrail Banner, Ruler Labels & Quick Pricing Pills in Dark Mode */
  body.colorway-midnight #guardrailBanner[data-guardrail-state="neutral"] {
    background-color: #0d1526 !important;
    border-color: #1e293b !important;
  }

  body.colorway-midnight #guardrailBanner[data-guardrail-state="approved"] {
    background-color: rgba(22, 163, 74, 0.16) !important;
    border-color: rgba(34, 197, 94, 0.5) !important;
    box-shadow: inset 0 1px 0 0 rgba(34, 197, 94, 0.2) !important;
  }

  body.colorway-midnight #guardrailBanner[data-guardrail-state="warning"] {
    background-color: rgba(234, 179, 8, 0.16) !important;
    border-color: rgba(250, 204, 21, 0.5) !important;
    box-shadow: inset 0 1px 0 0 rgba(250, 204, 21, 0.2) !important;
  }

  body.colorway-midnight #guardrailBanner[data-guardrail-state="rejected"] {
    background-color: rgba(220, 38, 38, 0.18) !important;
    border-color: rgba(239, 68, 68, 0.52) !important;
    box-shadow: inset 0 1px 0 0 rgba(239, 68, 68, 0.2) !important;
  }

  body.colorway-midnight .guardrail-amber-badge {
    background-color: #eab308 !important;
    color: #090d16 !important;
  }

  body.colorway-midnight .guardrail-marker-label-floor {
    background-color: rgba(234, 179, 8, 0.24) !important;
    color: #facc15 !important;
    border-color: rgba(250, 204, 21, 0.6) !important;
  }

  body.colorway-midnight .guardrail-marker-label-target {
    background-color: rgba(22, 163, 74, 0.26) !important;
    color: #22c55e !important;
    border-color: rgba(34, 197, 94, 0.6) !important;
  }

  body.colorway-midnight .guardrail-track-zone-reject {
    background-color: rgba(220, 38, 38, 0.28) !important;
  }

  body.colorway-midnight .guardrail-track-zone-warning {
    background-color: rgba(234, 179, 8, 0.28) !important;
  }

  body.colorway-midnight .guardrail-track-zone-approved {
    background-color: rgba(22, 163, 74, 0.28) !important;
  }

  body.colorway-midnight #quickPricePills .quick-price-pill-floor,
  body.colorway-midnight #homeSimBtnFloor {
    background-color: rgba(234, 179, 8, 0.24) !important;
    color: #facc15 !important;
    border: 1px solid rgba(250, 204, 21, 0.6) !important;
  }

  body.colorway-midnight #quickPricePills .quick-price-pill-mid {
    background-color: rgba(234, 179, 8, 0.18) !important;
    color: #fde047 !important;
    border: 1px solid rgba(250, 204, 21, 0.45) !important;
  }

  body.colorway-midnight #quickPricePills .quick-price-pill-target,
  body.colorway-midnight #homeSimBtnTarget {
    background-color: rgba(22, 163, 74, 0.26) !important;
    color: #22c55e !important;
    border: 1px solid rgba(34, 197, 94, 0.6) !important;
  }

  body.colorway-midnight #quickPricePills .quick-price-pill-sku,
  body.colorway-midnight #homeSimBtnPremium {
    background-color: rgba(30, 41, 59, 0.92) !important;
    color: #f8fafc !important;
    border: 1px solid #475569 !important;
  }

  body.colorway-midnight #quickPricePills .quick-price-pill.is-active-benchmark {
    box-shadow: 0 0 0 2px #22c55e, 0 4px 12px rgba(2, 6, 23, 0.5) !important;
  }

  /* Homepage Interactive Bento Widgets in Dark Mode:
     Preserve true Emerald/Amber/Rose bars in Margin % mode and clean slate/green in Revenue/Lbs mode */
  body.colorway-midnight .home-kpi-card,
  body.colorway-midnight .home-bento-card {
    background-color: #111a2c !important;
    border-color: #1e293b !important;
    box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.45), inset 0 1px 0 0 rgba(255, 255, 255, 0.05) !important;
  }

  body.colorway-midnight .home-kpi-card:hover {
    border-color: #334155 !important;
    box-shadow: 0 10px 24px -6px rgba(0, 0, 0, 0.6), inset 0 1px 0 0 rgba(255, 255, 255, 0.09) !important;
  }

  body.colorway-midnight .home-kpi-icon-well {
    background-color: rgba(15, 23, 42, 0.85) !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.06) !important;
  }

  body.colorway-midnight .home-kpi-card:hover .home-kpi-icon-well,
  body.colorway-midnight .home-workflow-card:hover .home-kpi-icon-well {
    background-color: #16a34a !important;
    border-color: #22c55e !important;
    color: #ffffff !important;
  }

  body.colorway-midnight .home-kpi-meter-track {
    background-color: #0b1120 !important;
    border: 1px solid #1e293b !important;
  }

  body.colorway-midnight .home-receipt-ledger-well {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92) 0%, rgba(11, 17, 32, 0.88) 100%) !important;
    border-color: #1e293b !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4) !important;
  }

  body.colorway-midnight .home-chart-stage {
    background-color: rgba(11, 17, 32, 0.78) !important;
    border-color: #1e293b !important;
  }

  body.colorway-midnight .home-line-chart-wrap {
    --home-chart-stroke: #38bdf8;
    --home-chart-area-color: #38bdf8;
    --home-chart-area-opacity: 0.22;
  }

  body.colorway-midnight .home-line-chart-wrap[data-metric="lbs"] {
    --home-chart-stroke: #38bdf8;
    --home-chart-area-color: #38bdf8;
    --home-chart-area-opacity: 0.22;
  }

  body.colorway-midnight .home-line-chart-wrap[data-metric="margin"] {
    --home-chart-stroke: #10b981;
    --home-chart-area-color: #10b981;
    --home-chart-area-opacity: 0.24;
  }

  body.colorway-midnight .home-line-grid-rule {
    stroke: rgba(148, 163, 184, 0.14);
  }

  body.colorway-midnight .home-line-target-guide {
    stroke: rgba(34, 197, 94, 0.52);
  }

  body.colorway-midnight .home-scrubber-bar-slot {
    background-color: transparent !important;
    border-color: transparent !important;
  }

  body.colorway-midnight .home-scrubber-bar-col:hover .home-scrubber-bar-slot,
  body.colorway-midnight .home-scrubber-bar-col.is-active-day .home-scrubber-bar-slot {
    background-color: rgba(30, 41, 59, 0.42) !important;
    border-color: transparent !important;
  }

  body.colorway-midnight .home-line-node {
    background-color: #0f172a;
    border-color: var(--home-chart-stroke, #38bdf8);
  }

  body.colorway-midnight .home-line-node.is-emerald {
    border-color: #22c55e;
  }

  body.colorway-midnight .home-line-node.is-amber {
    border-color: #facc15;
    background-color: #1e293b;
  }

  body.colorway-midnight .home-line-node.is-rose {
    border-color: #ef4444;
    background-color: #1e293b;
  }

  body.colorway-midnight .home-scrubber-bar-col:hover .home-line-node,
  body.colorway-midnight .home-scrubber-bar-col.is-active-day .home-line-node {
    background-color: var(--home-chart-stroke, #38bdf8);
  }

  body.colorway-midnight .home-scrubber-bar-col:hover .home-line-node.is-emerald,
  body.colorway-midnight .home-scrubber-bar-col.is-active-day .home-line-node.is-emerald {
    background-color: #22c55e;
  }

  body.colorway-midnight .home-scrubber-bar-col:hover .home-line-node.is-amber,
  body.colorway-midnight .home-scrubber-bar-col.is-active-day .home-line-node.is-amber {
    background-color: #facc15;
  }

  body.colorway-midnight .home-scrubber-bar-col:hover .home-line-node.is-rose,
  body.colorway-midnight .home-scrubber-bar-col.is-active-day .home-line-node.is-rose {
    background-color: #ef4444;
  }

  body.colorway-midnight #homeChartTargetLine {
    background-color: rgba(30, 41, 59, 0.9) !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
  }

  body.colorway-midnight .home-workflow-lane {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.78) 0%, rgba(11, 17, 32, 0.68) 100%) !important;
    border-color: #1e293b !important;
  }

  body.colorway-midnight .home-sim-preset-btn.is-active-preset {
    box-shadow: 0 0 0 1.5px #22c55e, 0 2px 8px rgba(0, 0, 0, 0.5) !important;
  }

  body.colorway-midnight .home-cooler-bay-tile.is-selected-bay {
    border-color: #22c55e !important;
    background-color: rgba(15, 23, 42, 0.95) !important;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35) !important;
  }

  /* 6. Header Breadcrumb & Dropdown Menus in Dark Mode */
  body.colorway-midnight #headerBreadcrumbTrail {
    background-color: rgba(15, 23, 42, 0.85) !important;
    border-color: #1e293b !important;
  }

  body.colorway-midnight #headerToolsDropdown,
  body.colorway-midnight #headerUserDropdown,
  body.colorway-midnight #universalSearchModal.header-search-dropdown {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
    color: #f8fafc !important;
  }

  body.colorway-midnight #headerToolsDropdown button:hover,
  body.colorway-midnight #headerUserDropdown button:hover {
    background-color: #1e293b !important;
  }

  body.colorway-midnight #headerSearchInputShell {
    background-color: rgba(15, 23, 42, 0.9) !important;
    border-color: #334155 !important;
  }

  body.colorway-midnight .header-omnibar-container.is-search-open #headerSearchInputShell {
    background-color: #0f172a !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
  }
}

/* ==========================================================================
   EXPANDING TOP-BAR OMNIBAR SEARCH & ANCHORED OVERLAY DROPDOWN
   ========================================================================== */
#headerBrandLogoBox {
  display: none !important;
}

.header-omnibar-container {
  max-width: 100%;
  width: 100%;
  transition: max-width 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-omnibar-container.is-search-open,
.header-omnibar-container:focus-within {
  max-width: 38rem;
}

#headerSearchInputShell {
  height: 32px !important;
  padding: 0 10px !important;
  border-radius: 8px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  background-color: rgba(255, 255, 255, 0.07) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #f1f5f9 !important;
  box-shadow: none !important;
}

#headerSearchInputShell:hover {
  background-color: rgba(255, 255, 255, 0.11) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}

.header-omnibar-container.is-search-open #headerSearchInputShell,
.header-omnibar-container:focus-within #headerSearchInputShell {
  background-color: rgba(15, 23, 42, 0.96) !important;
  border-color: rgba(148, 163, 184, 0.42) !important;
  box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(148, 163, 184, 0.16) !important;
}

input#universalSearchInput {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: var(--type-caption) !important;
  font-weight: var(--weight-medium) !important;
  line-height: 32px !important;
  color: #f8fafc !important;
  outline: none !important;
}

input#universalSearchInput::placeholder {
  color: #94a3b8 !important;
  opacity: 1 !important;
}

/* Override generic div[id$="Modal"] rules for the sidebar-anchored floating search dropdown */
div#universalSearchModal.header-search-dropdown {
  position: fixed !important;
  inset: auto !important;
  top: 0.75rem !important;
  left: calc(var(--erp-sidebar-width, 15rem) + 0.75rem) !important;
  width: min(40rem, calc(100vw - var(--erp-sidebar-width, 15rem) - 1.5rem)) !important;
  max-width: 40rem !important;
  padding: 0 !important;
  background-color: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: 0.75rem !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  box-shadow: 0 24px 48px -12px rgba(2, 6, 23, 0.42), 0 4px 12px -2px rgba(15, 23, 42, 0.14) !important;
  z-index: 9990 !important;
}

body.erp-sidebar-collapsed div#universalSearchModal.header-search-dropdown {
  left: 4.75rem !important;
  width: min(40rem, calc(100vw - 5.5rem)) !important;
}

@media (max-width: 1023.98px) {
  div#universalSearchModal.header-search-dropdown {
    left: 0.75rem !important;
    right: 0.75rem !important;
    top: 3.5rem !important;
    width: calc(100vw - 1.5rem) !important;
    max-width: calc(100vw - 1.5rem) !important;
  }
}

/* Sidebar Footer User Account Popover (Opens upward above #erpSidebarFooter, Never Clipped) */
#headerUserDropdown {
  position: fixed !important;
  bottom: 3.85rem !important;
  left: 0.75rem !important;
  width: 18rem !important;
  max-width: calc(100vw - 1.5rem) !important;
  background-color: #0b1326 !important;
  border: 1px solid #1e293b !important;
  box-shadow: 0 24px 48px -12px rgba(2, 6, 23, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
  z-index: 9990 !important;
}

div#universalSearchModal.header-search-dropdown > div:not(.absolute) {
  border: none !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.7) !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  max-height: none !important;
  margin: 0 !important;
}

div#universalSearchModal.header-search-dropdown > div#universalSearchResults {
  max-height: 24rem !important;
  overflow-y: auto !important;
}

/* ==========================================================================
   REAL-TIME 24-BAR WEB AUDIO API SOUNDWAVE EQUALIZER & DICTATION BUTTONS
   Reacts at 60fps to live hardware microphone frequency & RMS energy
   ========================================================================== */
.voice-soundwave-stage {
  position: relative;
  overflow: hidden;
  background-color: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.voice-wave-bar {
  flex: 1 1 0%;
  min-width: 3px;
  max-width: 6px;
  border-radius: 9999px;
  background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
  opacity: 0.58;
  transition: height 0.06s ease-out, background 0.12s ease, opacity 0.12s ease, box-shadow 0.12s ease;
  will-change: height;
}

.voice-soundwave-stage.is-listening .voice-wave-bar {
  background: linear-gradient(180deg, #334155 0%, #0f172a 100%);
  opacity: 0.88;
}

.voice-soundwave-stage.is-listening .voice-wave-bar.is-active-peak {
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  opacity: 1;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}

body.colorway-midnight .voice-soundwave-stage {
  background-color: rgba(11, 17, 32, 0.9) !important;
  border-color: #1e293b !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45) !important;
}

body.colorway-midnight .voice-wave-bar {
  background: linear-gradient(180deg, #64748b 0%, #475569 100%);
  opacity: 0.72;
}

body.colorway-midnight .voice-soundwave-stage.is-listening .voice-wave-bar {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  opacity: 0.92;
}

body.colorway-midnight .voice-soundwave-stage.is-listening .voice-wave-bar.is-active-peak {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  opacity: 1;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.55);
}

body.colorway-midnight .home-voice-syntax-chip {
  background-color: #0f172a !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

/* Homepage Dictation Button: Vivid Opaque Crimson Red (Idle) / Emerald Green (Recording) in ALL Themes */
button#btnHomeVoiceDictate,
body.colorway-midnight button#btnHomeVoiceDictate {
  background-color: #dc2626 !important;
  background-image: linear-gradient(180deg, #ef4444 0%, #dc2626 100%) !important;
  color: #ffffff !important;
  border: 1px solid #ef4444 !important;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35) !important;
}

button#btnHomeVoiceDictate:hover,
body.colorway-midnight button#btnHomeVoiceDictate:hover {
  background-color: #ef4444 !important;
  background-image: linear-gradient(180deg, #f87171 0%, #dc2626 100%) !important;
  color: #ffffff !important;
}

button#btnHomeVoiceDictate.is-recording,
body.colorway-midnight button#btnHomeVoiceDictate.is-recording {
  background-color: #16a34a !important;
  background-image: linear-gradient(180deg, #22c55e 0%, #16a34a 100%) !important;
  color: #ffffff !important;
  border: 1px solid #22c55e !important;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.28), 0 4px 12px rgba(22, 163, 74, 0.4) !important;
}

#btnHomeVoiceDictateDot,
body.colorway-midnight #btnHomeVoiceDictateDot {
  background-color: #ffffff !important;
}

/* Quick Margin Sandbox Interactive Range Slider: True Red / True Yellow / True Green Track */
input#homeSimMarginSlider {
  -webkit-appearance: none;
  appearance: none;
  height: 8px !important;
  border-radius: 9999px !important;
  background: linear-gradient(90deg, #dc2626 0%, #dc2626 28.5%, #eab308 28.5%, #eab308 42.8%, #16a34a 42.8%, #16a34a 100%) !important;
  border: none !important;
  outline: none !important;
}

input#homeSimMarginSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 9999px;
  background: #ffffff;
  border: 2px solid #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

/* ==========================================================================
   EMOTIONAL DESIGN AUTHENTICATION GATEWAY & CHOREOGRAPHED WELCOME MOMENT (v3.5.0)
   Hardware-accelerated (transform + opacity) micro-interactions, Revolut-style
   tactile feedback, reactive trust signals, and smooth human-centric handoff.
   ========================================================================== */
#authLockModal {
  background:
    radial-gradient(circle at 16% 18%, rgba(37, 99, 235, 0.22) 0%, transparent 45%),
    radial-gradient(circle at 84% 82%, rgba(16, 185, 129, 0.14) 0%, transparent 48%),
    linear-gradient(145deg, #050914 0%, #0b1326 52%, #070c18 100%) !important;
  padding: clamp(0.75rem, 2.5vw, 2rem) !important;
  overflow-y: auto !important;
}

#authLockModal > #authLockCard,
.auth-emotional-card {
  max-width: 60rem !important;
  width: 100% !important;
  min-width: 0 !important;
  border-radius: 1rem !important;
  box-shadow:
    0 32px 64px -16px rgba(2, 6, 23, 0.68),
    0 12px 24px -8px rgba(15, 23, 42, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.1) !important;
  animation: authCardEntrance 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform, opacity;
}

@keyframes authCardEntrance {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Left Brand Trust Panel: Cursor-Tracking Radial Spotlight */
#authBrandTrustPanel {
  --auth-spot-x: 50%;
  --auth-spot-y: 32%;
  background: linear-gradient(165deg, #0b1326 0%, #070c18 62%, #050914 100%);
}

.auth-ambient-spotlight {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    360px circle at var(--auth-spot-x, 50%) var(--auth-spot-y, 32%),
    rgba(56, 189, 248, 0.14) 0%,
    rgba(16, 185, 129, 0.06) 42%,
    transparent 75%
  );
  transition: opacity 0.25s ease;
}

@keyframes authPulseGlow {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(1.22);
  }
}

.auth-pulse-dot {
  animation: authPulseGlow 2.4s ease-in-out infinite;
}

.auth-trust-pill,
.auth-trust-feature-card {
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.2s ease,
              background-color 0.2s ease;
}

.auth-trust-pill:hover,
.auth-trust-feature-card:hover {
  transform: translateX(3px);
  border-color: rgba(52, 211, 153, 0.35) !important;
  background-color: rgba(15, 23, 42, 0.98) !important;
}

/* Tactile Input Shells & Gentle Focus Glow */
.auth-input-shell {
  border-radius: 0.75rem;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-input-shell:focus-within {
  transform: translateY(-1px);
}

.auth-tactile-input {
  transition: border-color 0.18s ease,
              background-color 0.18s ease,
              box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

.auth-tactile-input:hover:not(:focus) {
  border-color: #94a3b8 !important;
  background-color: #ffffff !important;
}

.auth-tactile-input:focus,
.auth-tactile-input:focus-visible {
  background-color: #ffffff !important;
  border-color: #0f172a !important;
  box-shadow:
    0 0 0 3.5px rgba(15, 23, 42, 0.08),
    0 8px 20px -6px rgba(15, 23, 42, 0.12) !important;
}

.auth-tactile-input.is-verified-field {
  border-color: rgba(16, 185, 129, 0.65) !important;
  background-color: #ffffff !important;
}

.auth-tactile-input.is-verified-field:focus {
  box-shadow:
    0 0 0 3.5px rgba(16, 185, 129, 0.14),
    0 8px 20px -6px rgba(16, 185, 129, 0.12) !important;
}

/* Pop-In Spring Micro-Animation for Validation Checkmarks & Identity Card */
@keyframes authPopSpring {
  0% {
    opacity: 0;
    transform: scale(0.82) translateY(3px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.auth-pop-in,
.auth-identity-preview-card:not(.hidden) {
  animation: authPopSpring 0.26s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  will-change: transform, opacity;
}

/* Step Transition Choreography (Step 1 <-> Step 2 2FA) */
@keyframes authStepFadeSlideIn {
  0% {
    opacity: 0;
    transform: translateX(10px) scale(0.99);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.auth-step-panel:not(.hidden) {
  animation: authStepFadeSlideIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform, opacity;
}

/* Tactile Horizontal Micro-Shake on Invalid Credentials / 2FA Mismatch */
@keyframes authErrorMicroShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.auth-shake-error {
  animation: authErrorMicroShake 0.38s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* Primary CTA Button Tactile Polish */
.auth-primary-cta-btn,
.auth-primary-submit-btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
              background-color 0.18s ease,
              box-shadow 0.22s ease !important;
}

.auth-primary-cta-btn:hover:not(:disabled),
.auth-primary-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -8px rgba(15, 23, 42, 0.45) !important;
}

.auth-primary-cta-btn:active:not(:disabled),
.auth-primary-submit-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.985);
}

/* 6-Slot Visual 2FA Digit Feedback */
.auth-mfa-slot.is-active {
  border-color: #0f172a !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08), 0 6px 12px -4px rgba(15, 23, 42, 0.12);
}

.auth-mfa-slot.is-filled {
  border-color: rgba(16, 185, 129, 0.65) !important;
  background-color: #ecfdf5 !important;
  color: #065f46 !important;
  transform: translateY(-1px);
}

/* Quick-Fill Role Pass Chips */
.auth-role-pass-chip {
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.16s ease,
              background-color 0.16s ease,
              box-shadow 0.16s ease;
}

.auth-role-pass-chip:hover {
  transform: translateY(-1.5px);
}

.auth-role-pass-chip.is-matched {
  border-color: #10b981 !important;
  background-color: #ecfdf5 !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.18), 0 4px 10px -2px rgba(16, 185, 129, 0.15);
}

/* Choreographed Post-Login Welcome Moment Overlay */
#authWelcomeMomentOverlay {
  background: radial-gradient(circle at 50% 42%, rgba(15, 23, 42, 0.88) 0%, rgba(5, 9, 20, 0.96) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

#authWelcomeMomentOverlay.is-fading-out {
  opacity: 0;
  pointer-events: none;
}

.auth-welcome-moment-card {
  animation: authWelcomeCardIn 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform, opacity;
}

@keyframes authWelcomeCardIn {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-welcome-check-svg path {
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
  animation: authCheckDraw 0.42s 0.08s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes authCheckDraw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes authWelcomeProgressSweep {
  0% { width: 12%; }
  100% { width: 100%; }
}

.auth-welcome-progress-Sweep {
  animation: authWelcomeProgressSweep 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ========================================================================= */
/* APP-WIDE EMOTIONAL DESIGN CONTINUITY:                                     */
/* - Post-Login Session Entrance Choreography (body.erp-session-entering)    */
/* - Smooth GPU-Composited Tab, Sub-Tab, Workspace & Dialog Transitions      */
/* - Universal Tactile Input Glow & Live Validation Cues                     */
/* - Spring-Physics Toast Notifications & Action Confirmation Pulse          */
/* ========================================================================= */

@keyframes erpSurfaceEnter {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes erpSessionShellReveal {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.994);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

body.erp-session-entering #mainAppHeader:not(.hidden) {
  animation: erpSurfaceEnter 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.erp-session-entering #erpAppSidebar:not(.hidden) {
  animation: none !important;
  transform: none !important;
}

body.erp-session-entering #mainAppContent:not(.hidden) {
  animation: erpSessionShellReveal 0.36s 0.07s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Smooth Step & Workspace Transitions across Primary Tabs, Sub-Tabs & Full-Page Workspaces */
main#mainAppContent > div[id^="erpTabContent_"]:not(.hidden),
div[id^="invSubPanel_"]:not(.hidden),
div[id^="finSubPanel_"]:not(.hidden),
div[id^="secTabPanel_"]:not(.hidden),
div[id^="entIndTabPanel_"]:not(.hidden),
div[id^="saasDevTabPanel_"]:not(.hidden),
.erp-fullpage-workspace:not(.hidden) > div {
  animation: erpSurfaceEnter 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform, opacity;
}

/* Modal Dialog Card Entrance Polish */
div[id$="Modal"].fixed:not(.erp-fullpage-workspace):not(#authLockModal):not(.hidden) > div:not(.absolute) {
  animation: authStepReveal 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform, opacity;
}

/* Universal Tactile Input Glow & Subtle Elevation across the App */
#mainAppContent input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
#mainAppContent select,
#mainAppContent textarea,
.erp-fullpage-workspace input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
.erp-fullpage-workspace select,
.erp-fullpage-workspace textarea,
div[id$="Modal"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
div[id$="Modal"] select,
div[id$="Modal"] textarea {
  transition: border-color 0.18s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.2s cubic-bezier(0.22, 1, 0.36, 1),
              background-color 0.18s ease,
              transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

:where(#mainAppContent) input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):focus,
:where(#mainAppContent) select:focus,
:where(#mainAppContent) textarea:focus,
.erp-fullpage-workspace input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):focus,
.erp-fullpage-workspace select:focus,
.erp-fullpage-workspace textarea:focus,
:where(div[id$="Modal"]) input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):focus,
:where(div[id$="Modal"]) select:focus,
:where(div[id$="Modal"]) textarea:focus {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3.5px rgba(16, 185, 129, 0.15), 0 4px 12px -4px rgba(16, 185, 129, 0.14) !important;
  transform: translateY(-0.5px);
}

/* Subtle Emerald Input Validation Confirmation Cue */
.emotional-input-confirmed {
  border-color: rgba(16, 185, 129, 0.65) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12) !important;
}

/* Tactile Action Confirmation Pulse */
@keyframes emotionalActionPulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.38);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.emotional-action-pulse {
  animation: emotionalActionPulseGlow 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Upgraded Emotional Feedback Toast (#validationBanner) */
#validationBanner:not(.hidden) {
  animation: emotionalToastEnter 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

@keyframes emotionalToastEnter {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Respect Reduced Motion Accessibility Preferences */
@media (prefers-reduced-motion: reduce) {
  #authLockModal > #authLockCard,
  .auth-emotional-card,
  .auth-pop-in,
  .auth-identity-preview-card:not(.hidden),
  .auth-step-panel:not(.hidden),
  .auth-shake-error,
  .auth-welcome-moment-card,
  .auth-welcome-check-svg path,
  body.erp-session-entering #mainAppHeader:not(.hidden),
  body.erp-session-entering #erpAppSidebar:not(.hidden),
  body.erp-session-entering #mainAppContent:not(.hidden),
  main#mainAppContent > div[id^="erpTabContent_"]:not(.hidden),
  div[id^="invSubPanel_"]:not(.hidden),
  div[id^="finSubPanel_"]:not(.hidden),
  div[id^="secTabPanel_"]:not(.hidden),
  div[id^="entIndTabPanel_"]:not(.hidden),
  div[id^="saasDevTabPanel_"]:not(.hidden),
  .erp-fullpage-workspace:not(.hidden) > div,
  div[id$="Modal"].fixed:not(.erp-fullpage-workspace):not(#authLockModal):not(.hidden) > div:not(.absolute),
  #validationBanner:not(.hidden),
  .emotional-action-pulse {
    animation: none !important;
    transition: none !important;
    stroke-dashoffset: 0 !important;
  }
}

/* ==========================================================================
   SYSTEM DIRECTIVE: UI/UX & INTERACTION REFACTORING PROTOCOL (v3.6.0)
   1. Spatial Geometry & Layout Architecture (Strict 8-Point / 4-Point Grid,
      The Receipt Principle, Card Container De-Nesting)
   2. Strict 4-Size Type Scale & 2-Weight Tier Discipline + Header Tightening
   3. 60-30-10 Brand-Tinted Neutrals, Zero Pure #000000, Subdued Default Filters
   4. Complete 5-State Control Architecture & Ultra-Subtle Elevation
   5. Zero Dead Ends Service Recovery, 5-Second Undo Bridges & Determinate Bar
   6. Behavioral Retention & Intrinsic Competence Loops + Peak-End Delivery
   ========================================================================== */

/* 1A. STRICT 8-POINT / 4-POINT GRID NORMALIZATION (Eliminate Fractional Tailwind Steps) */
#mainAppContent .p-2\.5,
.erp-fullpage-workspace .p-2\.5,
div[id$="Modal"] .p-2\.5 { padding: var(--space-2) !important; }

#mainAppContent .p-3\.5,
.erp-fullpage-workspace .p-3\.5,
div[id$="Modal"] .p-3\.5 { padding: var(--space-4) !important; }

#mainAppContent .px-2\.5,
.erp-fullpage-workspace .px-2\.5,
div[id$="Modal"] .px-2\.5 { padding-left: var(--space-2) !important; padding-right: var(--space-2) !important; }

#mainAppContent .px-3\.5,
.erp-fullpage-workspace .px-3\.5,
div[id$="Modal"] .px-3\.5 { padding-left: var(--space-4) !important; padding-right: var(--space-4) !important; }

#mainAppContent .py-1\.5,
.erp-fullpage-workspace .py-1\.5,
div[id$="Modal"] .py-1\.5 { padding-top: var(--space-1) !important; padding-bottom: var(--space-1) !important; }

#mainAppContent .py-2\.5,
.erp-fullpage-workspace .py-2\.5,
div[id$="Modal"] .py-2\.5 { padding-top: var(--space-2) !important; padding-bottom: var(--space-2) !important; }

#mainAppContent .py-3\.5,
.erp-fullpage-workspace .py-3\.5,
div[id$="Modal"] .py-3\.5 { padding-top: var(--space-4) !important; padding-bottom: var(--space-4) !important; }

#mainAppContent .gap-1\.5,
.erp-fullpage-workspace .gap-1\.5,
div[id$="Modal"] .gap-1\.5 { gap: var(--space-1) !important; }

#mainAppContent .gap-2\.5,
.erp-fullpage-workspace .gap-2\.5,
div[id$="Modal"] .gap-2\.5 { gap: var(--space-2) !important; }

#mainAppContent .gap-3\.5,
.erp-fullpage-workspace .gap-3\.5,
div[id$="Modal"] .gap-3\.5 { gap: var(--space-4) !important; }

/* 1B. THE RECEIPT PRINCIPLE (Hard-Left Labels / Hard-Right Numerics, Timestamps & CTAs) */
.receipt-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: var(--space-2) !important;
  width: 100% !important;
}

.receipt-label {
  text-align: left !important;
  justify-content: flex-start !important;
  min-width: 0;
}

.receipt-value,
.receipt-numeric,
.receipt-cta {
  text-align: right !important;
  justify-content: flex-end !important;
  font-variant-numeric: tabular-nums !important;
  font-feature-settings: "tnum" 1 !important;
  margin-left: auto !important;
  flex-shrink: 0;
}

table thead th:first-child,
table tbody td:first-child {
  text-align: left;
}

table td.font-mono,
table th.text-right,
table td.text-right {
  text-align: right !important;
  font-variant-numeric: tabular-nums !important;
  font-feature-settings: "tnum" 1 !important;
}

/* 1C. CARD CONTAINER DE-NESTING (Eliminate "Borders on Borders" & Nested Card Outlines) */
#mainAppContent .home-bento-card .bg-white:not(button):not(input):not(select):not(.guardrail-playhead-thumb),
#mainAppContent .erp-surface-card .bg-white:not(button):not(input):not(select),
#mainAppContent #basketCard .bg-white:not(button):not(input):not(select),
#mainAppContent .bg-white.rounded-xl .bg-white.rounded-xl:not(button),
#mainAppContent .bg-white.rounded-xl .bg-slate-50.rounded-xl:not(button),
.erp-fullpage-workspace .bg-white.rounded-xl .bg-white.rounded-xl:not(button),
.erp-fullpage-workspace .bg-white.rounded-xl .bg-slate-50.rounded-xl:not(button) {
  box-shadow: none !important;
  border-color: rgba(226, 232, 240, 0.65) !important;
}

/* Shared Structural Column Dividers for De-Nested Groups */
.structural-divider-list > * + * {
  border-top: 1px solid var(--border-card) !important;
}

/* 2A. STRICT 4-SIZE TYPE SCALE & 2-WEIGHT TIER NORMALIZATION */
/* Tier 1: Display / Page Heading (22px Bold 700, tracking -0.025em, line-height 1.15) */
h1,
.text-xl,
.text-2xl,
.text-3xl,
.text-4xl,
.type-display {
  font-size: var(--type-display) !important;
  font-weight: var(--weight-bold) !important;
  letter-spacing: -0.025em !important;
  line-height: 1.15 !important;
}

/* Tier 2: Section Heading / Subtitle (16px Semi-Bold 600) */
h2,
h3,
.text-base,
.text-lg,
.type-heading {
  font-size: var(--type-heading) !important;
  font-weight: var(--weight-semibold) !important;
  letter-spacing: -0.018em !important;
  line-height: 1.25 !important;
}

/* Tier 3: Body / Standard Data (14px Regular 400 / Medium 500) */
.text-sm,
.type-body,
table tbody td {
  font-size: var(--type-body) !important;
  line-height: 1.45 !important;
}

/* Tier 4: Caption & Micro-Instrumentation Pills (Proportional Precision Sizing) */
[class*="text-[9px]"] {
  font-size: 0.625rem !important; /* 10px micro-badge */
  line-height: 1.3 !important;
}

[class*="text-[10px]"] {
  font-size: 0.65625rem !important; /* 10.5px telemetry tag */
  line-height: 1.32 !important;
}

[class*="text-[11px]"] {
  font-size: 0.6875rem !important; /* 11px compact label */
  line-height: 1.35 !important;
}

.text-xs,
[class*="text-[12px]"],
.type-caption {
  font-size: var(--type-caption) !important;
  line-height: 1.35 !important;
}

/* Normalize Font Weights Strictly to Two Tiers: Regular/Medium (400/500) & Semi-Bold/Bold (600/700) */
.font-light,
.font-normal {
  font-weight: var(--weight-regular) !important;
}

.font-medium {
  font-weight: var(--weight-medium) !important;
}

.font-semibold {
  font-weight: var(--weight-semibold) !important;
}

.font-bold,
.font-extrabold,
.font-black {
  font-weight: var(--weight-bold) !important;
}

/* 2B. TABULAR NUMERALS & MONOSPACE ALIGNMENT ACROSS ALL LIVE METRICS */
[id*="kpi"],
[id*="Kpi"],
[id*="Total"],
[id*="Count"],
[id*="Margin"],
[id*="Profit"],
[id*="Revenue"],
[id*="Weight"],
[id*="Price"],
[id*="Cost"],
[id*="Balance"],
[id*="Badge"],
.tabular-metric {
  font-variant-numeric: tabular-nums !important;
  font-feature-settings: "tnum" 1 !important;
}

/* 3. SEMANTIC COLOR RESERVATION: SUBDUED NEUTRAL DEFAULT FILTERS */
.shadcn-tab-trigger:not(.active),
.subdued-filter-pill:not(.is-active) {
  background-color: transparent !important;
  color: var(--text-muted) !important;
  border-color: transparent !important;
}

.shadcn-tab-trigger.active,
.subdued-filter-pill.is-active {
  background-color: var(--surface-card) !important;
  color: var(--text-main) !important;
  box-shadow: var(--shadow-stripe) !important;
}

/* 4. INTERACTIVE STATE COMPLETENESS (5-STATE CONTROL REQUIREMENT) */
button,
[role="button"],
.interactive-control {
  position: relative;
  transition: background-color 0.15s ease,
              border-color 0.15s ease,
              color 0.15s ease,
              box-shadow 0.15s ease,
              transform 0.12s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* State 2: Hover */
button:hover:not(:disabled),
[role="button"]:hover:not(:disabled) {
  filter: brightness(1.02);
}

/* State 3: Active / Pressed (Tactile scale(0.98) micro-compression) */
button:active:not(:disabled),
[role="button"]:active:not(:disabled),
.interactive-control:active:not(:disabled) {
  transform: scale(0.98) !important;
}

/* State 4: Focus-Visible (High-contrast accessibility ring on buttons/links; inputs use emerald halo) */
button:focus-visible,
[role="button"]:focus-visible,
a:focus-visible {
  outline: 2px solid #10b981 !important;
  outline-offset: 2px !important;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none !important;
}

/* State 5: Disabled (Desaturated surface, muted text, cursor: not-allowed) */
button:disabled,
input:disabled,
select:disabled,
textarea:disabled,
.is-disabled {
  background-color: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
  transform: none !important;
  cursor: not-allowed !important;
  opacity: 0.72 !important;
}

body.colorway-midnight button:disabled,
body.colorway-midnight input:disabled,
body.colorway-midnight select:disabled,
body.colorway-midnight textarea:disabled {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #64748b !important;
}

/* Instant Inline Action Confirmation Micro-Feedback Badge */
.inline-action-confirmed {
  border-color: #059669 !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.22) !important;
}

/* 5A. SERVICE RECOVERY DIAGNOSTIC BANNER (Zero Dead Ends) */
.service-recovery-banner {
  background-color: var(--surface-card);
  border: 1px solid #fecdd3;
  border-left: 4px solid #e11d48;
  border-radius: 8px;
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-stripe);
}

body.colorway-midnight .service-recovery-banner {
  background-color: #111827 !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
  border-left: 4px solid #ef4444 !important;
}

/* 5B. ACTIVE DETERMINATE PROCESSING PROGRESS BAR (>300ms Operations) */
.determinate-processing-banner {
  background-color: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: var(--space-2) var(--space-4);
  box-shadow: var(--shadow-stripe);
}

.determinate-progress-track {
  width: 100%;
  height: 8px;
  background-color: var(--surface-subtle);
  border-radius: 9999px;
  overflow: hidden;
}

.determinate-progress-fill {
  height: 100%;
  background-color: #0f172a;
  border-radius: 9999px;
  transition: width 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

body.colorway-midnight .determinate-progress-fill {
  background-color: #38bdf8 !important;
}

/* 5C. 5-SECOND OPTIMISTIC UNDO BRIDGE SNACKBAR */
.optimistic-undo-snackbar {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-width: 320px;
  max-width: 448px;
  padding: var(--space-3) var(--space-4);
  background-color: #0f172a;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 8px;
  box-shadow: var(--shadow-float);
  animation: emotionalToastEnter 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.optimistic-undo-timer-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  background-color: #10b981;
  border-bottom-left-radius: 8px;
  transition: width 0.1s linear;
}

/* 6A. BEHAVIORAL RETENTION & INTRINSIC COMPETENCE LOOPS (Gestalt Closure Rings) */
.competence-loop-bar {
  background-color: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: var(--space-4);
  box-shadow: var(--shadow-stripe);
}

.gestalt-ring-svg {
  transform: rotate(-90deg);
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.gestalt-ring-track {
  fill: none;
  stroke: #e2e8f0;
  stroke-width: 4;
}

body.colorway-midnight .gestalt-ring-track {
  stroke: #1e293b;
}

.gestalt-ring-fill {
  fill: none;
  stroke: #059669;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.competence-milestone-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: 6px;
  background-color: var(--surface-subtle);
  border: 1px solid var(--border-card);
  font-size: var(--type-caption) !important;
  font-weight: var(--weight-semibold) !important;
  color: var(--text-main);
  font-variant-numeric: tabular-nums !important;
}

/* 6B. ENGINEERED PEAK-END COMPLETION SUMMARY DRAWER */
.peak-end-completion-drawer {
  position: fixed;
  bottom: var(--space-6);
  left: var(--space-6);
  z-index: 94;
  width: 384px;
  max-width: calc(100vw - 32px);
  background-color: var(--surface-card);
  border: 1px solid var(--border-card);
  border-top: 4px solid #059669;
  border-radius: 12px;
  padding: var(--space-4);
  box-shadow: var(--shadow-float);
  animation: emotionalToastEnter 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.colorway-midnight .peak-end-completion-drawer {
  background-color: #111827 !important;
  border-color: #1e293b !important;
  border-top: 4px solid #22c55e !important;
}

/* ==========================================================================
   7. COLD-COOLER OFFLINE CORE LAYOUT UTILITY FALLBACKS (BLINDSPOT 7)
   Ensures essential display/flex/grid/visibility utilities remain functional
   inside metal walk-in coolers (34°F) even if external CDNs are unreachable.
   ========================================================================== */
.hidden { display: none; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 16px; }
.space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 24px; }

/* ==========================================================================
   8. DATA-DRIVEN TABLE PRECISION & INVISIBLE UI TRANSITIONS
   ========================================================================== */
td.text-right,
th.text-right,
.col-margin,
.col-rev,
.col-balance,
.col-items,
.tabular-nums {
  font-variant-numeric: tabular-nums !important;
}

@keyframes sfTabSurfaceEnter {
  0% {
    opacity: 0;
    transform: translateY(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

[id^="erpTabContent_"]:not(.hidden),
[id^="secTabPanel_"]:not(.hidden),
[id^="invSubPanel_"]:not(.hidden),
[id^="finSubPanel_"]:not(.hidden) {
  animation: sfTabSurfaceEnter 160ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ==========================================================================
   9. ADDICTIVE MULTI-SENSORY SKU-ADDED FEEDBACK & LIVE BASKET STRIP
   ========================================================================== */
@keyframes skuAddButtonSpring {
  0% {
    transform: scale(0.95);
  }
  45% {
    transform: scale(1.035);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes skuDopamineFloatUp {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.94);
  }
  18% {
    opacity: 1;
    transform: translateY(-4px) scale(1.01);
  }
  78% {
    opacity: 1;
    transform: translateY(-18px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-28px) scale(0.97);
  }
}

@keyframes executivePortalFloatUp {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.94);
  }
  16% {
    opacity: 1;
    transform: translateY(-4px) scale(1.01);
  }
  78% {
    opacity: 1;
    transform: translateY(-18px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-28px) scale(0.97);
  }
}

@keyframes skuRowJustAddedFlash {
  0% {
    background-color: rgba(16, 185, 129, 0.22);
    transform: translateY(-2px);
  }
  35% {
    background-color: rgba(16, 185, 129, 0.14);
    transform: translateY(0);
  }
  100% {
    background-color: rgba(16, 185, 129, 0.04);
    transform: translateY(0);
  }
}

@keyframes dopamineCounterBump {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.16);
    color: #10b981;
  }
  100% {
    transform: scale(1);
  }
}

@keyframes inlineStripPulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.38);
    border-color: #10b981;
  }
  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    border-color: #10b981;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes miniChipSpringEnter {
  0% {
    opacity: 0;
    transform: translateY(4px) scale(0.94);
  }
  60% {
    opacity: 1;
    transform: translateY(-1px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#addBtnActionCol,
#addBtnMountContainer {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

button#addBtn {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 44px !important;
  height: 44px !important;
  width: 100% !important;
  background-color: #0f172a !important;
  border: 1px solid #1e293b !important;
  color: #ffffff !important;
  border-radius: 8px !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  pointer-events: auto !important;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 120ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}

button#addBtn:hover:not(:disabled) {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #ffffff !important;
}

body.colorway-midnight button#addBtn {
  background-color: #2563eb !important;
  border-color: #3b82f6 !important;
  color: #ffffff !important;
}

.sku-add-btn-confirmed,
button#addBtn.sku-add-btn-confirmed,
body.colorway-midnight button#addBtn.sku-add-btn-confirmed {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  background-color: #059669 !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25) !important;
}

.sku-dopamine-float-pill {
  position: absolute;
  right: 0;
  left: auto;
  bottom: calc(100% + 8px);
  z-index: 60;
  pointer-events: none;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 8px;
  background-color: #0f172a;
  color: #f8fafc;
  border: 1px solid #10b981;
  border-left: 3px solid #10b981;
  font-size: var(--type-caption) !important;
  font-weight: var(--weight-semibold) !important;
  font-variant-numeric: tabular-nums !important;
  box-shadow: var(--shadow-float);
  transform-origin: bottom right;
  animation: skuDopamineFloatUp 1550ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.executive-portal-float-pill {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  background-color: #0f172a;
  color: #f8fafc;
  border: 1px solid #334155;
  border-left: 3px solid #10b981;
  font-size: var(--type-caption) !important;
  font-weight: var(--weight-semibold) !important;
  font-variant-numeric: tabular-nums !important;
  box-shadow: var(--shadow-float);
  animation: executivePortalFloatUp 1650ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.executive-portal-float-pill[data-tone="amber"] {
  border-left-color: #f59e0b;
}

.executive-portal-float-pill[data-tone="sky"] {
  border-left-color: #0284c7;
}

.inline-basket-feedback-strip {
  transition: all 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.inline-basket-feedback-strip.just-added-pulse {
  animation: inlineStripPulseGlow 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

.basket-mini-chip-newest {
  animation: miniChipSpringEnter 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sku-row-just-added,
.settled-row-flash {
  animation: skuRowJustAddedFlash 2400ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  box-shadow: inset 4px 0 0 0 #10b981;
}

.dopamine-num-bump {
  display: inline-block;
  animation: dopamineCounterBump 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Order Momentum & Payment Balance Liquidation Progress Tracks */
.order-momentum-track,
.payment-liquidation-track {
  width: 100%;
  height: 8px;
  background-color: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  display: flex;
}

body.colorway-midnight .order-momentum-track,
body.colorway-midnight .payment-liquidation-track {
  background-color: #1e293b;
}

.order-momentum-fill {
  height: 100%;
  background-color: #059669;
  border-radius: 9999px;
  transition: width 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.payment-liquidation-prior {
  height: 100%;
  background-color: #64748b;
  transition: width 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.payment-liquidation-applying {
  height: 100%;
  background-color: #10b981;
  transition: width 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   PROGRESSIVE DISCLOSURE & SECONDARY SUB-MENU ARCHITECTURE (v3.8.0)
   Mobbin / Kole Jain / Sam Crawford Anti-Vibe-Code Overhaul:
   1. Zero default browser disclosure triangles on custom dropdown summaries
   2. Crisp elevation and auto-dismiss support for secondary tool menus
   ========================================================================== */
details.erp-secondary-dropdown > summary {
  list-style: none;
}

details.erp-secondary-dropdown > summary::-webkit-details-marker,
details.erp-secondary-dropdown > summary::marker {
  display: none;
}

details.erp-secondary-dropdown[open] > summary {
  border-color: #94a3b8;
}

/* ==========================================================================
   EMOTIONAL DESIGN AI & WHATSAPP COMMAND STUDIO (v3.8.5)
   Inspired by & surpassing the Login Gateway (#authLockModal):
   - Cursor-tracking GPU radial spotlight & cryptographic/guardrail trust bar
   - 3-stage live workflow progress bar (Input -> Pre-Flight -> Commit)
   - Real-time keystroke semantic readiness meter & spring entity preview card
   - Tactile message bubble & staged card entrance choreography
   ========================================================================== */
#aiHubTrustHeaderCard {
  --ai-spot-x: 28%;
  --ai-spot-y: 50%;
  background: linear-gradient(155deg, #ffffff 0%, #f8fafc 100%) !important;
  border-color: rgba(226, 232, 240, 0.95) !important;
  color: #0f172a !important;
  box-shadow:
    0 10px 28px -12px rgba(15, 23, 42, 0.07),
    0 2px 6px -2px rgba(15, 23, 42, 0.04) !important;
  position: relative;
  overflow: visible;
}

body.colorway-midnight #aiHubTrustHeaderCard {
  background: linear-gradient(155deg, #0b1326 0%, #070c18 64%, #050914 100%) !important;
  border-color: rgba(30, 41, 59, 0.9) !important;
  color: #f8fafc !important;
  box-shadow:
    0 20px 42px -16px rgba(2, 6, 23, 0.42),
    0 8px 18px -8px rgba(15, 23, 42, 0.28),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.08) !important;
}

.ai-hub-ambient-spotlight {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(
    460px circle at var(--ai-spot-x, 28%) var(--ai-spot-y, 50%),
    rgba(16, 185, 129, 0.09) 0%,
    rgba(56, 189, 248, 0.07) 42%,
    transparent 76%
  );
  transition: opacity 0.25s ease;
}

body.colorway-midnight .ai-hub-ambient-spotlight {
  background: radial-gradient(
    460px circle at var(--ai-spot-x, 28%) var(--ai-spot-y, 50%),
    rgba(56, 189, 248, 0.14) 0%,
    rgba(16, 185, 129, 0.07) 42%,
    transparent 76%
  );
}

.ai-telemetry-pill {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.18s ease,
              background-color 0.18s ease,
              box-shadow 0.2s ease;
}

.ai-telemetry-pill:hover {
  transform: translateY(-2px);
  border-color: #10b981 !important;
  background: #ffffff !important;
  box-shadow: 0 10px 22px -8px rgba(16, 185, 129, 0.16);
}

body.colorway-midnight .ai-telemetry-pill {
  background: rgba(15, 23, 42, 0.78) !important;
  border: 1px solid rgba(51, 65, 85, 0.72) !important;
}

body.colorway-midnight .ai-telemetry-pill:hover {
  border-color: rgba(52, 211, 153, 0.48) !important;
  background: rgba(15, 23, 42, 0.96) !important;
  box-shadow: 0 10px 22px -8px rgba(16, 185, 129, 0.22);
}

.ai-telemetry-pill:active {
  transform: translateY(0) scale(0.985);
}

/* Tactile Composer Focus Halo & Readiness Chips */
.ai-composer-shell {
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.18s ease,
              box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.ai-composer-shell:focus-within {
  transform: translateY(-1px);
  border-color: #0f172a !important;
  box-shadow:
    0 0 0 3.5px rgba(15, 23, 42, 0.07),
    0 12px 26px -8px rgba(15, 23, 42, 0.12);
}

.ai-composer-shell.is-verified-ready:focus-within {
  border-color: rgba(16, 185, 129, 0.7) !important;
  box-shadow:
    0 0 0 3.5px rgba(16, 185, 129, 0.14),
    0 12px 26px -8px rgba(16, 185, 129, 0.14);
}

.ai-rule-chip {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              background-color 0.18s ease,
              color 0.18s ease,
              border-color 0.18s ease;
}

.ai-rule-chip.is-lit {
  background-color: #ecfdf5 !important;
  color: #065f46 !important;
  border-color: #6ee7b7 !important;
  transform: translateY(-1px);
}

.ai-rule-chip.is-warn {
  background-color: #fffbeb !important;
  color: #92400e !important;
  border-color: #fcd34d !important;
  transform: translateY(-1px);
}

/* Spring Entrance for Chat Bubbles, Entity Preview Card & Staged Guardrail Cards */
@keyframes aiBubbleSpringIn {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ai-chat-bubble-enter,
.ai-staged-card-enter,
#aiComposerEntityPreviewCard:not(.hidden) {
  animation: aiBubbleSpringIn 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform, opacity;
}

.ai-followup-chip,
.ai-quick-action-pill {
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.16s ease,
              background-color 0.16s ease,
              color 0.16s ease,
              box-shadow 0.16s ease;
}

.ai-followup-chip:hover,
.ai-quick-action-pill:hover {
  transform: translateY(-1.5px);
  border-color: #0f172a !important;
  background-color: #0f172a !important;
  color: #ffffff !important;
  box-shadow: 0 8px 16px -4px rgba(15, 23, 42, 0.16);
}

.ai-followup-chip:hover svg {
  transform: translateX(2px);
  color: #34d399 !important;
}

body.colorway-midnight .ai-followup-chip:hover,
body.colorway-midnight .ai-quick-action-pill:hover {
  border-color: #34d399 !important;
  background-color: #0f172a !important;
  color: #f8fafc !important;
  box-shadow: 0 8px 18px -4px rgba(16, 185, 129, 0.22);
}

.ai-followup-chip:active,
.ai-quick-action-pill:active {
  transform: translateY(0) scale(0.975);
}

.ai-assistant-card {
  background: linear-gradient(180deg, #ffffff 0%, #fcfdfe 100%);
  border: 1px solid rgba(226, 232, 240, 0.92) !important;
  box-shadow:
    0 14px 34px -14px rgba(15, 23, 42, 0.065),
    0 2px 6px -1px rgba(15, 23, 42, 0.03),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

body.colorway-midnight .ai-assistant-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(11, 18, 34, 0.95) 100%);
  border-color: rgba(51, 65, 85, 0.85) !important;
  box-shadow:
    0 18px 38px -14px rgba(2, 6, 23, 0.5),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.06);
}

.ai-telemetry-section-card {
  background: transparent;
  border: 0;
  border-radius: 0.875rem;
  overflow: visible;
}

body.colorway-midnight .ai-telemetry-section-card {
  background: transparent;
  border-color: transparent;
}

.cortex-bento-tile {
  background: linear-gradient(165deg, #f8fafc 0%, #ffffff 100%);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 0.875rem;
  padding: 0.75rem 0.875rem;
  box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.02);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.cortex-bento-tile:hover {
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 8px 20px -10px rgba(15, 23, 42, 0.07);
}

body.colorway-midnight .cortex-bento-tile {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(51, 65, 85, 0.78);
}

.ai-telemetry-row {
  padding: 0.625rem 0.75rem;
  border-radius: 0.625rem;
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.75);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ai-telemetry-row:hover {
  background-color: #ffffff;
  border-color: #cbd5e1;
}

body.colorway-midnight .ai-telemetry-row {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(51, 65, 85, 0.65);
}

body.colorway-midnight .ai-telemetry-row:hover {
  background-color: rgba(30, 41, 59, 0.75);
}

.ai-sandbox-grid-bg {
  background-color: rgba(248, 250, 252, 0.65);
  background-image: radial-gradient(rgba(148, 163, 184, 0.28) 1px, transparent 1px);
  background-size: 16px 16px;
}

body.colorway-midnight .ai-sandbox-grid-bg {
  background-color: rgba(15, 23, 42, 0.45);
  background-image: radial-gradient(rgba(71, 85, 105, 0.35) 1px, transparent 1px);
}

.ai-launchpad-card {
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.18s ease,
              background-color 0.18s ease,
              box-shadow 0.2s ease;
}

.ai-launchpad-card:hover {
  transform: translateY(-2px);
  border-color: #0f172a !important;
  background-color: #ffffff !important;
  box-shadow: 0 12px 24px -8px rgba(15, 23, 42, 0.1);
}

.ai-launchpad-card:active {
  transform: translateY(0) scale(0.99);
}

body.colorway-midnight .ai-composer-shell:focus-within {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3.5px rgba(56, 189, 248, 0.16);
}

body.colorway-midnight .ai-launchpad-card:hover {
  border-color: #38bdf8 !important;
  background-color: #0f172a !important;
}

/* Out-of-the-Box Layout Innovations (Generative Split-Stage, Anywhere Copilot, Shift Rhythm, Spatial Twin) */
body.colorway-midnight #anywhereCopilotExpandedCard,
body.colorway-midnight #homeShiftRhythmBar,
body.colorway-midnight #aiGenerativeSplitStageCard,
body.colorway-midnight #invSubPanel_spatial > div,
body.colorway-midnight #routingSpatialTwinPanel > div {
  background-color: rgba(15, 23, 42, 0.92) !important;
  border-color: rgba(51, 65, 85, 0.85) !important;
  color: #f8fafc !important;
}

body.colorway-midnight #anywhereCopilotReplyBox,
body.colorway-midnight #aiGenerativeSplitStageCard .bg-white,
body.colorway-midnight #spatialCoolerFloorplanGrid > div,
body.colorway-midnight #routingSpatialTwinPanel .bg-white {
  background-color: rgba(30, 41, 59, 0.85) !important;
  border-color: rgba(71, 85, 105, 0.75) !important;
  color: #f1f5f9 !important;
}

/* ==========================================================================
   ARCHITECTURAL COMMAND RAIL & POPOVER PRECISION (v4.1 — ZERO CLIPPING & PROPORTIONAL TYPOGRAPHY)
   Overrides global 22px h1 & 12px micro-text inflation inside the 240px sidebar
   ========================================================================== */
#erpAppSidebar h1#uiAppTitle,
#uiAppTitle {
  font-size: 0.84375rem !important; /* 13.5px crisp architectural title */
  line-height: 1.25 !important;
  font-weight: 700 !important;
  letter-spacing: -0.015em !important;
  white-space: nowrap !important;
}

#erpAppSidebar [class*="text-[9px]"],
#headerUserDropdown [class*="text-[9px]"] {
  font-size: 0.625rem !important; /* 10px */
  line-height: 1.25 !important;
}

#erpAppSidebar [class*="text-[10px]"],
#headerUserDropdown [class*="text-[10px]"] {
  font-size: 0.65625rem !important; /* 10.5px */
  line-height: 1.3 !important;
}

#erpAppSidebar [class*="text-[11px]"],
#headerUserDropdown [class*="text-[11px]"] {
  font-size: 0.71875rem !important; /* 11.5px */
  line-height: 1.35 !important;
}

#erpAppSidebar .erp-nav-item.is-active {
  background-color: rgba(30, 41, 59, 0.92) !important;
  border-color: rgba(51, 65, 85, 0.85) !important;
  color: #ffffff !important;
  box-shadow: inset 3px 0 0 0 #10b981 !important;
}

#headerUserDropdown #sidebarQuickAccountSwitchList button {
  background-color: rgba(30, 41, 59, 0.85) !important;
  color: #e2e8f0 !important;
  border-color: rgba(51, 65, 85, 0.85) !important;
}

#headerUserDropdown #sidebarQuickAccountSwitchList button:hover {
  background-color: rgba(51, 65, 85, 0.92) !important;
  color: #ffffff !important;
  border-color: rgba(100, 116, 139, 0.85) !important;
}

#erpAppSidebar .erp-nav-item:hover,
#erpAppSidebar .sidebar-dropdown-item:hover,
#erpAppSidebar .erp-sidebar-dropdown-trigger:hover,
#headerUserDropdown button:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* ==========================================================================
   FRONTIER v6.1 CARBON ARCHITECTURAL DESIGN SYSTEM & DOPAMINE ENGINE
   Zero-Specificity-Conflict Cascade, True Executive Typographic Scale,
   Jewel-Rim Primary & Secondary KPIs, Obsidian Command Rail, Full-Page
   Studio Workspaces, Modal & Submenu Spring Physics, Login Aurora Portal,
   Specular Press Ripples, & Dual-Shockwave Dopamine Choreography
   ========================================================================== */
:root {
  --frontier-ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --frontier-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --frontier-ease-snappy: cubic-bezier(0.22, 1, 0.36, 1);
  --frontier-specular-light: inset 0 1px 0 0 rgba(255, 255, 255, 0.96);
  --frontier-specular-dark: inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
  --frontier-shadow-card:
    0 1px 2px 0 rgba(15, 23, 42, 0.045),
    0 12px 30px -10px rgba(15, 23, 42, 0.095),
    inset 0 1px 0 0 rgba(255, 255, 255, 1);
  --frontier-shadow-card-hover:
    0 10px 22px -4px rgba(15, 23, 42, 0.095),
    0 24px 48px -14px rgba(15, 23, 42, 0.155),
    inset 0 1px 0 0 rgba(255, 255, 255, 1);
  --frontier-shadow-popover:
    0 24px 54px -12px rgba(15, 23, 42, 0.26),
    0 10px 22px -6px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(15, 23, 42, 0.07),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.96);
  --frontier-shadow-modal:
    0 38px 88px -16px rgba(2, 6, 23, 0.48),
    0 16px 34px -8px rgba(15, 23, 42, 0.22),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.96);
}

@media screen {
  /* 1. Architectural Platinum Dot-Matrix Viewport Canvas & Studio Lighting */
  body:not(:where(.colorway-midnight, .colorway-crimson, .colorway-emerald, .colorway-smokehouse, .colorway-industrial)) {
    background-color: #ecf1f7 !important;
  }

  body:not(:where(.colorway-midnight)) {
    background-image:
      radial-gradient(1080px 460px at 16% 0%, rgba(16, 185, 129, 0.11) 0%, rgba(14, 165, 233, 0.072) 44%, transparent 74%),
      radial-gradient(900px 400px at 90% 4%, rgba(99, 102, 241, 0.09) 0%, transparent 72%),
      radial-gradient(rgba(15, 23, 42, 0.068) 1px, transparent 1px) !important;
    background-size: 100% 100%, 100% 100%, 22px 22px !important;
    background-attachment: fixed, fixed, scroll !important;
  }

  body.colorway-midnight {
    background-color: #050914 !important;
    background-image:
      radial-gradient(1100px 480px at 20% 0%, rgba(16, 185, 129, 0.135) 0%, rgba(14, 165, 233, 0.078) 45%, transparent 76%),
      radial-gradient(900px 400px at 88% 6%, rgba(99, 102, 241, 0.115) 0%, transparent 74%),
      radial-gradient(rgba(148, 163, 184, 0.078) 1px, transparent 1px) !important;
    background-size: 100% 100%, 100% 100%, 22px 22px !important;
    background-attachment: fixed, fixed, scroll !important;
  }

  body:not(:where(.colorway-midnight)) #mainAppContent,
  body.colorway-midnight #mainAppContent {
    background: transparent !important;
  }

  /* 1.5 True Executive Optical Typography & Monospace Instrumentation Unlock */
  .font-mono,
  .font-mono *,
  code,
  kbd,
  .tabular-nums {
    font-family: var(--font-mono) !important;
    font-variant-numeric: tabular-nums !important;
  }

  #homeWelcomeTitle,
  #homeWelcomeTitle *,
  #aiHubMainTitle,
  #aiHubMainTitle *,
  #erpTabContent_orders > div:first-child h1,
  #erpTabContent_orders > div:first-child h1 *,
  #erpTabContent_customers > div:first-child h1,
  #erpTabContent_customers > div:first-child h1 *,
  #erpTabContent_financials > div:first-child h1,
  #erpTabContent_financials > div:first-child h1 *,
  #erpTabContent_inventory > div:first-child h1,
  #erpTabContent_inventory > div:first-child h1 *,
  #erpTabContent_routing h1,
  #erpTabContent_routing h1 *,
  .erp-fullpage-workspace h2,
  .erp-fullpage-workspace h2 *,
  #authBrandTrustPanel h2,
  #authGatewayTitle {
    font-family: var(--font-display) !important;
    letter-spacing: -0.03em !important;
  }

  #homeWelcomeTitle,
  #aiHubMainTitle {
    font-size: 1.55rem !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
  }

  #erpTabContent_orders > div:first-child h1,
  #erpTabContent_customers > div:first-child h1,
  #erpTabContent_financials > div:first-child h1,
  #erpTabContent_inventory > div:first-child h1,
  #erpTabContent_routing h1 {
    font-size: 1.45rem !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
  }

  /* Unlock Primary & Secondary Hero KPI Display Metrics from legacy 22px flattener */
  #homeKpiOrdersValue,
  #homeKpiInventoryValue,
  #homeKpiRoutingValue,
  #homeKpiFinancialsValue,
  #totRevenue,
  #totCost,
  #totProfit,
  #totMargin,
  #finCardArTotal,
  #finCardPaidTotal,
  #finCardBilledTotal,
  #finCardRepOpenCount,
  #kpiInvCases,
  #kpiInvWeight,
  #kpiInvSkus,
  #kpiInvValuation,
  #kpiInvAlerts,
  #erpTabContent_routing .routing-kpi-value {
    font-family: var(--font-display) !important;
    font-size: 1.75rem !important;
    line-height: 1.12 !important;
    font-weight: 800 !important;
    letter-spacing: -0.035em !important;
    font-variant-numeric: tabular-nums !important;
  }

  #kpiInvCases > span,
  #kpiInvWeight > span,
  #kpiInvSkus > span,
  #kpiInvAlerts > span {
    font-family: var(--font-sans) !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
  }

  #clientKpiOrders,
  #clientKpiBilled,
  #clientKpiPaid,
  #clientKpiOpen,
  #homeChartActivePrimaryValue,
  #execKpiProductInLbs,
  #execKpiProductOutLbs,
  #execKpiMoneyIn,
  #execKpiMoneyOut,
  #execKpiGrossProfit,
  #execKpiBlendedMargin,
  #stkHistTotalCount,
  #stkHistCycleCount,
  #stkHistInboundCount,
  #stkHistShrinkCount {
    font-family: var(--font-display) !important;
    font-size: 1.55rem !important;
    line-height: 1.15 !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em !important;
    font-variant-numeric: tabular-nums !important;
  }

  /* Custom Precision Scrollbars Across Workspace & Modals */
  * {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.48) transparent;
  }
  *::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  *::-webkit-scrollbar-track {
    background: transparent;
  }
  *::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.45);
    border-radius: 9999px;
  }
  *::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.72);
  }
  #erpAppSidebar *::-webkit-scrollbar-thumb,
  body.colorway-midnight *::-webkit-scrollbar-thumb {
    background: rgba(71, 85, 105, 0.58);
  }

  /* 2. Floating Porcelain Bento Cards — Zero-ID :where() Guard So Interactive Rules Win */
  body:not(:where(.colorway-midnight)) .bg-white.rounded-xl:not(:where(#authLockCard)),
  body:not(:where(.colorway-midnight)) .bg-white.rounded-2xl:not(:where(#authLockCard)),
  body:not(:where(.colorway-midnight)) :where(#basketCard),
  body:not(:where(.colorway-midnight)) .erp-surface-card,
  body:not(:where(.colorway-midnight)) .home-bento-card {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
    border: 1px solid rgba(203, 213, 225, 0.88) !important;
    border-radius: 1rem !important;
    box-shadow: var(--frontier-shadow-card) !important;
  }

  body.colorway-midnight .bg-white.rounded-xl:not(:where(#authLockCard)),
  body.colorway-midnight .bg-white.rounded-2xl:not(:where(#authLockCard)),
  body.colorway-midnight :where(#basketCard),
  body.colorway-midnight .erp-surface-card,
  body.colorway-midnight .home-bento-card {
    background: linear-gradient(180deg, #0f172a 0%, #0b1222 100%) !important;
    border: 1px solid rgba(51, 65, 85, 0.88) !important;
    border-radius: 1rem !important;
    box-shadow:
      0 14px 34px -12px rgba(2, 6, 23, 0.65),
      var(--frontier-specular-dark) !important;
  }

  /* 2.2 Signature Home Cortex Command Deck (#homeAiFirstHeroCommandBar) & Module Fast-Lanes */
  body:not(:where(.colorway-midnight)) #homeAiFirstHeroCommandBar {
    position: relative;
    overflow: hidden;
    border-radius: 1.125rem !important;
    background:
      radial-gradient(640px 200px at 8% 0%, rgba(16, 185, 129, 0.1) 0%, transparent 72%),
      radial-gradient(560px 200px at 94% 0%, rgba(99, 102, 241, 0.095) 0%, transparent 72%),
      linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
    border: 1px solid rgba(148, 163, 184, 0.54) !important;
    box-shadow:
      0 2px 4px rgba(15, 23, 42, 0.04),
      0 18px 42px -14px rgba(15, 23, 42, 0.13),
      inset 0 1px 0 #ffffff !important;
  }

  #homeAiFirstHeroCommandBar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3.5px;
    background: linear-gradient(90deg, #10b981 0%, #0ea5e9 52%, #6366f1 100%);
    pointer-events: none;
    z-index: 2;
  }

  #aiHubTrustHeaderCard {
    position: relative;
    overflow: visible !important;
    border-radius: 1.125rem !important;
  }

  #homeAiFirstHeroCommandBar span.w-7.h-7.bg-slate-900,
  #aiHubTrustHeaderCard div.w-10.h-10.bg-slate-900,
  #erpTabContent_routing .routing-command-icon-well,
  #enterpriseIndustrialModalTopHeader > div > div:first-child {
    background: linear-gradient(145deg, #0f172a 0%, #064e3b 100%) !important;
    border: 1px solid rgba(52, 211, 153, 0.48) !important;
    box-shadow:
      0 6px 16px -4px rgba(16, 185, 129, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.24) !important;
    color: #6ee7b7 !important;
  }

  #erpTabContent_routing .routing-command-icon-well svg {
    color: #6ee7b7 !important;
  }

  body:not(:where(.colorway-midnight)) #mainAppContent #homeAiFirstHeroInput,
  body:not(:where(.colorway-midnight)) #mainAppContent input[id^="aiFastLaneInput_"] {
    background: #f3f7fc !important;
    border: 1px solid rgba(148, 163, 184, 0.58) !important;
    border-radius: 0.75rem !important;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05) !important;
    transition: all 0.2s var(--frontier-ease-spring) !important;
  }

  body:not(:where(.colorway-midnight)) #mainAppContent #homeAiFirstHeroInput:focus,
  body:not(:where(.colorway-midnight)) #mainAppContent input[id^="aiFastLaneInput_"]:focus {
    background: #ffffff !important;
    border-color: #10b981 !important;
    box-shadow:
      0 0 0 4px rgba(16, 185, 129, 0.16),
      0 6px 16px -4px rgba(16, 185, 129, 0.2) !important;
  }

  #mainAppContent div[id^="aiFastLaneBar_"] {
    position: relative;
    overflow: hidden;
    border-left: 3.5px solid #10b981 !important;
  }

  /* Secondary Module & Full-Page Workspace Mastheads: Clipped 3.5px Jewel Bar With Unclipped Popover Overflow */
  body:not(:where(.colorway-midnight)) #erpTabContent_orders > div:first-child,
  body:not(:where(.colorway-midnight)) #erpTabContent_customers > div:first-child,
  body:not(:where(.colorway-midnight)) #erpTabContent_financials > div:first-child,
  body:not(:where(.colorway-midnight)) #erpTabContent_inventory > div:first-child,
  body:not(:where(.colorway-midnight)) #erpTabContent_routing .routing-command-masthead,
  body:not(:where(.colorway-midnight)) #erpTabContent_routing .routing-spatial-twin-shell,
  body:not(:where(.colorway-midnight)) #aiHubTrustHeaderCard,
  body:not(:where(.colorway-midnight)) .erp-fullpage-workspace > div > div.bg-white:first-child {
    position: relative;
    overflow: visible !important;
    background-image:
      linear-gradient(90deg, #10b981 0%, #0ea5e9 52%, #6366f1 100%),
      radial-gradient(620px 180px at 8% 0%, rgba(16, 185, 129, 0.088) 0%, transparent 72%),
      radial-gradient(520px 180px at 94% 0%, rgba(99, 102, 241, 0.075) 0%, transparent 72%),
      linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
    background-size: 100% 3.5px, 100% 100%, 100% 100%, 100% 100% !important;
    background-position: 0 0, 0 0, 0 0, 0 0 !important;
    background-repeat: no-repeat !important;
    border: 1px solid rgba(148, 163, 184, 0.56) !important;
    box-shadow:
      0 2px 4px rgba(15, 23, 42, 0.045),
      0 16px 36px -12px rgba(15, 23, 42, 0.115),
      inset 0 1px 0 #ffffff !important;
  }

  body.colorway-midnight #erpTabContent_orders > div:first-child,
  body.colorway-midnight #erpTabContent_customers > div:first-child,
  body.colorway-midnight #erpTabContent_financials > div:first-child,
  body.colorway-midnight #erpTabContent_inventory > div:first-child,
  body.colorway-midnight #erpTabContent_routing .routing-command-masthead,
  body.colorway-midnight #erpTabContent_routing .routing-spatial-twin-shell,
  body.colorway-midnight #aiHubTrustHeaderCard,
  body.colorway-midnight .erp-fullpage-workspace > div > div.bg-white:first-child {
    position: relative;
    overflow: visible !important;
    background-image:
      linear-gradient(90deg, #10b981 0%, #0ea5e9 52%, #6366f1 100%),
      radial-gradient(620px 180px at 8% 0%, rgba(16, 185, 129, 0.14) 0%, transparent 72%),
      linear-gradient(180deg, #0f172a 0%, #0b1222 100%) !important;
    background-size: 100% 3.5px, 100% 100%, 100% 100% !important;
    background-position: 0 0, 0 0, 0 0 !important;
    background-repeat: no-repeat !important;
  }

  /* Major Workspace Bento & Form Section Cards: Subtle 3px Semantic Top Hairlines (Zero Dropdown Clipping) */
  body:not(:where(.colorway-midnight)) #homeInteractiveHistoryCard {
    background-image:
      linear-gradient(90deg, #4f46e5 0%, #0ea5e9 52%, #10b981 100%),
      linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
    background-size: 100% 3px, 100% 100% !important;
    background-position: 0 0, 0 0 !important;
    background-repeat: no-repeat !important;
  }

  body:not(:where(.colorway-midnight)) #homeInteractiveCoolerCard {
    background-image:
      linear-gradient(90deg, #10b981 0%, #06b6d4 60%, #6366f1 100%),
      linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
    background-size: 100% 3px, 100% 100% !important;
    background-position: 0 0, 0 0 !important;
    background-repeat: no-repeat !important;
  }

  body:not(:where(.colorway-midnight)) #erpTabContent_orders > div.bg-white:not(:first-child):not([id^="aiFastLaneBar_"]),
  body:not(:where(.colorway-midnight)) #basketCard,
  body:not(:where(.colorway-midnight)) #erpTabContent_customers .grid > div.bg-white,
  body:not(:where(.colorway-midnight)) #finSubPanel_ar,
  body:not(:where(.colorway-midnight)) #finSubPanel_reps,
  body:not(:where(.colorway-midnight)) #erpTabContent_inventory > div.bg-white:last-child,
  body:not(:where(.colorway-midnight)) #aiHubPane_chat > div.bg-white,
  body:not(:where(.colorway-midnight)) #qboConnectedAccountBanner,
  body:not(:where(.colorway-midnight)) #qboConnectedAccountBanner + div.bg-white,
  body:not(:where(.colorway-midnight)) #entIndTabPanel_cutroom > div.bg-white,
  body:not(:where(.colorway-midnight)) #entIndTabPanel_zebra > .grid > div.bg-white {
    background-image:
      linear-gradient(90deg, rgba(15, 23, 42, 0.85) 0%, #10b981 52%, #0ea5e9 100%),
      linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
    background-size: 100% 2.5px, 100% 100% !important;
    background-position: 0 0, 0 0 !important;
    background-repeat: no-repeat !important;
  }

  /* 2.5 Four Semantic Jewel-Accented Home KPI Cards + Secondary Module KPI Strips */
  #mainAppContent .home-kpi-card {
    position: relative !important;
    overflow: hidden !important;
    border-radius: 1.05rem !important;
    background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%) !important;
    border: 1px solid rgba(203, 213, 225, 0.88) !important;
    box-shadow: var(--frontier-shadow-card) !important;
    transition:
      transform 0.26s var(--frontier-ease-spring),
      box-shadow 0.26s var(--frontier-ease-spring),
      border-color 0.22s ease !important;
  }

  body.colorway-midnight #mainAppContent .home-kpi-card {
    background: linear-gradient(180deg, #0f172a 0%, #0a1020 100%) !important;
    border: 1px solid rgba(51, 65, 85, 0.9) !important;
    box-shadow:
      0 14px 32px -12px rgba(2, 6, 23, 0.68),
      var(--frontier-specular-dark) !important;
  }

  /* Top Semantic Jewel Light Bars on Primary & Secondary KPI Cards */
  #mainAppContent .home-kpi-card::before,
  #erpTabContent_financials .erp-interactive-card::before,
  #erpTabContent_inventory .erp-interactive-card::before,
  #erpTabContent_routing .routing-twin-truck-card::before,
  #erpTabContent_routing .routing-kpi-card::before,
  #execReportScrollArea > .grid:first-child > div::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3.5px;
    z-index: 2;
    pointer-events: none;
    transition: height 0.2s var(--frontier-ease-spring), filter 0.2s ease;
  }

  #erpTabContent_financials .erp-interactive-card,
  #erpTabContent_inventory .erp-interactive-card,
  #erpTabContent_routing .routing-twin-truck-card,
  #erpTabContent_routing .routing-kpi-card,
  #execReportScrollArea > .grid:first-child > div {
    position: relative !important;
    overflow: hidden !important;
  }

  #execReportScrollArea > .grid:first-child > div {
    transition:
      transform 0.24s var(--frontier-ease-spring),
      box-shadow 0.24s var(--frontier-ease-spring),
      border-color 0.2s ease !important;
  }

  #execReportScrollArea > .grid:first-child > div:hover {
    transform: translateY(-3px) !important;
    border-color: rgba(16, 185, 129, 0.52) !important;
    box-shadow: var(--frontier-shadow-card-hover) !important;
  }

  #homeKpiCardOrders::before {
    background: linear-gradient(90deg, #4f46e5 0%, #0ea5e9 100%);
  }
  #homeKpiCardInventory::before {
    background: linear-gradient(90deg, #f59e0b 0%, #10b981 100%);
  }
  #homeKpiCardRouting::before {
    background: linear-gradient(90deg, #06b6d4 0%, #10b981 100%);
  }
  #homeKpiCardFinancials::before {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  }

  /* Receivables Secondary KPI Cards Top Jewel Rims (Open AR / Collected / Total Billed / Active Reps) */
  #erpTabContent_financials .erp-interactive-card:nth-child(1)::before {
    background: linear-gradient(90deg, #f59e0b 0%, #ef4444 100%);
  }
  #erpTabContent_financials .erp-interactive-card:nth-child(2)::before {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  }
  #erpTabContent_financials .erp-interactive-card:nth-child(3)::before {
    background: linear-gradient(90deg, #4f46e5 0%, #0ea5e9 100%);
  }
  #erpTabContent_financials .erp-interactive-card:nth-child(4)::before {
    background: linear-gradient(90deg, #06b6d4 0%, #6366f1 100%);
  }

  /* Cooler Stock Secondary KPI Cards Top Jewel Rims (Boxes / Weight / Valuation / Alerts) */
  #erpTabContent_inventory .erp-interactive-card:nth-child(1)::before {
    background: linear-gradient(90deg, #4f46e5 0%, #0ea5e9 100%);
  }
  #erpTabContent_inventory .erp-interactive-card:nth-child(2)::before {
    background: linear-gradient(90deg, #06b6d4 0%, #38bdf8 100%);
  }
  #erpTabContent_inventory .erp-interactive-card:nth-child(3)::before {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  }
  #erpTabContent_inventory .erp-interactive-card:nth-child(4)::before {
    background: linear-gradient(90deg, #f59e0b 0%, #f97316 100%);
  }

  /* Fleet & Routing Refrigerated Twin Truck Cards & Route Telemetry KPI Rims */
  #erpTabContent_routing .routing-twin-truck-card:nth-child(1)::before,
  #erpTabContent_routing .routing-kpi-card:nth-child(1)::before {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  }
  #erpTabContent_routing .routing-twin-truck-card:nth-child(2)::before,
  #erpTabContent_routing .routing-kpi-card:nth-child(2)::before {
    background: linear-gradient(90deg, #4f46e5 0%, #0ea5e9 100%);
  }
  #erpTabContent_routing .routing-twin-truck-card:nth-child(3)::before,
  #erpTabContent_routing .routing-kpi-card:nth-child(3)::before {
    background: linear-gradient(90deg, #06b6d4 0%, #38bdf8 100%);
  }
  #erpTabContent_routing .routing-twin-truck-card:nth-child(4)::before,
  #erpTabContent_routing .routing-kpi-card:nth-child(4)::before {
    background: linear-gradient(90deg, #f59e0b 0%, #10b981 100%);
  }

  /* Executive Analytics 6 Hero KPI Cards Top Jewel Rims */
  #execReportScrollArea > .grid:first-child > div:nth-child(1)::before {
    background: linear-gradient(90deg, #4f46e5 0%, #0ea5e9 100%);
  }
  #execReportScrollArea > .grid:first-child > div:nth-child(2)::before {
    background: linear-gradient(90deg, #06b6d4 0%, #10b981 100%);
  }
  #execReportScrollArea > .grid:first-child > div:nth-child(3)::before {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  }
  #execReportScrollArea > .grid:first-child > div:nth-child(4)::before {
    background: linear-gradient(90deg, #f59e0b 0%, #f97316 100%);
  }
  #execReportScrollArea > .grid:first-child > div:nth-child(5)::before {
    background: linear-gradient(90deg, #059669 0%, #34d399 100%);
  }
  #execReportScrollArea > .grid:first-child > div:nth-child(6)::before {
    background: linear-gradient(90deg, #6366f1 0%, #06b6d4 100%);
  }

  /* Bespoke Semantic Jewel Icon Wells (Preserved on Hover — Never Turned Black) */
  body:not(:where(.colorway-midnight)) #homeKpiCardOrders .home-kpi-icon-well {
    background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%) !important;
    border-color: rgba(129, 140, 248, 0.5) !important;
    color: #4338ca !important;
    box-shadow: 0 4px 12px -4px rgba(79, 70, 229, 0.28) !important;
  }
  body:not(:where(.colorway-midnight)) #homeKpiCardInventory .home-kpi-icon-well {
    background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%) !important;
    border-color: rgba(251, 191, 36, 0.55) !important;
    color: #b45309 !important;
    box-shadow: 0 4px 12px -4px rgba(245, 158, 11, 0.28) !important;
  }
  body:not(:where(.colorway-midnight)) #homeKpiCardRouting .home-kpi-icon-well {
    background: linear-gradient(180deg, #ecfeff 0%, #cffafe 100%) !important;
    border-color: rgba(34, 211, 238, 0.55) !important;
    color: #0e7490 !important;
    box-shadow: 0 4px 12px -4px rgba(6, 182, 212, 0.28) !important;
  }
  body:not(:where(.colorway-midnight)) #homeKpiCardFinancials .home-kpi-icon-well {
    background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%) !important;
    border-color: rgba(52, 211, 153, 0.55) !important;
    color: #047857 !important;
    box-shadow: 0 4px 12px -4px rgba(16, 185, 129, 0.28) !important;
  }

  /* Shimmering Multi-Stop KPI Meter Bars */
  #homeKpiOrdersBar {
    background: linear-gradient(90deg, #4f46e5 0%, #0ea5e9 100%) !important;
  }
  #homeKpiInventoryBar {
    background: linear-gradient(90deg, #f59e0b 0%, #10b981 100%) !important;
  }
  #homeKpiRoutingBar {
    background: linear-gradient(90deg, #06b6d4 0%, #10b981 100%) !important;
  }
  #homeKpiFinancialsBar {
    background: linear-gradient(90deg, #059669 0%, #34d399 100%) !important;
  }

  /* High-Visibility Cursor-Reactive Specular Spotlight Across All Interactive Cards */
  .home-kpi-card::after,
  .home-bento-card::after,
  .cortex-bento-tile::after,
  #mainAppContent .erp-interactive-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(
      340px circle at var(--frontier-spot-x, 50%) var(--frontier-spot-y, 20%),
      rgba(16, 185, 129, 0.135) 0%,
      rgba(14, 165, 233, 0.07) 40%,
      transparent 72%
    );
    transition: opacity 0.25s ease;
  }

  .home-kpi-card:hover::after,
  .home-bento-card:hover::after,
  .cortex-bento-tile:hover::after,
  #mainAppContent .erp-interactive-card:hover::after {
    opacity: 1;
  }

  #mainAppContent .home-kpi-card:hover,
  #mainAppContent .erp-interactive-card:hover,
  #mainAppContent .cortex-bento-tile:hover {
    transform: translateY(-4px) !important;
    border-color: rgba(16, 185, 129, 0.56) !important;
    box-shadow:
      0 12px 26px -6px rgba(15, 23, 42, 0.11),
      0 24px 48px -14px rgba(16, 185, 129, 0.19),
      inset 0 1px 0 #ffffff !important;
  }

  #mainAppContent #homeKpiCardOrders:hover {
    border-color: rgba(79, 70, 229, 0.52) !important;
    box-shadow:
      0 12px 26px -6px rgba(15, 23, 42, 0.11),
      0 24px 48px -14px rgba(79, 70, 229, 0.22),
      inset 0 1px 0 #ffffff !important;
  }

  body.colorway-midnight #mainAppContent .home-kpi-card:hover,
  body.colorway-midnight #mainAppContent .erp-interactive-card:hover,
  body.colorway-midnight #mainAppContent .cortex-bento-tile:hover {
    border-color: rgba(52, 211, 153, 0.55) !important;
    box-shadow:
      0 16px 36px -8px rgba(2, 6, 23, 0.78),
      0 0 28px -8px rgba(16, 185, 129, 0.28),
      var(--frontier-specular-dark) !important;
  }

  #mainAppContent .home-kpi-card:hover .home-kpi-icon-well {
    transform: scale(1.08) translateY(-1px);
    transition: transform 0.22s var(--frontier-ease-bounce);
  }

  #mainAppContent .home-bento-card {
    position: relative;
    transition:
      transform 0.24s var(--frontier-ease-spring),
      box-shadow 0.24s var(--frontier-ease-spring),
      border-color 0.2s ease !important;
  }

  #mainAppContent .home-bento-card:hover {
    box-shadow: var(--frontier-shadow-card-hover) !important;
    border-color: rgba(148, 163, 184, 0.8) !important;
  }

  /* 2.8 Order Desk Secondary UI Polish: Obsidian Summary Footer & Luminous Save CTA */
  #orderSummaryCard {
    background: linear-gradient(135deg, #060b17 0%, #0f172a 60%, #06392c 100%) !important;
    border-top: 1px solid rgba(52, 211, 153, 0.32) !important;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.08) !important;
  }

  #totProfit {
    color: #34d399 !important;
    text-shadow: 0 0 20px rgba(52, 211, 153, 0.32);
  }

  #orderSummaryCard button[onclick*="commitOrderToDatabase"],
  #orderSummaryCard button[onclick*="commitOrderToDatabase"] * {
    color: #ffffff !important;
  }

  #orderSummaryCard button[onclick*="commitOrderToDatabase"] {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #34d399 0%, #10b981 55%, #059669 100%) !important;
    border: 1px solid rgba(110, 231, 183, 0.55) !important;
    border-radius: 0.625rem !important;
    font-weight: 700 !important;
    box-shadow:
      0 4px 14px -2px rgba(16, 185, 129, 0.45),
      inset 0 1px 0 0 rgba(255, 255, 255, 0.35) !important;
    transition: transform 0.16s var(--frontier-ease-spring), box-shadow 0.2s ease, filter 0.16s ease !important;
  }

  #orderSummaryCard button[onclick*="commitOrderToDatabase"]:hover {
    filter: brightness(1.06);
    transform: translateY(-1.5px) !important;
    box-shadow:
      0 8px 22px -2px rgba(16, 185, 129, 0.58),
      inset 0 1px 0 0 rgba(255, 255, 255, 0.45) !important;
  }

  /* 7-Day Scrubber Readout Console & Coordinate Chart Stage */
  body:not(:where(.colorway-midnight)) #homeChartLiveReadout {
    background: linear-gradient(180deg, #f8fafd 0%, #f1f5fb 100%) !important;
    border: 1px solid rgba(203, 213, 225, 0.9) !important;
    box-shadow: inset 0 1px 0 #ffffff, 0 2px 6px -2px rgba(15, 23, 42, 0.05) !important;
  }

  body:not(:where(.colorway-midnight)) .home-chart-stage {
    background-color: #f8fbff !important;
    background-image:
      linear-gradient(to right, rgba(148, 163, 184, 0.11) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(148, 163, 184, 0.11) 1px, transparent 1px) !important;
    background-size: 28px 28px !important;
    border: 1px solid rgba(203, 213, 225, 0.85) !important;
    box-shadow: inset 0 2px 5px rgba(15, 23, 42, 0.035) !important;
  }

  body:not(:where(.colorway-midnight)) .home-voice-studio-well {
    background: linear-gradient(180deg, #f8fafd 0%, #f1f5fb 100%) !important;
    border: 1px solid rgba(203, 213, 225, 0.9) !important;
    box-shadow: inset 0 1px 0 #ffffff !important;
  }

  .voice-wave-bar {
    background: linear-gradient(180deg, #10b981 0%, #0ea5e9 100%) !important;
    border-radius: 9999px !important;
  }

  /* Studio Mic Standby Triggers: Carbon-Obsidian Hardware Button With Glowing Ruby Armed LED */
  #btnHomeVoiceDictate:not(.is-recording),
  #btnAiTabVoiceMic:not(.is-recording) {
    position: relative;
    overflow: hidden;
    background-color: #0f172a !important;
    background-image: linear-gradient(180deg, #1e293b 0%, #0f172a 58%, #090f1d 100%) !important;
    border: 1px solid rgba(51, 65, 85, 0.92) !important;
    color: #f8fafc !important;
    box-shadow:
      0 2px 6px rgba(2, 6, 23, 0.22),
      0 8px 18px -6px rgba(15, 23, 42, 0.32),
      inset 0 1px 0 0 rgba(255, 255, 255, 0.22) !important;
  }

  #btnHomeVoiceDictate:not(.is-recording):hover,
  #btnAiTabVoiceMic:not(.is-recording):hover {
    border-color: rgba(52, 211, 153, 0.58) !important;
    filter: brightness(1.08);
    transform: translateY(-1px) !important;
    box-shadow:
      0 6px 16px -2px rgba(15, 23, 42, 0.32),
      0 12px 24px -8px rgba(16, 185, 129, 0.24),
      inset 0 1px 0 0 rgba(255, 255, 255, 0.28) !important;
  }

  #btnHomeVoiceDictate:not(.is-recording) #btnHomeVoiceDictateDot,
  #btnAiTabVoiceMic:not(.is-recording) #btnAiTabVoiceMicDot {
    background-color: #f43f5e !important;
    box-shadow: 0 0 9px rgba(244, 63, 94, 0.85) !important;
  }

  /* 3. Hardware-Machined Obsidian Command Sidebar (#erpAppSidebar) */
  body.colorway-classic aside#erpAppSidebar:not(.hidden),
  body:not(:where(.colorway-crimson, .colorway-emerald, .colorway-smokehouse, .colorway-industrial)) aside#erpAppSidebar:not(.hidden) {
    background-color: #050914 !important;
    background-image:
      radial-gradient(280px 180px at 22% 0%, rgba(16, 185, 129, 0.16) 0%, transparent 76%),
      radial-gradient(260px 200px at 80% 100%, rgba(56, 189, 248, 0.09) 0%, transparent 75%),
      linear-gradient(180deg, #050914 0%, #091122 52%, #050811 100%) !important;
    border-right: 1px solid rgba(51, 65, 85, 0.85) !important;
    box-shadow:
      inset -1px 0 0 0 rgba(255, 255, 255, 0.07),
      16px 0 42px -16px rgba(2, 6, 23, 0.58) !important;
  }

  #sidebarTopHeaderZone {
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.72) 0%, rgba(9, 15, 30, 0.55) 100%) !important;
    border-bottom: 1px solid rgba(51, 65, 85, 0.68) !important;
    backdrop-filter: blur(12px);
  }

  #headerSearchInputShell {
    background: rgba(15, 23, 42, 0.82) !important;
    border: 1px solid rgba(71, 85, 105, 0.65) !important;
    box-shadow:
      inset 0 1px 2px rgba(2, 6, 23, 0.55),
      0 1px 0 rgba(255, 255, 255, 0.04) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
  }

  #headerSearchInputShell:hover {
    border-color: rgba(100, 116, 139, 0.92) !important;
    background: rgba(15, 23, 42, 0.96) !important;
  }

  .header-omnibar-container.is-search-open #headerSearchInputShell,
  #headerSearchInputShell:focus-within {
    border-color: #34d399 !important;
    background: #070d1b !important;
    box-shadow:
      0 0 0 3px rgba(16, 185, 129, 0.22),
      inset 0 1px 1px rgba(255, 255, 255, 0.08) !important;
  }

  /* Declutter secondary sidebar omnibar icons while searching so typed queries never collide with match badge */
  .header-omnibar-container.is-search-open #headerSearchKbdBadge,
  .header-omnibar-container.is-search-open #sidebarQuickVoiceBtn,
  .header-omnibar-container.is-search-open #sidebarQuickPasteBtn,
  #headerSearchInputShell:focus-within #headerSearchKbdBadge,
  #headerSearchInputShell:focus-within #sidebarQuickVoiceBtn,
  #headerSearchInputShell:focus-within #sidebarQuickPasteBtn,
  #headerSearchInputShell:has(#universalSearchCountBadge:not(.hidden)) #headerSearchKbdBadge,
  #headerSearchInputShell:has(#universalSearchCountBadge:not(.hidden)) #sidebarQuickVoiceBtn,
  #headerSearchInputShell:has(#universalSearchCountBadge:not(.hidden)) #sidebarQuickPasteBtn,
  #headerSearchInputShell:has(#headerSearchClearCloseBtn:not(.hidden)) #headerSearchKbdBadge,
  #headerSearchInputShell:has(#headerSearchClearCloseBtn:not(.hidden)) #sidebarQuickVoiceBtn,
  #headerSearchInputShell:has(#headerSearchClearCloseBtn:not(.hidden)) #sidebarQuickPasteBtn {
    display: none !important;
  }

  #headerSearchInputShell #universalSearchInput {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  #headerSearchInputShell #universalSearchCountBadge {
    font-size: 9.5px !important;
    padding: 1px 6px !important;
    line-height: 1.35 !important;
    border-color: rgba(52, 211, 153, 0.35) !important;
    color: #6ee7b7 !important;
    background: rgba(6, 78, 59, 0.55) !important;
  }

  #sidebarLivePulsePod {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.86) 0%, rgba(7, 12, 24, 0.94) 100%) !important;
    border: 1px solid rgba(51, 65, 85, 0.75) !important;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.06) !important;
  }

  #erpAppSidebar .erp-nav-item {
    border-radius: 0.6875rem !important;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease !important;
  }

  #erpAppSidebar .erp-nav-item:hover:not(.is-active) {
    background-color: rgba(30, 41, 59, 0.72) !important;
    border-color: rgba(71, 85, 105, 0.45) !important;
    color: #ffffff !important;
    transform: none !important;
    box-shadow: none !important;
  }

  #erpAppSidebar .erp-nav-item.is-active {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.26) 0%, rgba(14, 165, 233, 0.12) 52%, rgba(15, 23, 42, 0.92) 100%) !important;
    border: 1px solid rgba(52, 211, 153, 0.48) !important;
    color: #ffffff !important;
    box-shadow:
      inset 3px 0 0 0 #10b981,
      0 8px 20px -10px rgba(16, 185, 129, 0.52) !important;
  }

  #erpAppSidebar .erp-nav-item.is-active svg {
    color: #34d399 !important;
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.55));
  }

  #sidebarUtilityModeTabs {
    background: rgba(2, 6, 23, 0.88) !important;
    border: 1px solid rgba(51, 65, 85, 0.78) !important;
    padding: 3px !important;
    border-radius: 0.625rem !important;
  }

  /* 4. Tactile Primary Buttons, Specular Press Ripple & Segmented Controls */
  button.bg-slate-900:not(#erpAppSidebar button):not(#headerUserDropdown button),
  .auth-primary-submit-btn,
  button#addBtn {
    position: relative;
    overflow: hidden;
    background-image: linear-gradient(180deg, #1e293b 0%, #0f172a 55%, #090f1d 100%) !important;
    border: 1px solid rgba(15, 23, 42, 0.95) !important;
    box-shadow:
      0 1px 2px rgba(2, 6, 23, 0.25),
      0 6px 16px -4px rgba(15, 23, 42, 0.28),
      inset 0 1px 0 0 rgba(255, 255, 255, 0.2) !important;
    transition:
      transform 0.16s var(--frontier-ease-spring),
      box-shadow 0.2s var(--frontier-ease-spring),
      filter 0.18s ease !important;
  }

  button.bg-slate-900:not(#erpAppSidebar button):not(#headerUserDropdown button):hover:not(:disabled),
  .auth-primary-submit-btn:hover:not(:disabled),
  button#addBtn:hover:not(:disabled) {
    filter: brightness(1.09);
    border-color: rgba(52, 211, 153, 0.55) !important;
    transform: translateY(-1px) !important;
    box-shadow:
      0 6px 16px -2px rgba(15, 23, 42, 0.32),
      0 14px 26px -8px rgba(16, 185, 129, 0.26),
      inset 0 1px 0 0 rgba(255, 255, 255, 0.28) !important;
  }

  button.bg-slate-900:not(#erpAppSidebar button):not(#headerUserDropdown button):active:not(:disabled),
  .auth-primary-submit-btn:active:not(:disabled),
  button[onclick*="commitOrderToDatabase"]:active:not(:disabled),
  button#addBtn:active:not(:disabled),
  .tactile-spell-btn:active:not(:disabled) {
    transform: scale(0.974) !important;
  }

  /* Tactile Specular Button Press Ripple */
  @keyframes frontierBtnRippleExpand {
    0% {
      opacity: 0.5;
      transform: translate(-50%, -50%) scale(0.15);
    }
    100% {
      opacity: 0;
      transform: translate(-50%, -50%) scale(2.85);
    }
  }

  .frontier-btn-ripple {
    position: absolute;
    width: 96px;
    height: 96px;
    border-radius: 9999px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.58) 0%, rgba(52, 211, 153, 0.28) 50%, transparent 72%);
    pointer-events: none;
    z-index: 5;
    animation: frontierBtnRippleExpand 0.46s var(--frontier-ease-spring) forwards;
  }

  /* Green Sign In With QuickBooks Tactile Specular Polish */
  button[onclick*="launchDirectQuickBooksSignIn"] {
    position: relative;
    overflow: hidden;
    background-image: linear-gradient(180deg, #34b324 0%, #2ca01c 65%, #228215 100%) !important;
    box-shadow:
      0 2px 6px rgba(44, 160, 28, 0.3),
      0 10px 24px -6px rgba(44, 160, 28, 0.36),
      inset 0 1px 0 0 rgba(255, 255, 255, 0.32) !important;
    transition: transform 0.18s var(--frontier-ease-spring), box-shadow 0.2s ease, filter 0.18s ease !important;
  }

  button[onclick*="launchDirectQuickBooksSignIn"]:hover {
    filter: brightness(1.06);
    transform: translateY(-1.5px) !important;
    box-shadow:
      0 8px 20px -2px rgba(44, 160, 28, 0.42),
      0 16px 32px -8px rgba(44, 160, 28, 0.4),
      inset 0 1px 0 0 rgba(255, 255, 255, 0.38) !important;
  }

  /* Sculpted Segmented Control Switchers (.shadcn-tabs-list) */
  body:not(:where(.colorway-midnight)) .shadcn-tabs-list {
    background: #e8eef6 !important;
    border: 1px solid rgba(203, 213, 225, 0.94) !important;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.065) !important;
    padding: 3px !important;
    border-radius: 0.6875rem !important;
  }

  .shadcn-tab-trigger {
    border-radius: 0.5rem !important;
    font-weight: 600 !important;
    transition:
      background-color 0.18s var(--frontier-ease-spring),
      color 0.18s ease,
      box-shadow 0.18s var(--frontier-ease-spring),
      transform 0.14s ease !important;
  }

  body:not(:where(.colorway-midnight)) .shadcn-tab-trigger.active {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
    color: #0f172a !important;
    box-shadow:
      0 2px 6px -1px rgba(15, 23, 42, 0.12),
      0 1px 2px rgba(15, 23, 42, 0.08),
      0 0 0 1px rgba(16, 185, 129, 0.24),
      inset 0 1px 0 #ffffff !important;
  }

  /* 5. Submenus, Popovers, Kebab Menus, Column Chooser & Command Palette Spring Choreography */
  @keyframes frontierPopoverSpringIn {
    0% {
      opacity: 0;
      transform: translateY(-7px) scale(0.968);
    }
    100% {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  @keyframes frontierPopoverSpringUp {
    0% {
      opacity: 0;
      transform: translateY(7px) scale(0.968);
    }
    100% {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  details.erp-secondary-dropdown > summary {
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease !important;
  }

  details.erp-secondary-dropdown[open] > summary {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16) !important;
  }

  details.erp-secondary-dropdown > summary svg {
    transition: transform 0.22s var(--frontier-ease-spring) !important;
  }

  details.erp-secondary-dropdown[open] > summary svg {
    transform: rotate(180deg) !important;
  }

  details.erp-secondary-dropdown[open] > div:not(.bottom-full),
  details.erp-secondary-dropdown[open] > ul,
  #globalOrderActionDropdown:not(.hidden),
  #columnVisibilityDropdown:not(.hidden),
  #headerToolsDropdown:not(.hidden),
  #universalSearchModal:not(.hidden) #universalSearchDropdownCard {
    animation: frontierPopoverSpringIn 0.22s var(--frontier-ease-spring) both !important;
    transform-origin: top right;
  }

  details.erp-secondary-dropdown[open] > div.bottom-full {
    animation: frontierPopoverSpringUp 0.22s var(--frontier-ease-spring) both !important;
    transform-origin: bottom right;
  }

  /* Light Frosted Popovers (Excludes Intentional Obsidian Popovers Like #orderSummaryCard More Actions) */
  body:not(:where(.colorway-midnight)) details.erp-secondary-dropdown.relative > div:not(.bg-slate-900),
  body:not(:where(.colorway-midnight)) #globalOrderActionDropdown,
  body:not(:where(.colorway-midnight)) #columnVisibilityDropdown {
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(20px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(160%) !important;
    border-radius: 0.875rem !important;
    border: 1px solid rgba(148, 163, 184, 0.45) !important;
    box-shadow: var(--frontier-shadow-popover) !important;
  }

  /* Intentional Dark Obsidian Popovers & Midnight Mode Popovers */
  details.erp-secondary-dropdown.relative > div.bg-slate-900,
  body.colorway-midnight details.erp-secondary-dropdown.relative > div,
  body.colorway-midnight #globalOrderActionDropdown,
  body.colorway-midnight #columnVisibilityDropdown {
    background: rgba(15, 23, 42, 0.97) !important;
    backdrop-filter: blur(20px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(160%) !important;
    border-radius: 0.875rem !important;
    border: 1px solid rgba(52, 211, 153, 0.28) !important;
    box-shadow:
      0 26px 56px -12px rgba(2, 6, 23, 0.84),
      inset 0 1px 0 0 rgba(255, 255, 255, 0.12) !important;
  }

  #globalOrderActionDropdown button,
  details.erp-secondary-dropdown.relative > div button {
    transition:
      background-color 0.14s ease,
      color 0.14s ease,
      padding-left 0.16s var(--frontier-ease-spring),
      box-shadow 0.14s ease !important;
  }

  #globalOrderActionDropdown button:hover,
  details.erp-secondary-dropdown.relative > div button:hover {
    padding-left: 0.9rem !important;
    box-shadow: inset 2.5px 0 0 0 #10b981 !important;
  }

  #headerUserDropdown:not(.hidden) {
    animation: frontierPopoverSpringUp 0.22s var(--frontier-ease-spring) both !important;
    transform-origin: bottom left;
    border-radius: 1rem !important;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(6, 11, 23, 0.99) 100%) !important;
    backdrop-filter: blur(22px) saturate(165%) !important;
    -webkit-backdrop-filter: blur(22px) saturate(165%) !important;
    box-shadow:
      0 30px 64px -12px rgba(2, 6, 23, 0.8),
      0 0 0 1px rgba(52, 211, 153, 0.28),
      inset 0 1px 0 0 rgba(255, 255, 255, 0.12) !important;
  }

  #universalSearchModal:not(.hidden) {
    backdrop-filter: blur(8px) saturate(135%);
    -webkit-backdrop-filter: blur(8px) saturate(135%);
  }

  #universalSearchDropdownCard {
    position: relative;
    overflow: hidden;
    border-radius: 1.125rem !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(22px) saturate(165%) !important;
    -webkit-backdrop-filter: blur(22px) saturate(165%) !important;
    box-shadow: var(--frontier-shadow-modal) !important;
    border: 1px solid rgba(148, 163, 184, 0.45) !important;
  }

  #universalSearchDropdownCard::before,
  #anywhereCopilotExpandedCard:not(.hidden)::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3.5px;
    z-index: 45;
    pointer-events: none;
    background: linear-gradient(90deg, #10b981 0%, #0ea5e9 52%, #6366f1 100%);
  }

  .u-search-nav-item {
    transition:
      transform 0.16s var(--frontier-ease-spring),
      border-color 0.16s ease,
      box-shadow 0.16s ease,
      background-color 0.16s ease !important;
  }

  .u-search-nav-item:hover,
  .u-search-nav-item.ring-2 {
    transform: translateY(-2px) !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
    box-shadow: 0 10px 24px -8px rgba(15, 23, 42, 0.14) !important;
  }

  /* 6. True Pop-Up Dialog Modals & Full-Page Studio Workspaces */
  @keyframes frontierModalSpringIn {
    0% {
      opacity: 0;
      transform: translateY(14px) scale(0.968);
    }
    100% {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  @keyframes frontierWorkspaceReveal {
    0% {
      opacity: 0;
      transform: translateY(10px);
    }
    100% {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* True Dialog Pop-Ups: Frosted Obsidian Backdrop & Z-Layered Semantic Top Jewel Rim (Never Masked By Child Headers) */
  div[id$="Modal"]:not(.erp-fullpage-workspace):not(#authLockModal):not(#universalSearchModal):not(#systemAuditModal):not(.hidden) {
    background-color: rgba(2, 6, 23, 0.62) !important;
    backdrop-filter: blur(14px) saturate(145%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(145%) !important;
  }

  div[id$="Modal"]:not(.erp-fullpage-workspace):not(#authLockModal):not(#universalSearchModal):not(#systemAuditModal):not(.hidden) > div:not(.absolute) {
    position: relative !important;
    overflow: hidden !important;
    border-radius: 1.25rem !important;
    border: 1px solid rgba(203, 213, 225, 0.85) !important;
    animation: frontierModalSpringIn 0.25s var(--frontier-ease-spring) both !important;
    box-shadow: var(--frontier-shadow-modal) !important;
  }

  div[id$="Modal"]:not(.erp-fullpage-workspace):not(#authLockModal):not(#universalSearchModal):not(#systemAuditModal):not(.hidden) > div:not(.absolute)::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    z-index: 50;
    pointer-events: none;
    background: linear-gradient(90deg, #10b981 0%, #0ea5e9 55%, #6366f1 100%);
  }

  #twoStepDeleteModal:not(.hidden) > div:not(.absolute)::before,
  #paymentModal:not(.hidden):has(#paymentModalHeader.bg-rose-700) > div:not(.absolute)::before {
    background: linear-gradient(90deg, #f43f5e 0%, #e11d48 100%) !important;
  }

  #paymentModal:not(.hidden):has(#paymentModalHeader.bg-emerald-700) > div:not(.absolute)::before {
    background: linear-gradient(90deg, #10b981 0%, #0ea5e9 65%, #34d399 100%) !important;
  }

  body:not(:where(.colorway-midnight)) #paymentModalHeader {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafd 100%) !important;
    color: #0f172a !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95) !important;
    padding: 1.15rem 1.25rem !important;
  }

  body.colorway-midnight #paymentModalHeader {
    background: linear-gradient(180deg, #0f172a 0%, #090f1d 100%) !important;
    color: #f8fafc !important;
    border-bottom: 1px solid rgba(51, 65, 85, 0.85) !important;
    padding: 1.15rem 1.25rem !important;
  }

  #paymentModalTitle {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.015em !important;
  }

  #paymentModalHeader.bg-emerald-700 #paymentModalTitle::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
    flex-shrink: 0;
  }

  #paymentModalHeader.bg-rose-700 #paymentModalTitle::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background-color: #f43f5e;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.18);
    flex-shrink: 0;
  }

  #orderStockWarningModal:not(.hidden) > div:not(.absolute)::before,
  #shortageClaimModal:not(.hidden) > div:not(.absolute)::before,
  #rmaModal:not(.hidden) > div:not(.absolute)::before {
    background: linear-gradient(90deg, #f59e0b 0%, #f97316 100%) !important;
  }

  /* Full-Page Overlay Workspaces: Seamless Inheritance of Body Fixed Architectural Dot-Matrix Studio Canvas */
  body:not(:where(.colorway-midnight)) .erp-fullpage-workspace:not(.hidden),
  body.colorway-midnight .erp-fullpage-workspace:not(.hidden) {
    background: transparent !important;
    background-color: transparent !important;
  }

  .erp-fullpage-workspace:not(.hidden) > div {
    animation: frontierWorkspaceReveal 0.25s var(--frontier-ease-spring) both !important;
  }

  /* 7. Data Tables Precision Hover, Machined Slate Header & Dark Summary Footers */
  body:not(:where(.colorway-midnight, .colorway-crimson, .colorway-emerald, .colorway-smokehouse, .colorway-industrial)) :not(:where(#printArea)) table thead th,
  body.colorway-classic :not(#printArea) table thead th {
    background: linear-gradient(180deg, #f8fafd 0%, #ecf2fa 100%) !important;
    color: #334155 !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.45) !important;
    letter-spacing: 0.05em !important;
    font-weight: 700 !important;
  }

  table thead th {
    letter-spacing: 0.045em;
    font-weight: 600;
  }

  table tbody tr {
    transition: background-color 0.14s ease, box-shadow 0.14s ease !important;
  }

  body:not(:where(.colorway-midnight)) table tbody tr:hover {
    background-color: rgba(240, 253, 244, 0.58) !important;
    box-shadow: inset 3px 0 0 0 #10b981 !important;
  }

  body.colorway-midnight table tbody tr:hover {
    box-shadow: inset 3px 0 0 0 #34d399 !important;
  }

  table tfoot.bg-slate-900 {
    background: linear-gradient(90deg, #070d1b 0%, #0f172a 65%, #073428 100%) !important;
  }

  /* 8. Flagship Login Gateway Aurora Drift, Precision Grid & Ceremonial Portal */
  @keyframes frontierAuroraDrift {
    0% {
      background-position: 0% 0%, 100% 100%, 50% 50%;
    }
    50% {
      background-position: 12% 8%, 88% 92%, 50% 50%;
    }
    100% {
      background-position: 0% 0%, 100% 100%, 50% 50%;
    }
  }

  #authLockModal {
    background:
      radial-gradient(980px 580px at 16% 14%, rgba(16, 185, 129, 0.25) 0%, rgba(14, 165, 233, 0.11) 42%, transparent 68%),
      radial-gradient(920px 560px at 86% 86%, rgba(99, 102, 241, 0.25) 0%, rgba(16, 185, 129, 0.085) 45%, transparent 68%),
      linear-gradient(155deg, #020611 0%, #081024 52%, #030712 100%) !important;
    background-size: 120% 120%, 120% 120%, 100% 100% !important;
    animation: frontierAuroraDrift 16s ease-in-out infinite;
  }

  #authLockModal::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
      linear-gradient(to right, rgba(148, 163, 184, 0.075) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(148, 163, 184, 0.075) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: radial-gradient(ellipse 84% 74% at 50% 50%, #000 38%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 84% 74% at 50% 50%, #000 38%, transparent 100%);
  }

  #authLockCard {
    border-radius: 1.375rem !important;
    border: 1px solid rgba(148, 163, 184, 0.26) !important;
    box-shadow:
      0 44px 100px -18px rgba(0, 0, 0, 0.78),
      0 0 54px -16px rgba(16, 185, 129, 0.26),
      0 0 0 1px rgba(255, 255, 255, 0.1),
      inset 0 1px 0 0 rgba(255, 255, 255, 0.16) !important;
  }

  #authBrandTrustPanel {
    background:
      radial-gradient(420px 300px at 18% 12%, rgba(16, 185, 129, 0.22) 0%, transparent 72%),
      linear-gradient(170deg, #040916 0%, #0a1328 58%, #040814 100%) !important;
  }

  #authBrandTrustPanel h2 {
    font-size: 1.65rem !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
  }

  #authGatewayTitle {
    font-size: 1.45rem !important;
    font-weight: 800 !important;
  }

  .auth-trust-feature-card {
    background: rgba(15, 23, 42, 0.74) !important;
    border: 1px solid rgba(52, 211, 153, 0.28) !important;
    backdrop-filter: blur(12px);
    box-shadow:
      0 14px 28px -12px rgba(0, 0, 0, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  }

  #authLockModal .auth-tactile-input {
    height: 44px !important;
    border-radius: 0.75rem !important;
    background-color: #f8fafd !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  }

  #authLockModal .auth-tactile-input:focus {
    background-color: #ffffff !important;
    border-color: #10b981 !important;
    box-shadow:
      0 0 0 4px rgba(16, 185, 129, 0.18),
      0 6px 16px -4px rgba(16, 185, 129, 0.16) !important;
  }

  .auth-architectural-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
      radial-gradient(rgba(148, 163, 184, 0.24) 1px, transparent 1px);
    background-size: 20px 20px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.2) 100%);
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.2) 100%);
  }

  .auth-primary-submit-btn::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -120%;
    width: 65%;
    background: linear-gradient(
      105deg,
      transparent 20%,
      rgba(255, 255, 255, 0.26) 50%,
      transparent 80%
    );
    transform: skewX(-18deg);
    transition: left 0.55s var(--frontier-ease-spring);
    pointer-events: none;
  }

  .auth-primary-submit-btn:hover::after {
    left: 145%;
  }

  .auth-cta-arrow {
    display: inline-block;
    transition: transform 0.2s var(--frontier-ease-spring);
  }

  .auth-primary-submit-btn:hover .auth-cta-arrow {
    transform: translateX(4px);
  }

  @keyframes frontierSlotPop {
    0% { transform: scale(0.9); }
    55% { transform: scale(1.08); }
    100% { transform: scale(1); }
  }

  .auth-mfa-slot.is-filled {
    background: #ecfdf5 !important;
    border-color: #10b981 !important;
    color: #065f46 !important;
    box-shadow: 0 4px 12px -4px rgba(16, 185, 129, 0.32) !important;
    animation: frontierSlotPop 0.22s var(--frontier-ease-bounce);
  }

  .auth-mfa-slot.is-active {
    border-color: #10b981 !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18) !important;
  }

  @keyframes frontierWelcomeSyncSweep {
    0% { width: 12%; }
    100% { width: 100%; }
  }

  .auth-welcome-sync-track {
    width: 100%;
    height: 3.5px;
    border-radius: 9999px;
    background: rgba(30, 41, 59, 0.92);
    overflow: hidden;
  }

  #authWelcomeMomentOverlay:not(.hidden) .auth-welcome-sync-fill {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, #10b981 0%, #34d399 50%, #38bdf8 100%);
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.65);
    animation: frontierWelcomeSyncSweep 0.64s var(--frontier-ease-spring) forwards;
  }

  /* 9. Dynamic-Island Glassmorphic Toast & Auto-Depleting Progress Hairline */
  @keyframes frontierToastDropIn {
    0% {
      opacity: 0;
      transform: translateY(-16px) scale(0.95);
    }
    100% {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  @keyframes frontierToastCountdown {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
  }

  #validationBanner.frontier-toast-banner {
    backdrop-filter: blur(20px) saturate(165%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(165%) !important;
    animation: frontierToastDropIn 0.26s var(--frontier-ease-spring) both !important;
    box-shadow:
      0 22px 48px -10px rgba(2, 6, 23, 0.48),
      0 6px 16px -4px rgba(2, 6, 23, 0.26),
      inset 0 1px 0 0 rgba(255, 255, 255, 0.2) !important;
    overflow: hidden;
  }

  .frontier-toast-progress-track {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.5px;
    background: rgba(255, 255, 255, 0.14);
    pointer-events: none;
  }

  .frontier-toast-progress-fill {
    width: 100%;
    height: 100%;
    transform-origin: left center;
    background: linear-gradient(90deg, #34d399 0%, #38bdf8 100%);
    animation: frontierToastCountdown 3.8s linear forwards;
  }

  /* 10. Dual-Shockwave Dopamine Ring, Vector Sparks, Card Rim Pulse & Tab Waterfall */
  @keyframes frontierDopamineRingExpand {
    0% {
      opacity: 0.92;
      transform: translate(-50%, -50%) scale(0.22);
    }
    100% {
      opacity: 0;
      transform: translate(-50%, -50%) scale(2.65);
    }
  }

  @keyframes frontierDopamineSparkFly {
    0% {
      opacity: 1;
      transform: translate(-50%, -50%) translate3d(0, 0, 0) scale(1.15);
    }
    100% {
      opacity: 0;
      transform: translate(-50%, -50%) translate3d(var(--spark-dx, 36px), var(--spark-dy, -36px), 0) scale(0.18);
    }
  }

  @keyframes frontierCardSuccessPulse {
    0% {
      box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.48), var(--frontier-shadow-card);
    }
    60% {
      box-shadow: 0 0 0 8px rgba(16, 185, 129, 0), var(--frontier-shadow-card-hover);
    }
    100% {
      box-shadow: 0 0 0 0 rgba(16, 185, 129, 0), var(--frontier-shadow-card);
    }
  }

  .frontier-card-pulse {
    animation: frontierCardSuccessPulse 0.62s var(--frontier-ease-spring);
  }

  .frontier-dopamine-ring {
    position: fixed;
    width: 58px;
    height: 58px;
    border-radius: 9999px;
    border: 2.5px solid #10b981;
    box-shadow: 0 0 22px rgba(16, 185, 129, 0.55);
    pointer-events: none;
    z-index: 9998;
    will-change: transform, opacity;
    animation: frontierDopamineRingExpand 0.58s var(--frontier-ease-spring) forwards;
  }

  .frontier-dopamine-ring.is-secondary {
    width: 42px;
    height: 42px;
    border-width: 1.5px;
    animation-delay: 65ms;
    animation-duration: 0.62s;
  }

  .frontier-dopamine-spark {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    box-shadow: 0 0 10px currentColor;
    pointer-events: none;
    z-index: 9998;
    will-change: transform, opacity;
    animation: frontierDopamineSparkFly 0.62s var(--frontier-ease-spring) forwards;
  }

  .frontier-dopamine-spark.is-diamond {
    border-radius: 1.5px;
  }

  .executive-portal-float-pill {
    backdrop-filter: blur(16px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(160%) !important;
    box-shadow:
      0 18px 38px -8px rgba(2, 6, 23, 0.48),
      0 0 0 1px rgba(52, 211, 153, 0.42),
      inset 0 1px 0 0 rgba(255, 255, 255, 0.22) !important;
  }

  @keyframes frontierTabWaterfallIn {
    0% {
      opacity: 0;
      transform: translateY(9px);
    }
    100% {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .frontier-tab-cascade-active > * {
    animation: frontierTabWaterfallIn 0.26s var(--frontier-ease-spring) both;
  }
  .frontier-tab-cascade-active > *:nth-child(1) { animation-delay: 0ms; }
  .frontier-tab-cascade-active > *:nth-child(2) { animation-delay: 32ms; }
  .frontier-tab-cascade-active > *:nth-child(3) { animation-delay: 64ms; }
  .frontier-tab-cascade-active > *:nth-child(4) { animation-delay: 96ms; }
  .frontier-tab-cascade-active > *:nth-child(5) { animation-delay: 124ms; }

  /* 11. Floating Obsidian-Emerald Cortex Jewel Pill, QuickBooks Hub & Peak-End Drawers */
  body:not(:where(.colorway-midnight)) #anywhereCopilotTriggerPill {
    background: linear-gradient(135deg, #0f172a 0%, #091326 65%, #064e3b 100%) !important;
    color: #f8fafc !important;
    border: 1px solid rgba(52, 211, 153, 0.45) !important;
    box-shadow:
      0 14px 32px -6px rgba(2, 6, 23, 0.38),
      0 0 20px -6px rgba(16, 185, 129, 0.4),
      inset 0 1px 0 0 rgba(255, 255, 255, 0.18) !important;
    transition:
      transform 0.22s var(--frontier-ease-spring),
      box-shadow 0.22s var(--frontier-ease-spring),
      border-color 0.18s ease !important;
  }

  body:not(:where(.colorway-midnight)) #anywhereCopilotTriggerPill kbd {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #cbd5e1 !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
  }

  #anywhereCopilotTriggerPill:hover {
    transform: translateY(-3px) scale(1.03) !important;
    border-color: #34d399 !important;
    box-shadow:
      0 18px 38px -6px rgba(2, 6, 23, 0.48),
      0 0 26px -4px rgba(16, 185, 129, 0.52),
      inset 0 1px 0 0 rgba(255, 255, 255, 0.26) !important;
  }

  #anywhereCopilotTriggerPill > span.w-2.h-2 {
    background-color: #34d399 !important;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.85) !important;
  }

  body.colorway-midnight #anywhereCopilotTriggerPill {
    background: linear-gradient(135deg, #0f172a 0%, #064e3b 100%) !important;
    color: #f8fafc !important;
    border-color: rgba(52, 211, 153, 0.45) !important;
    box-shadow:
      0 18px 38px -8px rgba(2, 6, 23, 0.78),
      inset 0 1px 0 0 rgba(255, 255, 255, 0.14) !important;
  }

  @keyframes frontierBottomCardPop {
    0% {
      opacity: 0;
      transform: translateY(14px) scale(0.96);
    }
    100% {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  body:has(#authLockModal:not(.hidden)) #universalAnywhereCopilotBar {
    display: none !important;
  }

  /* Guarantee generous bottom scroll clearance across all tabs & workspaces above floating Cortex ⌘K pill */
  main#mainAppContent {
    padding-bottom: 5.75rem !important;
  }

  .erp-fullpage-workspace:not(.hidden) {
    padding-bottom: 5rem !important;
  }

  /* Prevent custom select chevron arrows from overlapping long option labels */
  :not(:where(#printArea)) select:not([multiple]):not([size]) {
    padding-right: 2.25rem !important;
    text-overflow: ellipsis !important;
  }

  #zplVisualLabelPreview .font-mono {
    overflow-wrap: anywhere;
    letter-spacing: -0.02em;
  }

  #anywhereCopilotExpandedCard:not(.hidden) {
    position: relative;
    overflow: hidden;
    animation: frontierBottomCardPop 0.24s var(--frontier-ease-spring) both !important;
    transform-origin: bottom right;
    border-radius: 1.125rem !important;
    backdrop-filter: blur(22px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(22px) saturate(160%) !important;
    box-shadow: var(--frontier-shadow-modal) !important;
  }

  #peakEndCompletionDrawer:not(.hidden),
  #optimisticUndoBridgeBar:not(.hidden) {
    animation: frontierBottomCardPop 0.25s var(--frontier-ease-spring) both !important;
  }

  #qboGuideModal #qboUniversalDropZone:hover,
  #qboIntegrationModal #qboUniversalDropZone:hover {
    border-color: #10b981 !important;
    box-shadow: var(--frontier-shadow-card-hover) !important;
    transform: translateY(-2px) !important;
  }

  #qboQuickLinkConfirmBox[open] > div,
  #qboCustomizeSettingsDrawer[open] > div {
    animation: frontierPopoverSpringIn 0.22s var(--frontier-ease-spring) both !important;
    transform-origin: top center;
  }

  #mainAppContent #guardrailBanner[data-guardrail-state="approved"] {
    box-shadow:
      0 10px 26px -12px rgba(16, 185, 129, 0.3),
      inset 0 1px 0 0 rgba(255, 255, 255, 0.96) !important;
  }

  .guardrail-playhead-thumb {
    transition: left 0.12s ease-out, transform 0.18s var(--frontier-ease-bounce), box-shadow 0.18s ease;
  }

  .guardrail-interactive-track:hover .guardrail-playhead-thumb {
    transform: translate(-50%, -50%) scale(1.18);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.32);
  }
}

@media (prefers-reduced-motion: reduce) {
  #authLockModal,
  .frontier-tab-cascade-active > *,
  .frontier-dopamine-ring,
  .frontier-dopamine-spark,
  .frontier-btn-ripple,
  #validationBanner.frontier-toast-banner,
  div[id$="Modal"]:not(.erp-fullpage-workspace):not(#authLockModal):not(#universalSearchModal):not(.hidden) > div:not(.absolute),
  details.erp-secondary-dropdown[open] > div {
    animation: none !important;
    transition: none !important;
  }
}











