/* ==========================================================================
   Olosota - Admin Web Dashboard Design System
   Matches docs/design.md (Utsaho Flat Material 3 Architecture)
   ========================================================================== */

@font-face {
  font-family: 'LiAdorNoirrit';
  src: url('../fonts/LiAdorNoirrit-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'LiAdorNoirrit';
  src: url('../fonts/LiAdorNoirrit-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'LiAdorNoirrit';
  src: url('../fonts/LiAdorNoirrit-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: 'LiAdorNoirrit';
  src: url('../fonts/LiAdorNoirrit-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

:root {
  /* Core Utsaho Brand Colors */
  --primary: #4196FF;
  --primary-hover: #2F7EE6;
  --primary-light: #EBF5FF;
  --accent: #FFAC31;
  --accent-light: #FFFBEB;
  --success: #00C896;
  --success-light: #E6FAF5;
  --danger: #FF4757;
  --danger-light: #FEF2F2;
  --violet: #8B5CF6;
  --violet-light: #F3E8FF;

  /* Theme Surfaces & Borders (Light Mode Default) */
  --bg: #FFFBF5;
  --surface: #FFFFFF;
  --surface-secondary: #F7F1E7;
  --border: #EAE3D5;
  --border-focus: #4196FF;
  --text-primary: #1A1A2E;
  --text-secondary: #5A6080;
  --text-tertiary: #6E7698;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-card: 20px;
  --radius-modal: 24px;
  --radius-pill: 9999px;

  /* Typography */
  --font-family: 'LiAdorNoirrit', 'Hind Siliguri', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Elevation 0 Philosophy (No shadows, crisp 1px borders) */
  --sidebar-width: 260px;
  --topbar-height: 70px;
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);

  /* Smart Scrollbar Tokens (Sleek & Modern) */
  --scrollbar-width: 6px;
  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(148, 163, 184, 0.45);
  --scrollbar-thumb-hover: rgba(100, 116, 139, 0.75);
}

[data-theme="dark"] {
  --bg: #0D0F14;
  --surface: #161A24;
  --surface-secondary: #1E2433;
  --border: #2A3045;
  --border-focus: #4196FF;
  --text-primary: #FFFFFF;
  --text-secondary: #B0BAD0;
  --text-tertiary: #6B7694;
  --primary-light: #1A3A6B;
  --accent-light: #5C3E00;
  --danger-light: #3D1418;
  --success-light: #0C382E;
  --violet-light: #36226B;

  /* Smart Scrollbar Tokens Dark */
  --scrollbar-thumb: rgba(148, 163, 184, 0.3);
  --scrollbar-thumb-hover: rgba(148, 163, 184, 0.6);
}

/* ==========================================================================
   Smart Scrollbar System (Global Page, Tables & Right Side)
   ========================================================================== */
html, body {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* WebKit / Blink Custom Scrollbar (Slim 6px width with pill rounded thumb) */
::-webkit-scrollbar {
  width: var(--scrollbar-width);
  height: var(--scrollbar-width);
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background-clip: padding-box;
  transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* Reset & Basics */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  font-family: var(--font-family);
  cursor: pointer;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

:where(a, button, summary, [role="button"], input[type="button"], input[type="submit"], [tabindex]):focus:not(:focus-visible) {
  outline: none;
}

:where(a, button, summary, [role="button"], input[type="button"], input[type="submit"], [tabindex]):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

input, select, textarea {
  font-family: var(--font-family);
  outline: none;
}

/* ==========================================================================
   Admin Layout Structure
   ========================================================================== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ==========================================================================
   Admin Sidebar (docs/design.md Section 5.1)
   ========================================================================== */
.admin-sidebar {
  width: var(--sidebar-width);
  background-color: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 99;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Edge Floating Toggle Button (docs/design.md Section 5.1) */
.sidebar-edge-toggle {
  position: absolute;
  right: -14px;
  top: 21px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--accent);
  color: #FFFFFF;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 101;
  font-size: 11px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: background-color 0.2s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-edge-toggle:hover {
  background-color: #EA580C;
  color: #FFFFFF;
  transform: scale(1.1);
}

.sidebar-edge-toggle i,
.sidebar-edge-toggle .sidebar-toggle-svg {
  color: #FFFFFF !important;
  stroke: #FFFFFF !important;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


.sidebar-header {
  height: var(--topbar-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.brand-title {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  line-height: 1.1;
  text-align: center;
}

.brand-title span {
  color: var(--primary);
  font-weight: 800;
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  margin-top: 4px;
  text-align: center;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 14px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* Smart Auto-hide Scrollbar: Invisible until mouse hovers */
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 0.25s ease;
}

/* Sidebar Scrollbar: Extra sleek 5px width and invisible by default */
.sidebar-nav::-webkit-scrollbar {
  width: 5px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: var(--radius-pill);
  transition: background-color 0.25s ease;
}

/* Reveal smart scrollbar only when mouse enters the sidebar */
.admin-sidebar:hover .sidebar-nav,
.sidebar-nav:hover {
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

.admin-sidebar:hover .sidebar-nav::-webkit-scrollbar-thumb,
.sidebar-nav:hover::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover) !important;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 14px 10px 6px 10px;
  letter-spacing: 0.5px;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 15px;
  transition: var(--transition);
}

.nav-link-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Smart Stroke Vector Icon System (Lucide / Outline SVG Standard) */
.nav-link-left i,
.nav-link-left .nav-icon-stroke {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.2s ease, color 0.2s ease;
}

.nav-link-left i {
  font-size: 17px;
  width: 22px;
  text-align: center;
}

.nav-link:hover {
  background-color: var(--surface-secondary);
  color: var(--text-primary);
}

.nav-link:hover .nav-icon-stroke {
  transform: scale(1.1);
}

.nav-link.active {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.nav-link.active i,
.nav-link.active .nav-icon-stroke:not([style*="color"]) {
  color: var(--primary);
  stroke: var(--primary);
}

/* Sidebar Accordion (docs/design.md Section 5.7) */
.nav-accordion {
  display: flex;
  flex-direction: column;
}

.nav-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
}

.nav-accordion-header:hover {
  background-color: var(--surface-secondary);
  color: var(--text-primary);
}

.nav-accordion.open .nav-accordion-header {
  color: var(--primary);
  font-weight: 700;
  background-color: rgba(65, 150, 255, 0.05);
}

.nav-accordion-header .chevron-icon {
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  font-size: 11px;
  transition: transform 0.25s ease, stroke 0.25s ease;
  color: var(--text-tertiary);
  stroke: var(--text-tertiary);
}

.nav-accordion.open .nav-accordion-header .chevron-icon {
  transform: rotate(180deg);
  color: var(--primary);
  stroke: var(--primary);
}

.sub-nav-menu {
  display: none;
  flex-direction: column;
  gap: 3px;
  padding: 4px 0 6px 14px;
  border-left: 2px solid var(--border);
  margin-left: 22px;
  margin-top: 2px;
}

.nav-accordion.open .sub-nav-menu {
  display: flex;
  animation: fadeIn 0.2s ease forwards;
}

.sub-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
}

.sub-nav-link i,
.sub-nav-link .nav-icon-stroke {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  color: var(--text-tertiary);
  font-size: 13px;
  text-align: center;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.2s ease, color 0.2s ease;
}

.sub-nav-link:hover {
  background-color: var(--surface-secondary);
  color: var(--text-primary);
}

.sub-nav-link:hover .nav-icon-stroke {
  transform: scale(1.1);
  color: var(--text-primary);
}

.sub-nav-link.active {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.sub-nav-link.active i,
.sub-nav-link.active .nav-icon-stroke:not([style*="color"]) {
  color: var(--primary);
  stroke: var(--primary);
}

.admin-sidebar.collapsed .sub-nav-menu,
.admin-sidebar.collapsed .nav-accordion-header .chevron-icon {
  display: none !important;
}

.nav-counter {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #FFFFFF;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-secondary);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  margin: 12px;
}

.vps-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.vps-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #047857;
  font-weight: 700;
}

[data-theme="dark"] .vps-indicator {
  color: #34D399;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 200, 150, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(0, 200, 150, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 200, 150, 0); }
}

/* ==========================================================================
   Admin Main Area & Topbar
   ========================================================================== */
.admin-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Collapsed Sidebar State (docs/design.md Section 5.1)
   ========================================================================== */
.admin-sidebar.collapsed {
  width: 74px;
}

.admin-sidebar.collapsed .sidebar-edge-toggle i,
.admin-sidebar.collapsed .sidebar-edge-toggle .sidebar-toggle-svg {
  transform: rotate(180deg);
}

.admin-sidebar.collapsed .brand-wrap {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-15px);
}

.admin-sidebar.collapsed .sidebar-header {
  padding: 0 10px;
  justify-content: center;
}

.admin-sidebar.collapsed .nav-section-title {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.admin-sidebar.collapsed .nav-link,
.admin-sidebar.collapsed .nav-accordion-header {
  position: relative;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin: 6px auto;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
}

.admin-sidebar.collapsed .nav-link-left {
  gap: 0;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.admin-sidebar.collapsed .nav-link-left span {
  display: none !important;
}

.admin-sidebar.collapsed .nav-link-left .nav-icon-stroke {
  margin: 0 auto;
}

.admin-sidebar.collapsed .nav-counter {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9999px;
  line-height: 1;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  z-index: 5;
  border: 1.5px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.admin-sidebar.collapsed .nav-counter[style*="display: none"],
.admin-sidebar.collapsed .nav-counter[style*="display:none"],
.admin-sidebar.collapsed .nav-counter.is-hidden {
  display: none !important;
}

.admin-sidebar.collapsed .nav-counter:not([id]) {
  display: none !important;
}


.admin-sidebar.collapsed .sidebar-footer {
  display: none;
}

.admin-layout.sidebar-collapsed .admin-main {
  margin-left: 74px;
}

.admin-topbar {
  height: var(--topbar-height);
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 90;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  max-width: 520px;
}

.menu-toggle-btn {
  display: none;
  font-size: 20px;
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--surface-secondary);
}

.search-bar-wrap {
  position: relative;
  width: 100%;
}

.search-bar-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 15px;
}

.search-input {
  width: 100%;
  height: 42px;
  background-color: var(--surface-secondary);
  border: 1.4px solid transparent;
  border-radius: var(--radius-md);
  padding: 0 80px 0 40px;
  font-size: 14px;
  color: var(--text-primary);
  transition: var(--transition);
}

.search-input:focus {
  background-color: var(--surface);
  border-color: var(--border-focus);
}

.search-shortcut {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Store Open/Closed Toggle Button in Topbar (matching .lang-toggle-btn UI) */
.store-status-btn,
.store-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-secondary);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.store-status-btn:hover,
.store-status-pill:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.store-status-btn i,
.store-status-pill i {
  font-size: 14px;
  transition: color 0.2s ease;
}

.store-status-btn.open i,
.store-status-pill.open i {
  color: #047857;
}

.store-status-btn.closed i,
.store-status-pill.closed i {
  color: #B91C1C;
}

[data-theme="dark"] .store-status-btn.open i,
[data-theme="dark"] .store-status-pill.open i {
  color: #34D399;
}

[data-theme="dark"] .store-status-btn.closed i,
[data-theme="dark"] .store-status-pill.closed i {
  color: #F87171;
}

/* Sound and Theme Icon Buttons */
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--surface-secondary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  position: relative;
  transition: var(--transition);
}

.icon-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.notification-count {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}

/* Admin Profile */
.admin-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-secondary);
}

.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.profile-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.profile-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.profile-role {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ==========================================================================
   Mobile & Responsive Topbar Components (docs/design.md Section 79 & Rule 34)
   ========================================================================== */
.topbar-row-main {
  display: contents; /* Seamless desktop integration: children behave as direct topbar flex items */
}

.mobile-app-brand {
  display: none;
  align-items: center;
  gap: 0;
  cursor: pointer;
  user-select: none;
}

.mobile-brand-icon {
  display: none !important; /* Icon removed per user request */
}

.mobile-brand-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.mobile-brand-title span {
  color: var(--primary);
  font-weight: 800;
}

.mobile-search-toggle-btn {
  display: none;
}

.smart-menu-icon {
  width: 20px;
  height: 20px;
  stroke: var(--text-primary);
  display: block;
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.menu-toggle-btn:hover .smart-menu-icon,
.menu-toggle-btn:active .smart-menu-icon {
  stroke: var(--primary);
}

.search-toggle-svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-primary);
  display: block;
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.mobile-search-toggle-btn:hover .search-toggle-svg,
.mobile-search-toggle-btn.active .search-toggle-svg {
  stroke: var(--primary);
}

.topbar-search-row {
  display: none; /* Hidden on desktop; rendered below AppBar on mobile/tablet */
}

/* 3-Dot Overflow Menu (Hidden on desktop, active on mobile/tablet) */
.topbar-overflow-wrap {
  position: relative;
  display: none;
}

.topbar-more-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 15px;
}

.topbar-more-btn:hover,
.topbar-overflow-wrap.open .topbar-more-btn {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.topbar-overflow-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 290px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
  overflow: hidden;
}

.topbar-overflow-wrap.open .topbar-overflow-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.overflow-dropdown-header {
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
}

.overflow-dropdown-body {
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.overflow-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
  gap: 8px;
}

.overflow-menu-item:hover,
.overflow-menu-item:focus {
  background: var(--surface-secondary);
}

.overflow-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.overflow-item-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.overflow-item-icon-box.store-box { background: #ECFDF5; color: #047857; }
.overflow-item-icon-box.lang-box { background: #EFF6FF; color: #2563EB; }
.overflow-item-icon-box.test-box { background: #FFF7ED; color: #EA580C; }
.overflow-item-icon-box.theme-box { background: #F3E8FF; color: #7C3AED; }
.overflow-item-icon-box.sound-box { background: #F1F5F9; color: #475569; }

.overflow-item-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.overflow-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overflow-item-desc {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overflow-item-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.overflow-item-badge.open { background: #D1FAE5; color: #047857; }
.overflow-item-badge.closed { background: #FEE2E2; color: #B91C1C; }
.overflow-item-badge.lang-badge { background: #DBEAFE; color: #1D4ED8; }
.overflow-item-badge.test-badge { background: #FFEDD5; color: #C2410C; }
.overflow-item-badge.theme-badge { background: #EDE9FE; color: #6D28D9; }
.overflow-item-badge.sound-badge.active { background: #DCFCE7; color: #15803D; }
.overflow-item-badge.sound-badge.inactive { background: #F3F4F6; color: #6B7280; }

[data-theme="dark"] .overflow-item-icon-box.store-box { background: rgba(4, 120, 87, 0.25); color: #34D399; }
[data-theme="dark"] .overflow-item-icon-box.lang-box { background: rgba(37, 99, 235, 0.25); color: #60A5FA; }
[data-theme="dark"] .overflow-item-icon-box.test-box { background: rgba(234, 88, 12, 0.25); color: #FB923C; }
[data-theme="dark"] .overflow-item-icon-box.theme-box { background: rgba(124, 58, 237, 0.25); color: #A78BFA; }
[data-theme="dark"] .overflow-item-icon-box.sound-box { background: rgba(71, 85, 105, 0.35); color: #94A3B8; }
[data-theme="dark"] .overflow-item-badge.open { background: rgba(4, 120, 87, 0.3); color: #34D399; }
[data-theme="dark"] .overflow-item-badge.closed { background: rgba(185, 28, 28, 0.3); color: #F87171; }
[data-theme="dark"] .overflow-item-badge.lang-badge { background: rgba(37, 99, 235, 0.3); color: #60A5FA; }
[data-theme="dark"] .overflow-item-badge.test-badge { background: rgba(234, 88, 12, 0.3); color: #FB923C; }
[data-theme="dark"] .overflow-item-badge.theme-badge { background: rgba(124, 58, 237, 0.3); color: #A78BFA; }
[data-theme="dark"] .overflow-item-badge.sound-badge.active { background: rgba(21, 128, 61, 0.3); color: #4ADE80; }
[data-theme="dark"] .overflow-item-badge.sound-badge.inactive { background: rgba(107, 114, 128, 0.3); color: #9CA3AF; }

/* ==========================================================================
   Universal Stock Status Badge & Sold Labels (docs/design.md Section 80)
   ========================================================================== */
.sold-label-prefix {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  margin-right: 2px;
}

/* Minimalist Clean Stock Text Status (docs/design.md Section 81 & Rule 36) */
.stock-badge,
.stock-simple-text {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  white-space: nowrap !important;
  line-height: 1.4 !important;
}

.stock-badge .stock-icon,
.stock-simple-text .stock-icon {
  font-size: 13.5px !important;
  line-height: 1 !important;
  display: inline-block !important;
}

/* 1. Adequate / In Stock: checkmark and text are both black / text-primary */
.stock-badge.stock-in,
.stock-badge.delivered,
.stock-simple-text.stock-in {
  background: transparent !important;
  border: none !important;
  color: var(--text-primary) !important;
}

.stock-badge.stock-in .stock-icon,
.stock-badge.delivered .stock-icon,
.stock-simple-text.stock-in .stock-icon {
  color: var(--text-primary) !important;
}

/* 2. Below Stock / Low Stock & Out of Stock: checkmark turns into red cross */
.stock-badge.stock-low,
.stock-badge.stock-out,
.stock-badge.pending,
.stock-badge.cancelled,
.stock-simple-text.stock-low,
.stock-simple-text.stock-out {
  background: transparent !important;
  border: none !important;
  color: var(--text-primary) !important;
}

.stock-badge.stock-low .stock-icon,
.stock-badge.stock-out .stock-icon,
.stock-badge .stock-cross,
.stock-simple-text.stock-low .stock-icon,
.stock-simple-text.stock-out .stock-icon,
.stock-simple-text .stock-cross {
  color: #DC2626 !important; /* Red cross icon */
}

/* Dark Mode: Text and Checkmark adapt to dark theme text color, cross remains vivid red */
[data-theme="dark"] .stock-badge,
[data-theme="dark"] .stock-simple-text {
  color: var(--text-primary) !important;
  background: transparent !important;
  border: none !important;
}

[data-theme="dark"] .stock-badge.stock-in .stock-icon,
[data-theme="dark"] .stock-simple-text.stock-in .stock-icon {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .stock-badge.stock-low .stock-icon,
[data-theme="dark"] .stock-badge.stock-out .stock-icon,
[data-theme="dark"] .stock-badge .stock-cross,
[data-theme="dark"] .stock-simple-text.stock-low .stock-icon,
[data-theme="dark"] .stock-simple-text.stock-out .stock-icon,
[data-theme="dark"] .stock-simple-text .stock-cross {
  color: #EF4444 !important;
}

/* ==========================================================================
   Universal Responsive Horizontal Scrollable Tabs Filter (All Pages)
   ========================================================================== */
@media (max-width: 992px) {
  .reports-type-tabs,
  .tabs-filter,
  .act-category-tabs-wrap,
  .backup-tabs-list {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 6px !important;
    padding: 5px 18px 5px 5px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    background: var(--surface-secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
  }

  .reports-type-tabs::-webkit-scrollbar,
  .tabs-filter::-webkit-scrollbar,
  .act-category-tabs-wrap::-webkit-scrollbar,
  .backup-tabs-list::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  .reports-type-btn,
  .tabs-filter .tab-btn,
  .backup-tab-btn {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: 12.5px !important;
    padding: 7px 13px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .reports-type-btn.active,
  .tabs-filter .tab-btn.active,
  .backup-tab-btn.active {
    background: var(--surface) !important;
    color: var(--primary) !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid var(--border) !important;
  }
}

@media (max-width: 480px) {
  .reports-type-btn,
  .tabs-filter .tab-btn,
  .backup-tab-btn {
    font-size: 12px !important;
    padding: 6px 11px !important;
    gap: 5px !important;
  }
}

/* ==========================================================================
   Admin Content Container & Views
   ========================================================================== */
.admin-content {
  padding: 28px;
  flex: 1;
}

.view-section {
  display: none;
  animation: fadeIn 0.25s ease forwards;
}

.view-section.active {
  display: block;
}

/* Zero-Flash Instant View Switcher (Matches docs/rules.md Rule 4) */
html[data-active-view="dashboard"] #view-dashboard { display: block !important; }
html[data-active-view="orders"] #view-orders { display: block !important; }
html[data-active-view="orders"] #view-dashboard { display: none !important; }

html[data-active-view="inventory"] #view-inventory { display: block !important; }
html[data-active-view="inventory"] #view-dashboard { display: none !important; }

html[data-active-view="customers"] #view-customers { display: block !important; }
html[data-active-view="customers"] #view-dashboard { display: none !important; }

html[data-active-view="settings"] #view-settings { display: block !important; }
html[data-active-view="settings"] #view-dashboard { display: none !important; }

html[data-active-view="flash-sales"] #view-flash-sales { display: block !important; }
html[data-active-view="flash-sales"] #view-dashboard { display: none !important; }

html[data-active-view="categories"] #view-categories { display: block !important; }
html[data-active-view="categories"] #view-dashboard { display: none !important; }

html[data-active-view="brands"] #view-brands { display: block !important; }
html[data-active-view="brands"] #view-dashboard { display: none !important; }

html[data-active-view="vouchers"] #view-vouchers { display: block !important; }
html[data-active-view="vouchers"] #view-dashboard { display: none !important; }

html[data-active-view="bundle-deals"] #view-bundle-deals { display: block !important; }
html[data-active-view="bundle-deals"] #view-dashboard { display: none !important; }

html[data-active-view="collections"] #view-collections { display: block !important; }
html[data-active-view="collections"] #view-dashboard { display: none !important; }

html[data-active-view="shipping-rules"] #view-shipping-rules { display: block !important; }
html[data-active-view="shipping-rules"] #view-dashboard { display: none !important; }

html[data-active-view="tax-rules"] #view-tax-rules { display: block !important; }
html[data-active-view="tax-rules"] #view-dashboard { display: none !important; }

html[data-active-view="attributes"] #view-attributes { display: block !important; }
html[data-active-view="attributes"] #view-dashboard { display: none !important; }

html[data-active-view="reports"] #view-reports { display: block !important; }
html[data-active-view="reports"] #view-dashboard { display: none !important; }

html[data-active-view="product-detail"] #view-product-detail { display: block !important; }
html[data-active-view="product-detail"] #view-dashboard { display: none !important; }

html[data-active-view="edit-product"] #view-edit-product { display: block !important; }
html[data-active-view="edit-product"] #view-dashboard { display: none !important; }

html[data-active-view="profile"] #view-profile { display: block !important; }
html[data-active-view="profile"] #view-dashboard { display: none !important; }

html[data-active-view="app-reports"] #view-app-reports { display: block !important; }
html[data-active-view="app-reports"] #view-dashboard { display: none !important; }

html[data-active-view="messages"] #view-messages { display: block !important; }
html[data-active-view="messages"] #view-dashboard { display: none !important; }

html[data-active-view="analytics"] #view-analytics { display: block !important; }
html[data-active-view="analytics"] #view-dashboard { display: none !important; }

html[data-active-view="trash"] #view-trash { display: block !important; }
html[data-active-view="trash"] #view-dashboard { display: none !important; }

html[data-active-view="roles-permissions"] #view-roles-permissions { display: block !important; }
html[data-active-view="roles-permissions"] #view-dashboard { display: none !important; }

html[data-active-view="team-members"] #view-team-members { display: block !important; }
html[data-active-view="team-members"] #view-dashboard { display: none !important; }

html[data-active-view="activity-log"] #view-activity-log { display: block !important; }
html[data-active-view="activity-log"] #view-dashboard { display: none !important; }

html[data-active-view="data-backup"] #view-data-backup { display: block !important; }
html[data-active-view="data-backup"] #view-dashboard { display: none !important; }

html[data-active-view="banners"] #view-banners { display: block !important; }
html[data-active-view="banners"] #view-dashboard { display: none !important; }

html[data-active-view="home-layout"] #view-home-layout { display: block !important; }
html[data-active-view="home-layout"] #view-dashboard { display: none !important; }

html[data-active-view="notice"] #view-notice { display: block !important; }
html[data-active-view="notice"] #view-dashboard { display: none !important; }

/* Notice Board Controls & Preview Styles */
.notice-mode-choice.active {
  border-color: var(--primary) !important;
  background: rgba(0, 136, 68, 0.08) !important;
}

[data-theme="dark"] .notice-mode-choice.active {
  background: rgba(0, 136, 68, 0.18) !important;
}

.notice-type-choice.active {
  border-color: var(--primary) !important;
  background: rgba(0, 136, 68, 0.08) !important;
}

[data-theme="dark"] .notice-type-choice.active {
  background: rgba(0, 136, 68, 0.18) !important;
}

@media (max-width: 1024px) {
  .notice-workspace-grid {
    grid-template-columns: 1fr !important;
  }
}

/* User Notice Banner in Admin Preview */
.user-notice-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-radius: var(--radius-card, 16px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--notice-theme-color, #4196FF);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.user-notice-banner.notice-info {
  --notice-theme-color: #4196FF;
  --notice-icon-bg: #EBF5FF;
  --notice-icon-color: #4196FF;
  --notice-chip-bg: #EBF5FF;
  --notice-chip-color: #2563EB;
  --notice-chip-border: rgba(65, 150, 255, 0.25);
  --notice-btn-bg: #4196FF;
  --notice-btn-hover: #2F7EE6;
  --notice-btn-shadow: rgba(65, 150, 255, 0.28);
}

.user-notice-banner.notice-success {
  --notice-theme-color: #059669;
  --notice-icon-bg: #E8F8F0;
  --notice-icon-color: #059669;
  --notice-chip-bg: #ECFDF5;
  --notice-chip-color: #047857;
  --notice-chip-border: rgba(16, 185, 129, 0.25);
  --notice-btn-bg: #059669;
  --notice-btn-hover: #047857;
  --notice-btn-shadow: rgba(5, 150, 105, 0.28);
}

.user-notice-banner.notice-warning {
  --notice-theme-color: #D97706;
  --notice-icon-bg: #FFF8E6;
  --notice-icon-color: #D97706;
  --notice-chip-bg: #FFFBEB;
  --notice-chip-color: #B45309;
  --notice-chip-border: rgba(245, 158, 11, 0.25);
  --notice-btn-bg: #D97706;
  --notice-btn-hover: #B45309;
  --notice-btn-shadow: rgba(217, 119, 6, 0.28);
}

.user-notice-banner.notice-danger {
  --notice-theme-color: #DC2626;
  --notice-icon-bg: #FEECEB;
  --notice-icon-color: #DC2626;
  --notice-chip-bg: #FEF2F2;
  --notice-chip-color: #B91C1C;
  --notice-chip-border: rgba(239, 68, 68, 0.25);
  --notice-btn-bg: #DC2626;
  --notice-btn-hover: #B91C1C;
  --notice-btn-shadow: rgba(220, 38, 38, 0.28);
}

[data-theme="dark"] .user-notice-banner.notice-info {
  --notice-theme-color: #60A5FA;
  --notice-icon-bg: rgba(65, 150, 255, 0.18);
  --notice-icon-color: #93C5FD;
  --notice-chip-bg: rgba(65, 150, 255, 0.16);
  --notice-chip-color: #93C5FD;
  --notice-chip-border: rgba(65, 150, 255, 0.3);
  --notice-btn-bg: #3B82F6;
  --notice-btn-hover: #2563EB;
}

[data-theme="dark"] .user-notice-banner.notice-success {
  --notice-theme-color: #34D399;
  --notice-icon-bg: rgba(16, 185, 129, 0.18);
  --notice-icon-color: #6EE7B7;
  --notice-chip-bg: rgba(16, 185, 129, 0.16);
  --notice-chip-color: #6EE7B7;
  --notice-chip-border: rgba(16, 185, 129, 0.3);
  --notice-btn-bg: #10B981;
  --notice-btn-hover: #059669;
}

[data-theme="dark"] .user-notice-banner.notice-warning {
  --notice-theme-color: #FBBF24;
  --notice-icon-bg: rgba(245, 158, 11, 0.18);
  --notice-icon-color: #FCD34D;
  --notice-chip-bg: rgba(245, 158, 11, 0.16);
  --notice-chip-color: #FCD34D;
  --notice-chip-border: rgba(245, 158, 11, 0.3);
  --notice-btn-bg: #F59E0B;
  --notice-btn-hover: #D97706;
}

[data-theme="dark"] .user-notice-banner.notice-danger {
  --notice-theme-color: #F87171;
  --notice-icon-bg: rgba(239, 68, 68, 0.18);
  --notice-icon-color: #FCA5A5;
  --notice-chip-bg: rgba(239, 68, 68, 0.16);
  --notice-chip-color: #FCA5A5;
  --notice-chip-border: rgba(239, 68, 68, 0.3);
  --notice-btn-bg: #EF4444;
  --notice-btn-hover: #DC2626;
}

.notice-banner-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.notice-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--notice-icon-bg);
  color: var(--notice-icon-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.notice-text-content {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.notice-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notice-badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 10px;
  border-radius: var(--radius-pill, 9999px);
  font-size: 11.5px;
  font-weight: 700;
  background: var(--notice-chip-bg);
  color: var(--notice-chip-color);
  border: 1px solid var(--notice-chip-border);
  letter-spacing: 0.15px;
  white-space: nowrap;
}

.notice-body-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
  word-break: break-word;
}

.notice-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-notice-action {
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: var(--radius-pill, 9999px);
  border: none;
  background: var(--notice-btn-bg);
  color: #FFFFFF !important;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px var(--notice-btn-shadow, rgba(0, 0, 0, 0.1));
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-notice-action:hover {
  background: var(--notice-btn-hover);
  transform: translateY(-1px);
}

.btn-notice-dismiss {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-notice-dismiss:hover {
  background: var(--surface-secondary);
  color: var(--text-primary);
  transform: rotate(90deg);
}

.user-notice-modal-icon-badge {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.user-notice-modal-icon-badge.notice-info-badge { background: #EBF5FF; color: #4196FF; }
.user-notice-modal-icon-badge.notice-success-badge { background: #E8F8F0; color: #059669; }
.user-notice-modal-icon-badge.notice-warning-badge { background: #FFF8E6; color: #D97706; }
.user-notice-modal-icon-badge.notice-danger-badge { background: #FEECEB; color: #DC2626; }
[data-theme="dark"] .user-notice-modal-icon-badge.notice-info-badge { background: rgba(65, 150, 255, 0.18); color: #93C5FD; }
[data-theme="dark"] .user-notice-modal-icon-badge.notice-success-badge { background: rgba(16, 185, 129, 0.18); color: #6EE7B7; }
[data-theme="dark"] .user-notice-modal-icon-badge.notice-warning-badge { background: rgba(245, 158, 11, 0.18); color: #FCD34D; }
[data-theme="dark"] .user-notice-modal-icon-badge.notice-danger-badge { background: rgba(239, 68, 68, 0.18); color: #FCA5A5; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.page-desc {
  display: none !important;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==========================================================================
   Stat Metric Cards (docs/design.md Section 5.2)
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--border-focus);
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-trend {
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.trend-up {
  color: #047857;
  font-weight: 700;
}

[data-theme="dark"] .trend-up {
  color: #34D399;
}

.trend-neutral {
  color: var(--text-tertiary);
}

.trend-alert {
  color: var(--danger);
}

.stat-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

/* ==========================================================================
   Admin Data Table & Filter Tabs (docs/design.md Section 5.3)
   ========================================================================== */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  margin-bottom: 28px;
  overflow: hidden;
}

.table-card .table-responsive {
  border-radius: inherit;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-card .data-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

/* Only apply top border radius to thead if the table is directly at the very top of .table-card (no header bar above) */
.table-card > .table-responsive:first-child .data-table thead tr:first-child th:first-child {
  border-top-left-radius: calc(var(--radius-card) - 1px);
}

.table-card > .table-responsive:first-child .data-table thead tr:first-child th:last-child {
  border-top-right-radius: calc(var(--radius-card) - 1px);
}

/* Tables preceded by .table-header-bar or other toolbar must NOT have top border radius (e.g. inventory, orders, customers, trash) */
.table-card .table-header-bar + .table-responsive .data-table thead tr:first-child th,
.table-card > :not(:first-child) .data-table thead tr:first-child th,
#view-inventory .data-table thead th,
#view-orders .data-table thead th,
#view-customers .data-table thead th,
#view-trash .data-table thead th {
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
}

.table-card .data-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: calc(var(--radius-card) - 1px);
}

.table-card .data-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: calc(var(--radius-card) - 1px);
}

/* Explicit corner-radius clipping safeguard for Catalog & Rules Tables */
#view-categories .table-card,
#view-brands .table-card,
#view-attributes .table-card,
#view-tax-rules .table-card,
#view-shipping-rules .table-card,
#view-collections .table-card,
#view-bundle-deals .table-card,
#view-vouchers .table-card {
  border-radius: var(--radius-card) !important;
  overflow: hidden !important;
}

#view-categories .table-card .table-responsive,
#view-brands .table-card .table-responsive,
#view-attributes .table-card .table-responsive,
#view-tax-rules .table-card .table-responsive,
#view-shipping-rules .table-card .table-responsive,
#view-collections .table-card .table-responsive,
#view-bundle-deals .table-card .table-responsive,
#view-vouchers .table-card .table-responsive {
  border-radius: inherit !important;
  overflow-x: auto;
}

#view-categories .data-table,
#view-brands .data-table,
#view-attributes .data-table,
#view-tax-rules .data-table,
#view-shipping-rules .data-table,
#view-collections .data-table,
#view-bundle-deals .data-table,
#view-vouchers .data-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  width: 100% !important;
}

.table-header-bar {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  border-top-left-radius: var(--radius-card);
  border-top-right-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.table-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   Flash Sales Management & Filter Toolbar (docs/design.md Section 5.8)
   ========================================================================== */
.flash-sales-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  margin-bottom: 16px;
}

.toolbar-left-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.toolbar-select {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-secondary);
  color: var(--text-primary);
  cursor: pointer;
}

.search-box-inline {
  display: flex;
  align-items: center;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 36px;
}

.search-box-inline input {
  border: none;
  background: transparent;
  padding: 0 14px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  min-width: 170px;
}

.search-box-inline button {
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  padding: 0 16px;
  height: 100%;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-box-inline button:hover {
  background: #2b7ee0;
}

.results-info-banner {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  font-weight: 500;
}

/* Modal Search Dropdown (docs/design.md Section 5.9) */
.fs-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  max-height: 220px;
  overflow-y: auto;
  z-index: 50;
  display: none;
}


/* ==========================================================================
   Smooth Sliding Segmented Tabs (docs/design.md Section 5.6 - AppSegmentedTab)
   ========================================================================== */
.tabs-filter {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-secondary);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  user-select: none;
}

.tab-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  z-index: 1;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  transition: color 0.22s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  border: none;
}

/* Tab Count Badge (docs/design.md Section 5.6 - AppSegmentedTab) */
.tab-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  background: rgba(90, 96, 128, 0.12);
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: all 0.22s ease;
}

.tab-btn:hover .tab-count-badge {
  color: var(--text-primary);
  background: rgba(90, 96, 128, 0.18);
}

.tab-btn.active .tab-count-badge {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(65, 150, 255, 0.35);
}

/* ==========================================================================
   Order Management Tabs Semantic Color Badges (Photo 3 & docs/design.md)
   ========================================================================== */

/* 1. All Orders (সব অর্ডার) */
.tab-count-badge.tab-count-all.has-items,
.tab-btn[data-filter="all"] .tab-count-badge.has-items {
  background: rgba(37, 99, 235, 0.12);
  color: #1D4ED8;
  border-color: rgba(37, 99, 235, 0.28);
}
.tab-btn.active .tab-count-badge.tab-count-all,
.tab-btn.active[data-filter="all"] .tab-count-badge {
  background: #2563EB;
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.4);
}

/* 2. Pending (অপেক্ষমাণ - Amber) */
.tab-count-badge.tab-count-pending.has-items,
.tab-btn[data-filter="pending"] .tab-count-badge.has-items {
  background: #FEF3C7;
  color: #B45309;
  border-color: rgba(245, 158, 11, 0.35);
}
.tab-btn.active .tab-count-badge.tab-count-pending,
.tab-btn.active[data-filter="pending"] .tab-count-badge {
  background: #D97706;
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 1px 4px rgba(217, 119, 6, 0.4);
}

/* 3. Processing (প্রক্রিয়াধীন - Blue / Cyan) */
.tab-count-badge.tab-count-processing.has-items,
.tab-btn[data-filter="processing"] .tab-count-badge.has-items {
  background: #E0F2FE;
  color: #0369A1;
  border-color: rgba(2, 132, 199, 0.35);
}
.tab-btn.active .tab-count-badge.tab-count-processing,
.tab-btn.active[data-filter="processing"] .tab-count-badge {
  background: #0284C7;
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.4);
}

/* 4. Shipped (ডেলিভারিতে - Purple) */
.tab-count-badge.tab-count-shipped.has-items,
.tab-btn[data-filter="shipped"] .tab-count-badge.has-items {
  background: #EDE9FE;
  color: #6D28D9;
  border-color: rgba(124, 58, 237, 0.35);
}
.tab-btn.active .tab-count-badge.tab-count-shipped,
.tab-btn.active[data-filter="shipped"] .tab-count-badge {
  background: #7C3AED;
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 1px 4px rgba(124, 58, 237, 0.4);
}

/* 5. Delivered (পৌঁছে গেছে - Emerald Green) */
.tab-count-badge.tab-count-delivered.has-items,
.tab-btn[data-filter="delivered"] .tab-count-badge.has-items {
  background: #D1FAE5;
  color: #047857;
  border-color: rgba(16, 185, 129, 0.35);
}
.tab-btn.active .tab-count-badge.tab-count-delivered,
.tab-btn.active[data-filter="delivered"] .tab-count-badge {
  background: #059669;
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 1px 4px rgba(5, 150, 105, 0.4);
}

/* 6. Cancelled (বাতিল - Rose Red) */
.tab-count-badge.tab-count-cancelled.has-items,
.tab-btn[data-filter="cancelled"] .tab-count-badge.has-items {
  background: #FEE2E2;
  color: #B91C1C;
  border-color: rgba(220, 38, 38, 0.35);
}
.tab-btn.active .tab-count-badge.tab-count-cancelled,
.tab-btn.active[data-filter="cancelled"] .tab-count-badge {
  background: #DC2626;
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 1px 4px rgba(220, 38, 38, 0.4);
}

/* Dark Theme Support for Semantic Status Badges */
[data-theme="dark"] .tab-count-badge {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

[data-theme="dark"] .tab-btn:hover .tab-count-badge {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

[data-theme="dark"] .tab-count-badge.tab-count-all.has-items,
[data-theme="dark"] .tab-btn[data-filter="all"] .tab-count-badge.has-items {
  background: rgba(37, 99, 235, 0.22);
  color: #60A5FA;
  border-color: rgba(59, 130, 246, 0.4);
}

[data-theme="dark"] .tab-count-badge.tab-count-pending.has-items,
[data-theme="dark"] .tab-btn[data-filter="pending"] .tab-count-badge.has-items {
  background: rgba(245, 158, 11, 0.22);
  color: #FCD34D;
  border-color: rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .tab-count-badge.tab-count-processing.has-items,
[data-theme="dark"] .tab-btn[data-filter="processing"] .tab-count-badge.has-items {
  background: rgba(2, 132, 199, 0.22);
  color: #38BDF8;
  border-color: rgba(56, 189, 248, 0.4);
}

[data-theme="dark"] .tab-count-badge.tab-count-shipped.has-items,
[data-theme="dark"] .tab-btn[data-filter="shipped"] .tab-count-badge.has-items {
  background: rgba(124, 58, 237, 0.22);
  color: #A78BFA;
  border-color: rgba(167, 139, 250, 0.4);
}

[data-theme="dark"] .tab-count-badge.tab-count-delivered.has-items,
[data-theme="dark"] .tab-btn[data-filter="delivered"] .tab-count-badge.has-items {
  background: rgba(16, 185, 129, 0.22);
  color: #34D399;
  border-color: rgba(52, 211, 153, 0.4);
}

[data-theme="dark"] .tab-count-badge.tab-count-cancelled.has-items,
[data-theme="dark"] .tab-btn[data-filter="cancelled"] .tab-count-badge.has-items {
  background: rgba(220, 38, 38, 0.22);
  color: #F87171;
  border-color: rgba(248, 113, 113, 0.4);
}

[data-theme="dark"] .tab-btn.active[data-filter="all"] .tab-count-badge { background: #2563EB; color: #FFFFFF; }
[data-theme="dark"] .tab-btn.active[data-filter="pending"] .tab-count-badge { background: #F59E0B; color: #1A1A2E; }
[data-theme="dark"] .tab-btn.active[data-filter="processing"] .tab-count-badge { background: #0284C7; color: #FFFFFF; }
[data-theme="dark"] .tab-btn.active[data-filter="shipped"] .tab-count-badge { background: #8B5CF6; color: #FFFFFF; }
[data-theme="dark"] .tab-btn.active[data-filter="delivered"] .tab-count-badge { background: #10B981; color: #FFFFFF; }
[data-theme="dark"] .tab-btn.active[data-filter="cancelled"] .tab-count-badge { background: #EF4444; color: #FFFFFF; }


.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100% !important;
  min-width: 100%;
  border-collapse: collapse;
  text-align: left;
}

#allOrdersTable {
  min-width: 880px;
}

.data-table thead th {
  position: relative;
  background: var(--surface-secondary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  box-sizing: border-box;
}

/* Draggable Column Resizer */
.col-resizer {
  position: absolute;
  top: 0;
  right: -2px;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.col-resizer::after {
  content: '';
  width: 2px;
  height: 40%;
  background: var(--border);
  border-radius: 2px;
  opacity: 0.7;
  transition: all 0.2s ease;
}

.data-table thead th:hover .col-resizer::after {
  height: 70%;
  opacity: 1;
  background: var(--text-tertiary);
}

.col-resizer:hover::after,
.col-resizer.is-resizing::after {
  background: var(--primary) !important;
  width: 3px !important;
  height: 100% !important;
  opacity: 1 !important;
  box-shadow: 0 0 6px rgba(65, 150, 255, 0.6);
}

body.table-col-resizing {
  cursor: col-resize !important;
  user-select: none !important;
}

body.table-col-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background-color: var(--bg);
}

.data-table tbody td {
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-primary);
  vertical-align: middle;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ==========================================================================
   Order Status Badges (docs/design.md Section 5.3)
   ========================================================================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-pending {
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.badge-processing {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.badge-shipped {
  background: #F5F3FF;
  color: #6D28D9;
  border: 1px solid #DDD6FE;
}

.badge-delivered {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.badge-cancelled {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

/* ==========================================================================
   Interactive Toggleable Status Badges (User Request 3: Active/Inactive ON-OFF)
   ========================================================================== */
.status-badge.badge-toggleable {
  cursor: pointer;
  border: 1px solid;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  outline: none;
}

.status-badge.badge-toggleable:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.status-badge.badge-toggleable:active {
  transform: scale(0.96);
}

.status-badge.badge-toggleable.badge-active {
  background: #ECFDF5;
  color: #047857;
  border-color: #A7F3D0;
}

.status-badge.badge-toggleable.badge-active:hover {
  background: #DCFCE7;
  border-color: #86EFAC;
}

.status-badge.badge-toggleable.badge-inactive {
  background: #F1F5F9;
  color: #64748B;
  border-color: #CBD5E1;
}

.status-badge.badge-toggleable.badge-inactive:hover {
  background: #E2E8F0;
  border-color: #94A3B8;
  color: #334155;
}

[data-theme="dark"] .status-badge.badge-toggleable.badge-active {
  background: rgba(16, 185, 129, 0.16);
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.35);
}

[data-theme="dark"] .status-badge.badge-toggleable.badge-active:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.5);
}

[data-theme="dark"] .status-badge.badge-toggleable.badge-inactive {
  background: rgba(148, 163, 184, 0.12);
  color: #94A3B8;
  border-color: rgba(148, 163, 184, 0.25);
}

[data-theme="dark"] .status-badge.badge-toggleable.badge-inactive:hover {
  background: rgba(148, 163, 184, 0.2);
  border-color: rgba(148, 163, 184, 0.4);
}

/* ==========================================================================
   Order Status Dropdown Pill (Icon + Status Badge + Native Select Overlay)
   - Visual: Exactly matches Dashboard Badge with FontAwesome icon
   - Interactive: Clickable dropdown overlay to seamlessly update status
   - Single Source of Truth: Driven by ORDER_STATUS_CONFIG (docs/design.md Section 21)
   ========================================================================== */
.order-status-dropdown-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  cursor: pointer;
}

.order-status-dropdown-pill .status-badge {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.order-status-dropdown-pill:hover .status-badge {
  filter: brightness(0.96);
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.order-status-dropdown-pill .status-chevron {
  font-size: 9px;
  margin-left: 2px;
  opacity: 0.7;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.order-status-dropdown-pill:hover .status-chevron {
  opacity: 1;
  transform: translateY(1px);
}

.order-status-hidden-select {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  font-size: 13px;
  border: none;
  background: transparent;
}

.order-status-hidden-select option {
  background-color: #FFFFFF;
  color: #1A1A2E;
  font-weight: 600;
  padding: 8px 12px;
}

.order-status-hidden-select option.opt-status-pending,
.order-status-hidden-select option[value="pending"] {
  background-color: #FFFBEB;
  color: #B45309;
}

.order-status-hidden-select option.opt-status-processing,
.order-status-hidden-select option[value="processing"] {
  background-color: #EFF6FF;
  color: #1D4ED8;
}

.order-status-hidden-select option.opt-status-shipped,
.order-status-hidden-select option[value="shipped"] {
  background-color: #F5F3FF;
  color: #6D28D9;
}

.order-status-hidden-select option.opt-status-delivered,
.order-status-hidden-select option[value="delivered"] {
  background-color: #ECFDF5;
  color: #047857;
}

.order-status-hidden-select option.opt-status-cancelled,
.order-status-hidden-select option[value="cancelled"] {
  background-color: #FEF2F2;
  color: #B91C1C;
}

[data-theme="dark"] .order-status-hidden-select option {
  background-color: #1E2433;
  color: #FFFFFF;
}

[data-theme="dark"] .order-status-hidden-select option.opt-status-pending,
[data-theme="dark"] .order-status-hidden-select option[value="pending"] {
  background-color: #272115;
  color: #FCD34D;
}

[data-theme="dark"] .order-status-hidden-select option.opt-status-processing,
[data-theme="dark"] .order-status-hidden-select option[value="processing"] {
  background-color: #172338;
  color: #93C5FD;
}

[data-theme="dark"] .order-status-hidden-select option.opt-status-shipped,
[data-theme="dark"] .order-status-hidden-select option[value="shipped"] {
  background-color: #211B38;
  color: #C4B5FD;
}

[data-theme="dark"] .order-status-hidden-select option.opt-status-delivered,
[data-theme="dark"] .order-status-hidden-select option[value="delivered"] {
  background-color: #132B23;
  color: #6EE7B7;
}

[data-theme="dark"] .order-status-hidden-select option.opt-status-cancelled,
[data-theme="dark"] .order-status-hidden-select option[value="cancelled"] {
  background-color: #331A1C;
  color: #FCA5A5;
}

/* ==========================================================================
   Order Status Select Dropdown (5 Distinct Colors - docs/design.md Section 20)
   - Closed state: Premium pill badge appearance with matching colored chevron
   - Open state: Semantic color coding per status option with bullet indicator
   ========================================================================== */
.order-status-select {
  display: inline-flex;
  align-items: center;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 5px 24px 5px 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  background-repeat: no-repeat;
  background-position: right 7px center;
  background-size: 11px 11px;
  width: auto;
  min-width: 124px;
  max-width: 140px;
  text-overflow: ellipsis;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.order-status-select:hover {
  filter: brightness(0.97);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.order-status-select:focus {
  box-shadow: 0 0 0 2px rgba(65, 150, 255, 0.25);
}

/* 1. অপেক্ষমাণ (Pending) - Amber */
.order-status-select.status-pending,
.order-status-select[data-status="pending"] {
  background-color: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23B45309'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

/* 2. প্রক্রিয়াধীন (Processing) - Blue */
.order-status-select.status-processing,
.order-status-select[data-status="processing"] {
  background-color: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%231D4ED8'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

/* 3. ডেলিভারিতে (Shipped) - Purple */
.order-status-select.status-shipped,
.order-status-select[data-status="shipped"] {
  background-color: #F5F3FF;
  color: #6D28D9;
  border: 1px solid #DDD6FE;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236D28D9'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

/* 4. পৌঁছে গেছে (Delivered) - Emerald Green */
.order-status-select.status-delivered,
.order-status-select[data-status="delivered"] {
  background-color: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23047857'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

/* 5. বাতিল (Cancelled) - Rose Red */
.order-status-select.status-cancelled,
.order-status-select[data-status="cancelled"] {
  background-color: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23B91C1C'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

/* Dropdown Menu Options Styling (When Expanded) */
.order-status-select option {
  background-color: #FFFFFF;
  color: #1A1A2E;
  font-weight: 600;
  padding: 8px 12px;
}

.order-status-select option.opt-status-pending,
.order-status-select option[value="pending"] {
  background-color: #FFFBEB;
  color: #B45309;
}

.order-status-select option.opt-status-processing,
.order-status-select option[value="processing"] {
  background-color: #EFF6FF;
  color: #1D4ED8;
}

.order-status-select option.opt-status-shipped,
.order-status-select option[value="shipped"] {
  background-color: #F5F3FF;
  color: #6D28D9;
}

.order-status-select option.opt-status-delivered,
.order-status-select option[value="delivered"] {
  background-color: #ECFDF5;
  color: #047857;
}

.order-status-select option.opt-status-cancelled,
.order-status-select option[value="cancelled"] {
  background-color: #FEF2F2;
  color: #B91C1C;
}

/* Dark Theme Overrides */
[data-theme="dark"] .badge-pending,
[data-theme="dark"] .order-status-select.status-pending,
[data-theme="dark"] .order-status-select[data-status="pending"] {
  background-color: rgba(245, 158, 11, 0.18);
  color: #FCD34D;
  border-color: rgba(245, 158, 11, 0.4);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23FCD34D'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

[data-theme="dark"] .badge-processing,
[data-theme="dark"] .order-status-select.status-processing,
[data-theme="dark"] .order-status-select[data-status="processing"] {
  background-color: rgba(59, 130, 246, 0.18);
  color: #93C5FD;
  border-color: rgba(59, 130, 246, 0.4);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2393C5FD'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

[data-theme="dark"] .badge-shipped,
[data-theme="dark"] .order-status-select.status-shipped,
[data-theme="dark"] .order-status-select[data-status="shipped"] {
  background-color: rgba(139, 92, 246, 0.18);
  color: #C4B5FD;
  border-color: rgba(139, 92, 246, 0.4);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23C4B5FD'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

[data-theme="dark"] .badge-delivered,
[data-theme="dark"] .order-status-select.status-delivered,
[data-theme="dark"] .order-status-select[data-status="delivered"] {
  background-color: rgba(16, 185, 129, 0.18);
  color: #6EE7B7;
  border-color: rgba(16, 185, 129, 0.4);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236EE7B7'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

[data-theme="dark"] .badge-cancelled,
[data-theme="dark"] .order-status-select.status-cancelled,
[data-theme="dark"] .order-status-select[data-status="cancelled"] {
  background-color: rgba(239, 68, 68, 0.18);
  color: #FCA5A5;
  border-color: rgba(239, 68, 68, 0.4);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23FCA5A5'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

[data-theme="dark"] .order-status-select option {
  background-color: #1E2433;
  color: #FFFFFF;
}

[data-theme="dark"] .order-status-select option.opt-status-pending,
[data-theme="dark"] .order-status-select option[value="pending"] {
  background-color: #272115;
  color: #FCD34D;
}

[data-theme="dark"] .order-status-select option.opt-status-processing,
[data-theme="dark"] .order-status-select option[value="processing"] {
  background-color: #172338;
  color: #93C5FD;
}

[data-theme="dark"] .order-status-select option.opt-status-shipped,
[data-theme="dark"] .order-status-select option[value="shipped"] {
  background-color: #211B38;
  color: #C4B5FD;
}

[data-theme="dark"] .order-status-select option.opt-status-delivered,
[data-theme="dark"] .order-status-select option[value="delivered"] {
  background-color: #132B23;
  color: #6EE7B7;
}

[data-theme="dark"] .order-status-select option.opt-status-cancelled,
[data-theme="dark"] .order-status-select option[value="cancelled"] {
  background-color: #331A1C;
  color: #FCA5A5;
}

/* Margin & Profit Badges (High Contrast) */
.margin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.margin-badge.profit {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.margin-badge.loss {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

[data-theme="dark"] .margin-badge.profit {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .margin-badge.loss {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border-color: rgba(239, 68, 68, 0.3);
}

/* ==========================================================================
   Flash Sales Status Badges (Smart, Fresh & Vibrant)
   ========================================================================== */
.fs-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1;
  white-space: nowrap;
  transition: all 0.18s ease;
  user-select: none;
}

/* Public / Live - Fresh Emerald with Pulsing Live Dot */
.fs-status-public {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.08);
}

.fs-status-public:hover {
  background: #D1FAE5;
  border-color: #6EE7B7;
  transform: translateY(-1px);
}

.fs-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10B981;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: livePulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes livePulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Scheduled - Warm Amber with Clock Icon */
.fs-status-scheduled {
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
  box-shadow: 0 1px 2px rgba(245, 158, 11, 0.08);
}

.fs-status-scheduled:hover {
  background: #FEF3C7;
  border-color: #FCD34D;
  transform: translateY(-1px);
}

.fs-status-scheduled i {
  color: #D97706;
  font-size: 11px;
}

/* Expired - Soft Clean Slate with Muted History Icon */
.fs-status-expired {
  background: #F8FAFC;
  color: #64748B;
  border: 1px solid #CBD5E1;
  box-shadow: 0 1px 2px rgba(100, 116, 139, 0.05);
}

.fs-status-expired:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
  transform: translateY(-1px);
}

.fs-status-expired i {
  color: #94A3B8;
  font-size: 11px;
}

/* Dark Mode Overrides for Flash Sales Status Badges */
[data-theme="dark"] .fs-status-public {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.35);
}

[data-theme="dark"] .fs-status-scheduled {
  background: rgba(245, 158, 11, 0.15);
  color: #FCD34D;
  border-color: rgba(245, 158, 11, 0.35);
}

[data-theme="dark"] .fs-status-expired {
  background: rgba(255, 255, 255, 0.05);
  color: #94A3B8;
  border-color: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   Payment Method Badges & Payment Status Chips (Modern Fresh Design)
   ========================================================================== */
.pay-cell-wrap {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.pay-badges-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pay-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
}

.pay-chip.pay-chip-logo-only {
  padding: 0 10px;
  height: 28px;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.pay-method-logo {
  height: 19px;
  width: auto;
  max-width: 68px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

/* COD (Cash on Delivery) - Fresh Slate & Emerald Currency Accent */
.pay-chip-cod,
.pay-method-pill.cod {
  background: #F8FAFC;
  color: #1E293B;
  border: 1px solid #CBD5E1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.pay-chip-cod i,
.pay-method-pill.cod i {
  color: #10B981;
  font-size: 13px;
}

/* bKash */
.pay-chip-bkash,
.pay-method-pill.bkash {
  background: #FDF2F8;
  color: #9D174D;
  border: 1px solid #FBCFE8;
}

.pay-chip-bkash i,
.pay-method-pill.bkash i {
  color: #DB2777;
  font-size: 13px;
}

/* Nagad */
.pay-chip-nagad,
.pay-method-pill.nagad {
  background: #FFF7ED;
  color: #9A3412;
  border: 1px solid #FED7AA;
}

.pay-chip-nagad i,
.pay-method-pill.nagad i {
  color: #EA580C;
  font-size: 13px;
}

/* Rocket */
.pay-chip-rocket,
.pay-method-pill.rocket {
  background: #FAF5FF;
  color: #6B21A8;
  border: 1px solid #E9D5FF;
}

.pay-chip-rocket i,
.pay-method-pill.rocket i {
  color: #9333EA;
  font-size: 13px;
}

/* Card */
.pay-chip-card,
.pay-method-pill.card {
  background: #EEF2FF;
  color: #3730A3;
  border: 1px solid #C7D2FE;
}

.pay-chip-card i,
.pay-method-pill.card i {
  color: #4F46E5;
  font-size: 13px;
}

/* Payment Status: Unpaid / Due (বকেয়া) - Fresh Soft Coral-Amber */
.pay-status-unpaid {
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
  cursor: pointer;
}

.pay-status-unpaid:hover {
  background: #FEF3C7;
  border-color: #FCD34D;
  transform: translateY(-1px);
}

.pay-status-unpaid i {
  color: #D97706;
  font-size: 11px;
}

/* Payment Status: Paid (পরিশোধিত) - Fresh Forest Emerald */
.pay-status-paid {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
  cursor: pointer;
}

.pay-status-paid:hover {
  background: #D1FAE5;
  border-color: #6EE7B7;
  transform: translateY(-1px);
}

.pay-status-paid i {
  color: #10B981;
  font-size: 11px;
}

/* TrxID Row & Horizontal Anti-Collapse Protection */
.pay-trx-row {
  display: inline-flex;
  align-items: center;
  gap: 4px 6px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 0;
  flex-wrap: wrap;
}

.pay-trx-id-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.pay-trx-id-wrap span {
  white-space: nowrap;
  flex-shrink: 0;
}

.pay-trx-row code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  user-select: all;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-block;
}

/* Dark Mode Overrides */
[data-theme="dark"] .pay-chip-cod,
[data-theme="dark"] .pay-method-pill.cod {
  background: rgba(30, 41, 59, 0.7);
  color: #F1F5F9;
  border-color: rgba(148, 163, 184, 0.25);
}

[data-theme="dark"] .pay-chip-cod i,
[data-theme="dark"] .pay-method-pill.cod i {
  color: #34D399;
}

[data-theme="dark"] .pay-chip-bkash,
[data-theme="dark"] .pay-method-pill.bkash {
  background: rgba(219, 39, 119, 0.15);
  color: #F472B6;
  border-color: rgba(219, 39, 119, 0.3);
}

[data-theme="dark"] .pay-chip-nagad,
[data-theme="dark"] .pay-method-pill.nagad {
  background: rgba(234, 88, 12, 0.15);
  color: #FB923C;
  border-color: rgba(234, 88, 12, 0.3);
}

[data-theme="dark"] .pay-chip-rocket,
[data-theme="dark"] .pay-method-pill.rocket {
  background: rgba(147, 51, 234, 0.15);
  color: #C084FC;
  border-color: rgba(147, 51, 234, 0.3);
}

[data-theme="dark"] .pay-chip.pay-chip-logo-only {
  background: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .pay-chip-card,
[data-theme="dark"] .pay-method-pill.card {
  background: rgba(79, 70, 229, 0.15);
  color: #818CF8;
  border-color: rgba(79, 70, 229, 0.3);
}

[data-theme="dark"] .pay-status-unpaid {
  background: rgba(217, 119, 6, 0.15);
  color: #FBBF24;
  border-color: rgba(217, 119, 6, 0.3);
}

[data-theme="dark"] .pay-status-paid {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .pay-trx-row code {
  background: rgba(255, 255, 255, 0.06);
  color: #F1F5F9;
  border-color: rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
   Collect Payment & Paid Confirmation Modal Styles
   ========================================================================== */
.collect-pay-summary {
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.collect-pay-summary-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.collect-pay-order-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.collect-pay-order-id {
  font-weight: 800;
  font-size: 15px;
  color: var(--primary);
  letter-spacing: 0.5px;
}

.collect-pay-cust {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.collect-pay-amount-box {
  text-align: right;
}

.collect-pay-amount-label {
  font-size: 11px;
  color: var(--text-secondary);
  display: block;
}

.collect-pay-amount-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.collect-pay-methods-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.collect-pay-card {
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  gap: 12px;
}

.collect-pay-card:hover {
  border-color: var(--primary);
  background: var(--surface-secondary);
  transform: translateY(-1px);
}

.collect-pay-card.active,
.collect-pay-card:has(input[type="radio"]:checked) {
  border-color: var(--primary);
  background: rgba(65, 150, 255, 0.06);
  box-shadow: 0 0 0 1px var(--primary);
}

.collect-pay-card input[type="radio"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
  margin: 0;
}

.collect-pay-card-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.collect-pay-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.collect-pay-icon.cod-icon {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
}

.collect-pay-icon.card-icon {
  background: #EFF6FF;
  color: #2563EB;
  border: 1px solid #BFDBFE;
}

.collect-pay-logo-wrap {
  width: 80px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.collect-pay-logo-wrap.bkash-wrap {
  background: #FDF2F8;
  border: 1px solid #FBCFE8;
}

.collect-pay-logo-wrap.nagad-wrap {
  background: #FFF7ED;
  border: 1px solid #FFEDD5;
}

.collect-pay-logo-wrap.rocket-wrap {
  background: #FAF5FF;
  border: 1px solid #F3E8FF;
}

.collect-pay-logo-wrap img {
  height: 20px;
  width: auto;
  max-width: 68px;
  object-fit: contain;
  display: block;
}

.collect-pay-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.collect-pay-text .pay-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.collect-pay-text .pay-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.collect-pay-notice {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.collect-pay-notice.cod-notice {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.collect-pay-trx-wrap {
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.collect-pay-fields-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.collect-pay-field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.collect-pay-field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.collect-pay-field-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.collect-pay-input-wrap {
  position: relative;
  width: 100%;
}

.collect-pay-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 13px;
  pointer-events: none;
}

.collect-pay-input {
  width: 100% !important;
  box-sizing: border-box !important;
  height: 40px !important;
  padding: 0 14px 0 36px !important;
  border-radius: 8px !important;
  border: 1.5px solid var(--border) !important;
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  font-size: 13.5px !important;
  font-family: inherit !important;
  transition: all 0.2s ease !important;
  outline: none !important;
  display: block !important;
}

.collect-pay-input:hover {
  border-color: var(--primary) !important;
}

.collect-pay-input:focus {
  background: var(--surface) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(65, 150, 255, 0.16) !important;
}

.collect-pay-trx-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: 0.8px !important;
  text-transform: uppercase !important;
}

.collect-pay-field-error {
  color: var(--danger);
  font-size: 11.5px;
  font-weight: 600;
  margin-top: 2px;
  display: none;
  align-items: center;
  gap: 5px;
}

.btn-fill-cust-phone {
  background: rgba(65, 150, 255, 0.08);
  border: 1px solid rgba(65, 150, 255, 0.28);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  padding: 2.5px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-fill-cust-phone:hover {
  background: var(--primary);
  color: #FFFFFF;
}

.btn-gen-test-trx {
  background: transparent;
  border: 1px dashed var(--primary);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  padding: 2.5px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-gen-test-trx:hover {
  background: var(--primary);
  color: #FFFFFF;
}

.pay-acc-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  line-height: 1.3;
}

.pay-acc-tag i {
  font-size: 10px;
  color: #6B7280;
}

.pay-acc-tag .smart-phone-outline-icon {
  display: inline-block;
  vertical-align: -1.5px;
  stroke: #6B7280;
  color: #6B7280;
  flex-shrink: 0;
}

[data-theme="dark"] .pay-acc-tag i {
  color: #94A3B8;
}

[data-theme="dark"] .pay-acc-tag .smart-phone-outline-icon {
  stroke: #94A3B8;
  color: #94A3B8;
}

/* Dark Mode Overrides for Payment Collection Modal */
[data-theme="dark"] .collect-pay-card {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .collect-pay-card:hover {
  background: var(--surface-secondary);
  border-color: var(--primary);
}

[data-theme="dark"] .collect-pay-card.active,
[data-theme="dark"] .collect-pay-card:has(input[type="radio"]:checked) {
  background: rgba(65, 150, 255, 0.12);
  border-color: var(--primary);
}

[data-theme="dark"] .collect-pay-logo-wrap {
  background: #FFFFFF !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .collect-pay-notice.cod-notice {
  background: rgba(6, 95, 70, 0.2);
  color: #6EE7B7;
  border-color: rgba(110, 231, 183, 0.3);
}

[data-theme="dark"] .collect-pay-input {
  background: #161A24 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #FFFFFF !important;
}

[data-theme="dark"] .collect-pay-input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(65, 150, 255, 0.25) !important;
}

[data-theme="dark"] .pay-acc-tag {
  background: rgba(255, 255, 255, 0.06);
  color: #E2E8F0;
  border-color: rgba(255, 255, 255, 0.12);
}

/* Action Buttons inside Table */
.action-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-action {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 1px solid var(--border);
  background: var(--surface-secondary);
  color: var(--text-secondary);
  transition: var(--transition);
}

.btn-action:hover {
  background: var(--primary-light);
}

.btn-action.edit,
.btn-action.primary {
  background: var(--primary-light);
  color: var(--primary);
  border-color: rgba(65, 150, 255, 0.25);
}

.btn-action.edit:hover,
.btn-action.primary:hover {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  transform: scale(1.05);
}

.btn-action.danger {
  background: var(--danger-light);
  color: var(--danger);
  border-color: rgba(255, 71, 87, 0.25);
}

.btn-action.danger:hover {
  background: var(--danger);
  color: #FFFFFF;
  border-color: var(--danger);
  transform: scale(1.05);
}

/* ==========================================================================
   Smart Action Buttons (Edit & Delete for Tables)
   ========================================================================== */
.smart-actions-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-smart-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

/* Edit: Fresh Blue Pastel to Solid on Hover */
.btn-smart-action.edit {
  background: #EFF6FF;
  color: #2563EB;
  border-color: #BFDBFE;
}

.btn-smart-action.edit:hover {
  background: #2563EB;
  color: #FFFFFF;
  border-color: #2563EB;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.28);
  transform: translateY(-1px);
}

.btn-smart-action.edit i {
  font-size: 11px;
  transition: transform 0.18s ease;
}

.btn-smart-action.edit:hover i {
  transform: scale(1.1);
}

/* Delete: Soft Coral/Rose to Solid Danger on Hover */
.btn-smart-action.delete {
  background: #FEF2F2;
  color: #DC2626;
  border-color: #FECACA;
}

.btn-smart-action.delete:hover {
  background: #DC2626;
  color: #FFFFFF;
  border-color: #DC2626;
  box-shadow: 0 3px 8px rgba(220, 38, 38, 0.28);
  transform: translateY(-1px);
}

.btn-smart-action.delete i {
  font-size: 11px;
  transition: transform 0.18s ease;
}

.btn-smart-action.delete:hover i {
  transform: scale(1.1);
}

/* Dark Mode Overrides for Smart Action Buttons */
[data-theme="dark"] .btn-smart-action.edit {
  background: rgba(59, 130, 246, 0.14);
  color: #60A5FA;
  border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .btn-smart-action.edit:hover {
  background: #3B82F6;
  color: #FFFFFF;
  border-color: #3B82F6;
}

[data-theme="dark"] .btn-smart-action.delete {
  background: rgba(239, 68, 68, 0.14);
  color: #F87171;
  border-color: rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .btn-smart-action.delete:hover {
  background: #EF4444;
  color: #FFFFFF;
  border-color: #EF4444;
}

/* Language Toggle Button in Topbar (docs/design.md Section 5.10) */
.lang-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-secondary);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.lang-toggle-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.lang-badge {
  background: var(--primary);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   Standard Buttons (docs/design.md Section 5 - AppButton)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface-secondary);
  color: var(--primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--primary-light);
}

.btn-outline {
  background: transparent;
  border: 1.4px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
}

.btn-cancel {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(255, 71, 87, 0.2);
}

.btn-cancel:hover {
  background: var(--danger);
  color: #FFFFFF;
}

/* ==========================================================================
   Toggle Switch (docs/design.md Section 5.4 - AppSwitch)
   ========================================================================== */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: var(--transition);
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #FFFFFF;
  transition: var(--transition);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

input:checked + .slider {
  background-color: var(--success);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* ==========================================================================
   Modal Dialogs (docs/design.md Section 5 - AppConfirmDialog)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-modal);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: var(--transition);
}

.modal-card > form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-overlay.open .modal-card {
  transform: none;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

/* Global Modal Close Button Component (Utsaho Flat Design) */
.modal-close-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-secondary, #F1F5F9);
  border: 1px solid var(--border, #E2E8F0);
  color: var(--text-secondary, #64748B);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin: 0;
  outline: none;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.modal-close-btn:hover {
  background: #FEE2E2;
  border-color: #FCA5A5;
  color: #DC2626;
  transform: rotate(90deg) scale(1.08);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.18);
}

.modal-close-btn:active {
  transform: rotate(90deg) scale(0.95);
}

.modal-close-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

[data-theme="dark"] .modal-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #94A3B8;
}

[data-theme="dark"] .modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.45);
  color: #F87171;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.25);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
}

.modal-body .form-group {
  min-width: 0;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
  background: var(--surface);
}

/* Form Groups inside Modal */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1.2px solid #E2E8F0;
  background: #FAFAFA;
  color: var(--text-primary);
  font-size: 14px;
  transition: var(--transition);
}

.form-input:hover, .form-select:hover, .form-textarea:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  background: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(65, 150, 255, 0.14);
  outline: none;
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea {
  background: #1E2433;
  border-color: #2A3045;
  color: #FFFFFF;
}

[data-theme="dark"] .form-input:hover,
[data-theme="dark"] .form-select:hover,
[data-theme="dark"] .form-textarea:hover {
  background: #232A3B;
  border-color: #3B4461;
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] .form-textarea:focus {
  background: #161A24;
  border-color: var(--primary);
}

/* Custom Order Section Cards */
.cust-order-section-card {
  background: #FDFDFD;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 18px;
}

[data-theme="dark"] .cust-order-section-card {
  background: #161A24 !important;
  border-color: #2A3045 !important;
}

/* Autocomplete Suggestions Dropdown */
.cust-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.14);
  max-height: 220px;
  overflow-y: auto;
  z-index: 1080;
  padding: 4px;
}

.cust-suggest-item {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px dashed var(--border);
}

.cust-suggest-item:last-child {
  border-bottom: none;
}

.cust-suggest-item:hover {
  background: var(--primary-light);
}

/* Searchable Product Picker Menu & Item Row Box Uniformity */
.cust-order-item-row {
  display: grid;
  grid-template-columns: 2.2fr 1.3fr 1.1fr 1.0fr 75px 42px;
  gap: 10px;
  align-items: center !important;
  background: var(--surface);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  position: relative;
  box-sizing: border-box;
  width: 100%;
}

.cust-order-item-row .cust-prod-picker-btn,
.cust-order-item-row .cust-order-unit,
.cust-order-item-row .cust-order-price,
.cust-order-item-row .cust-order-qty {
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  box-sizing: border-box !important;
  font-size: 13px !important;
  border-radius: var(--radius-sm) !important;
  border: 1.2px solid #E2E8F0 !important;
  background: #FAFAFA !important;
  color: var(--text-primary) !important;
  transition: var(--transition);
}

.cust-order-item-row .cust-order-unit:focus,
.cust-order-item-row .cust-order-price:focus,
.cust-order-item-row .cust-order-qty:focus {
  background: #FFFFFF !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(65, 150, 255, 0.15) !important;
  outline: none;
}

.cust-prod-picker-btn:hover {
  background: #F8FAFC !important;
  border-color: var(--primary) !important;
}

[data-theme="dark"] .cust-order-item-row .cust-prod-picker-btn,
[data-theme="dark"] .cust-order-item-row .cust-order-unit,
[data-theme="dark"] .cust-order-item-row .cust-order-price,
[data-theme="dark"] .cust-order-item-row .cust-order-qty {
  background: #1E2433 !important;
  border-color: #2A3045 !important;
  color: #FFFFFF !important;
}

[data-theme="dark"] .cust-order-item-row .cust-order-unit:focus,
[data-theme="dark"] .cust-order-item-row .cust-order-price:focus,
[data-theme="dark"] .cust-order-item-row .cust-order-qty:focus {
  background: #161A24 !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(65, 150, 255, 0.25) !important;
}

[data-theme="dark"] .cust-prod-picker-btn:hover {
  background: #232A3B !important;
  border-color: var(--primary) !important;
}

/* High-Contrast Clear Brand/Company Tag */
.cust-prod-brand-tag {
  background: #F1F5F9 !important;
  color: #0F172A !important;
  border: 1px solid #CBD5E1 !important;
  font-size: 11px !important;
  padding: 2px 7px !important;
  border-radius: 4px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
}

[data-theme="dark"] .cust-prod-brand-tag {
  background: #222938 !important;
  color: #F1F5F9 !important;
  border-color: #384258 !important;
}

/* Smooth Product Picker Dropdown Animation */
.cust-prod-dropdown-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 1090;
}

.cust-prod-dropdown-menu.open {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) scale(1) !important;
  pointer-events: auto !important;
  display: block !important;
}

/* Maximized State for Effortless Catalog Browsing - Pixel-Perfect, Centered & Zero-Blur */
.cust-prod-dropdown-menu.is-maximized {
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  margin: auto !important;
  transform: none !important;
  width: 860px !important;
  max-width: 95vw !important;
  height: 540px !important;
  max-height: 86vh !important;
  z-index: 1250 !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22), 0 0 0 1px var(--border) !important;
  border-radius: var(--radius-lg) !important;
  display: flex !important;
  flex-direction: column !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
}

.cust-prod-dropdown-menu.is-maximized .cust-prod-items-list {
  max-height: none !important;
  flex: 1 !important;
  overflow-y: auto !important;
  padding: 14px !important;
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)) !important;
  gap: 10px !important;
  align-content: start !important;
}

.cust-prod-dropdown-menu.is-maximized .cust-prod-item-row {
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  padding: 10px 12px !important;
  border-radius: var(--radius-sm) !important;
}

.cust-prod-dropdown-menu.is-maximized .cust-prod-item-row:hover {
  border-color: var(--primary) !important;
  background: var(--primary-light) !important;
}

/* Sleek, Accessible Scrollbar for Product Items List */
.cust-prod-items-list {
  scrollbar-width: thin !important;
  scrollbar-color: rgba(148, 163, 184, 0.6) transparent !important;
}

.cust-prod-items-list::-webkit-scrollbar {
  width: 9px !important;
}

.cust-prod-items-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03) !important;
  border-radius: 9999px !important;
  margin: 6px 0 !important;
}

.cust-prod-items-list::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.5) !important;
  border-radius: 9999px !important;
  border: 2px solid transparent !important;
  background-clip: padding-box !important;
}

.cust-prod-items-list::-webkit-scrollbar-thumb:hover {
  background-color: rgba(100, 116, 139, 0.85) !important;
}

[data-theme="dark"] .cust-prod-items-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04) !important;
}

[data-theme="dark"] .cust-prod-items-list::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.25) !important;
}

[data-theme="dark"] .cust-prod-items-list::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.45) !important;
}

/* Maximized Search Backdrop - Permanently Disabled so it never intercepts mouse or blocks scrollbars */
.cust-prod-backdrop {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.cust-prod-backdrop.active {
  display: none !important;
  pointer-events: none !important;
}

/* ==========================================================================
   Stock Badge with 6px Radius & Color-Coded Borders (docs/design.md Section 25)
   ========================================================================== */
.cust-stock-pill {
  display: inline-flex;
  align-items: center;
  padding: 2.5px 8px;
  border-radius: 6px; /* Exactly matches 'বড় করুন' card/button radius */
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  margin-left: auto;
  white-space: nowrap;
  background: var(--surface);
  color: var(--text-secondary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: all 0.15s ease;
}

/* Stock > 5: Green Border */
.cust-stock-pill.stock-green,
.cust-stock-pill.stock-in {
  border: 1px solid #10B981;
}

/* Stock <= 5: Yellow/Amber Border */
.cust-stock-pill.stock-yellow,
.cust-stock-pill.stock-low {
  border: 1px solid #F59E0B;
}

/* Stock <= 0: Red Border */
.cust-stock-pill.stock-red,
.cust-stock-pill.stock-out {
  border: 1px solid #EF4444;
}

/* Dark Theme Adaptations for Stock Pills */
[data-theme="dark"] .cust-stock-pill {
  background: var(--surface);
  color: var(--text-secondary);
}

[data-theme="dark"] .cust-stock-pill.stock-green,
[data-theme="dark"] .cust-stock-pill.stock-in {
  border-color: #10B981;
}

[data-theme="dark"] .cust-stock-pill.stock-yellow,
[data-theme="dark"] .cust-stock-pill.stock-low {
  border-color: #F59E0B;
}

[data-theme="dark"] .cust-stock-pill.stock-red,
[data-theme="dark"] .cust-stock-pill.stock-out {
  border-color: #EF4444;
}

.cust-prod-item-row:hover {
  background: var(--primary-light) !important;
}

[data-theme="dark"] .cust-prod-item-row:hover {
  background: rgba(65, 150, 255, 0.15) !important;
}

/* ==========================================================================
   Custom Order & Edit Order Responsive Architecture (Mobile & Tablet)
   Eliminates horizontal squish and overflow; wraps items to responsive grid
   ========================================================================== */
@media (max-width: 768px) {
  #createCustomOrderModal .modal-card,
  #editOrderModal .modal-card {
    max-width: 96vw !important;
    width: 96vw !important;
    margin: 8px auto !important;
    overflow-x: hidden !important;
  }
  #createCustomOrderModal .modal-body,
  #editOrderModal .modal-body {
    padding: 14px 10px !important;
    overflow-x: hidden !important;
  }
  #createCustomOrderModal .cust-order-items-header,
  #editOrderModal .cust-order-items-header {
    display: none !important;
  }
  #createCustomOrderModal .cust-order-item-row,
  #editOrderModal .cust-order-item-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr 42px !important;
    gap: 8px !important;
    padding: 10px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    overflow: hidden !important;
  }
  #createCustomOrderModal .cust-order-item-row > .cust-prod-picker-wrapper,
  #editOrderModal .cust-order-item-row > .cust-prod-picker-wrapper {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }
  #createCustomOrderModal .cust-order-item-row > div:nth-child(2),
  #editOrderModal .cust-order-item-row > div:nth-child(2) {
    grid-column: 1 / 2 !important;
    width: 100% !important;
  }
  #createCustomOrderModal .cust-order-item-row > div:nth-child(3),
  #editOrderModal .cust-order-item-row > div:nth-child(3) {
    grid-column: 2 / 3 !important;
    width: 100% !important;
  }
  #createCustomOrderModal .cust-order-item-row > div:nth-child(4),
  #editOrderModal .cust-order-item-row > div:nth-child(4) {
    grid-column: 3 / 4 !important;
    width: 100% !important;
  }
  #createCustomOrderModal .cust-order-item-row > div:nth-child(5),
  #editOrderModal .cust-order-item-row > div:nth-child(5) {
    grid-column: 1 / 4 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    height: 38px !important;
    font-size: 13.5px !important;
  }
  #createCustomOrderModal .cust-order-item-row > div:nth-child(5)::before,
  #editOrderModal .cust-order-item-row > div:nth-child(5)::before {
    content: "মোট: " !important;
    font-size: 12px !important;
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
    margin-right: 4px !important;
  }
  #createCustomOrderModal .cust-order-item-row > div:nth-child(6),
  #editOrderModal .cust-order-item-row > div:nth-child(6) {
    grid-column: 4 / 5 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    height: 38px !important;
  }
  #createCustomOrderModal .cust-prod-dropdown-menu,
  #editOrderModal .cust-prod-dropdown-menu {
    width: calc(100vw - 36px) !important;
    max-width: 480px !important;
    left: 0 !important;
  }
}

@media (min-width: 769px) and (max-width: 992px) {
  #createCustomOrderModal .modal-card,
  #editOrderModal .modal-card {
    max-width: 95vw !important;
    width: 95vw !important;
    overflow-x: hidden !important;
  }
  #createCustomOrderModal .modal-body,
  #editOrderModal .modal-body {
    overflow-x: hidden !important;
  }
  #createCustomOrderModal .cust-order-items-header,
  #editOrderModal .cust-order-items-header,
  #createCustomOrderModal .cust-order-item-row,
  #editOrderModal .cust-order-item-row {
    grid-template-columns: 2fr 1.1fr 1fr 0.9fr 65px 38px !important;
    gap: 6px !important;
  }
}

/* Customer Profile View Icon Button */
.btn-customer-profile {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  padding: 0;
}

.btn-customer-profile:hover {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  transform: scale(1.12);
  box-shadow: 0 3px 8px rgba(65, 150, 255, 0.28);
}

[data-theme="dark"] .btn-customer-profile {
  background: rgba(65, 150, 255, 0.15);
  border-color: #2A3045;
  color: var(--primary);
}

[data-theme="dark"] .btn-customer-profile:hover {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.form-grid-2 > *,
.form-grid-3 > * {
  min-width: 0;
}

#addProductModal .modal-card {
  max-width: 680px;
}

#addBundleDealModal .modal-card {
  max-width: 640px;
}

.bundle-auto-images-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.bundle-auto-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.bundle-auto-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}

.bundle-auto-images-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.bundle-auto-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 100%;
}

.bundle-auto-chip img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.bundle-auto-chip.is-empty {
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.bundle-auto-images-box.is-disabled .bundle-auto-images-grid {
  opacity: 0.45;
}

.bundle-table-row-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bundle-table-thumb {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-body);
}

[data-theme="dark"] .bundle-auto-images-box {
  background: #181E2C;
  border-color: #2B3448;
}

[data-theme="dark"] .bundle-auto-chip {
  background: #1E2638;
  border-color: #2F3A52;
}

.bundle-collage-option-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #CBD5E1;
}

.bundle-collage-preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.bundle-collage-preview-frame {
  width: 68px;
  height: 68px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #CBD5E1;
  background: var(--surface);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bundle-collage-action-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
  flex: 1;
}

.bundle-collage-caption {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.bundle-collage-gen-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.bundle-collage-grid {
  width: 100%;
  height: 100%;
  display: grid;
  gap: 2px;
  padding: 2px;
  background: #E2E8F0;
  box-sizing: border-box;
}

.bundle-collage-grid.cols-1 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  padding: 0;
  gap: 0;
}

.bundle-collage-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: 1fr;
}

.bundle-collage-grid.cols-3 {
  grid-template-columns: 1.12fr 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.bundle-collage-grid.cols-3 .bundle-collage-tile:first-child {
  grid-row: 1 / 3;
}

.bundle-collage-grid.cols-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.bundle-collage-tile {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 5px;
  background: var(--surface);
}

.bundle-collage-grid.is-compact .bundle-collage-tile {
  border-radius: 3px;
}

.bundle-collage-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bundle-collage-more-badge {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.bundle-collage-option-panel.is-disabled .bundle-collage-preview-frame {
  opacity: 0.45;
}

.bundle-table-thumb-collage {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

[data-theme="dark"] .bundle-collage-option-panel {
  border-top-color: #2F3A52;
}

[data-theme="dark"] .bundle-collage-preview-frame {
  border-color: #2F3A52;
  background: #1E2638;
}

[data-theme="dark"] .bundle-collage-grid {
  background: #0F172A;
}

@media (max-width: 520px) {
  .bundle-collage-preview-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

.bundle-collage-style-bar {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid #E2E8F0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.bundle-collage-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.bundle-auto-toggle.is-compact {
  font-size: 12.5px;
  gap: 7px;
}

.bundle-collage-width-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 170px;
  max-width: 280px;
}

.bundle-collage-width-wrap.is-disabled,
.bundle-collage-control-row.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.collage-ctrl-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.collage-width-range {
  flex: 1;
  min-width: 80px;
  accent-color: var(--primary);
  cursor: pointer;
}

.collage-width-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
  min-width: 38px;
  text-align: center;
}

.collage-color-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.collage-color-input {
  width: 28px;
  height: 28px;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

.collage-color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #CBD5E1;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.collage-color-swatch:hover {
  transform: scale(1.12);
}

.collage-color-swatch.active {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary);
}

[data-theme="dark"] .bundle-collage-style-bar {
  background: #1E2638;
  border-color: #2F3A52;
}

[data-theme="dark"] .collage-width-pill {
  background: rgba(59, 130, 246, 0.18);
  color: #93C5FD;
  border-color: rgba(59, 130, 246, 0.35);
}

[data-theme="dark"] .collage-color-swatch {
  border-color: #475569;
}

.prod-profit-preview-bar {
  margin-top: -6px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: #F8FAFC;
  border-radius: var(--radius-sm);
  border: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
}

[data-theme="dark"] .prod-profit-preview-bar {
  background: #181E2C;
  border-color: #2D3748;
}

/* ==========================================================================
   Printable Invoice Styles (@media print friendly)
   ========================================================================== */
.invoice-container {
  padding: 24px;
  background: #FFFFFF;
  color: #1A1A2E;
  font-family: var(--font-family);
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 2px solid #EAE3D5;
  margin-bottom: 20px;
}

.invoice-brand h2 {
  font-size: 22px;
  color: #4196FF;
  font-weight: 700;
}

.invoice-meta {
  text-align: right;
  font-size: 13px;
  color: #5A6080;
}

.invoice-customer {
  margin-bottom: 20px;
  padding: 12px 16px;
  background: #FFFBF5;
  border: 1px solid #EAE3D5;
  border-radius: 12px;
  font-size: 14px;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.invoice-table th, .invoice-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #EAE3D5;
  text-align: left;
  font-size: 14px;
}

.invoice-table th {
  background: #F7F1E7;
  font-weight: 600;
}

.invoice-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-size: 14px;
}

.invoice-totals .total-row {
  display: flex;
  justify-content: space-between;
  width: 220px;
}

.invoice-totals .grand-total {
  font-size: 16px;
  font-weight: 700;
  color: #4196FF;
  border-top: 2px solid #4196FF;
  padding-top: 6px;
}

/* Isolated Invoice Print Styles - Scoped strictly to invoice printing so other modules (Analytics, Reports, Activity Log) can print freely */
@media print {
  body.printing-invoice *,
  body:has(#invoiceModal.open) * {
    visibility: hidden;
  }
  body.printing-invoice #printableInvoice,
  body.printing-invoice #printableInvoice *,
  body:has(#invoiceModal.open) #printableInvoice,
  body:has(#invoiceModal.open) #printableInvoice * {
    visibility: visible;
  }
  body.printing-invoice #printableInvoice,
  body:has(#invoiceModal.open) #printableInvoice {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 20px;
  }
  body.printing-invoice .modal-footer,
  body.printing-invoice .modal-header .modal-close-btn,
  body:has(#invoiceModal.open) .modal-footer,
  body:has(#invoiceModal.open) .modal-header .modal-close-btn {
    display: none !important;
  }
}

/* ==========================================================================
   Floating Toast Notifications (docs/design.md Section 5 - AppSnackBar)
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #1A1A2E;
  color: #FFFFFF;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  animation: slideInRight 0.25s ease forwards;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.success i { color: var(--success); }
.toast.danger i { color: var(--danger); }
.toast.info i { color: var(--primary); }

/* ==========================================================================
   Multi-Device Responsive Architecture (PC, Laptop, Tablet & Mobile)
   Matches docs/design.md Section 70
   ========================================================================== */

/* Universal Viewport & Horizontal Overflow Safeguard */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

.admin-layout {
  max-width: 100vw;
  overflow-x: hidden;
  width: 100%;
}

.admin-main {
  min-width: 0;
  max-width: 100vw;
  overflow-x: hidden;
}

.admin-content,
.view-section {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Sidebar Mobile Drawer Close Button */
.sidebar-mobile-close-btn {
  display: none;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s ease;
}

.sidebar-mobile-close-btn:hover {
  background: var(--danger-light);
  color: var(--danger);
  border-color: rgba(255, 71, 87, 0.3);
}

/* Sidebar Darkened Backdrop Overlay */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

body.sidebar-drawer-open {
  overflow: hidden !important;
}

/* 1. Medium Desktops & Laptops (max-width: 1200px) */
@media (max-width: 1200px) {
  .metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
  }
  .admin-topbar {
    padding: 0 20px;
  }
}

/* 2. Tablets & Off-Canvas Drawer (max-width: 992px) */
@media (max-width: 992px) {
  .admin-sidebar {
    transform: translateX(-100%);
    width: 280px;
    z-index: 999;
    box-shadow: none;
  }
  .admin-sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.35);
  }
  .sidebar-edge-toggle {
    display: none !important;
  }
  .sidebar-mobile-close-btn {
    display: inline-flex;
  }
  .sidebar-header {
    justify-content: space-between;
    padding: 16px 20px;
  }
  .admin-main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw;
  }
  .admin-topbar {
    padding: 10px 16px 12px;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .topbar-row-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
  }
  .topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    max-width: none;
  }
  .mobile-app-brand {
    display: flex !important;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }
  .mobile-brand-title {
    font-family: 'LiAdorNoirrit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    letter-spacing: -0.3px !important;
    color: var(--text-primary) !important;
    white-space: nowrap !important;
  }
  .desktop-search-wrap {
    display: none !important;
  }
  #resetOrderTableColumnsBtn {
    display: none !important;
  }
  .topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  #storeStatusPill,
  #langToggleBtn,
  #simulateOrderBtn,
  #soundToggleBtn,
  #themeToggleBtn {
    display: none !important;
  }
  .topbar-overflow-wrap {
    display: block !important;
  }

  /* Universal 38x38px Topbar Icon Buttons on Mobile/Tablet */
  .menu-toggle-btn,
  .mobile-search-toggle-btn,
  #topbarNotificationBtn,
  #topbarAdminProfile,
  #topbarMoreBtn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    border-radius: 10px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: var(--surface-secondary) !important;
    border: 1px solid var(--border) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    color: var(--text-primary) !important;
    font-size: 15px !important;
    transition: all 0.2s ease !important;
  }

  .menu-toggle-btn:hover,
  .mobile-search-toggle-btn:hover,
  .mobile-search-toggle-btn.active,
  #topbarNotificationBtn:hover,
  #topbarAdminProfile:hover,
  #topbarMoreBtn:hover,
  .topbar-overflow-wrap.open #topbarMoreBtn {
    background: var(--primary-light) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
  }

  /* Unified Profile Avatar inside 38x38 button */
  #topbarAdminProfile .profile-avatar {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    border-radius: 50% !important;
    background: var(--primary) !important;
    color: #FFFFFF !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
  }

  #topbarAdminProfile .profile-info {
    display: none !important;
  }

  /* Notification Bell Dot Position */
  #topbarNotificationBtn .notification-count {
    top: 6px !important;
    right: 6px !important;
    width: 8px !important;
    height: 8px !important;
  }

  /* Smooth Expandable Search Row Below AppBar */
  .topbar-search-row {
    display: block !important;
    width: 100% !important;
    max-height: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    margin-top: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
    transform: translateY(-6px) !important;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                margin-top 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  .topbar-search-row.open {
    max-height: 60px !important;
    opacity: 1 !important;
    overflow: visible !important;
    margin-top: 10px !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
  }

  .topbar-search-row .search-bar-wrap {
    width: 100%;
    max-width: 100%;
    position: relative;
  }
  .topbar-search-row .search-input {
    width: 100%;
    height: 40px;
    background-color: var(--surface-secondary);
    border: 1.2px solid var(--border);
    border-radius: 12px;
    padding: 0 16px 0 38px;
    font-size: 13.5px;
    color: var(--text-primary);
    transition: var(--transition);
  }
  .topbar-search-row .search-input:focus {
    background-color: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  }
  .topbar-search-row .search-bar-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 14px;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px;
  }
  .metrics-grid > .stat-card:nth-child(odd):last-child {
    grid-column: span 2;
  }
  .table-header-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 12px;
  }
  .table-header-actions,
  .app-reports-filter-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
  }
  /* Customer Messaging Hub Tablet & Mobile WhatsApp-style Master-Detail UI (User Request) */
  #view-messages.mobile-chat-open .page-header,
  #view-messages:has(#msgHubLayout.mobile-chat-active) .page-header,
  body.chat-active-mobile #view-messages .page-header {
    display: none !important;
  }

  body.chat-active-mobile .admin-content,
  .admin-content:has(#view-messages.mobile-chat-open),
  .admin-content:has(#msgHubLayout.mobile-chat-active) {
    padding: 0 !important;
    overflow: hidden !important;
  }

  #view-messages.mobile-chat-open,
  #view-messages:has(#msgHubLayout.mobile-chat-active),
  body.chat-active-mobile #view-messages {
    padding: 0 !important;
    margin: 0 !important;
    height: calc(100dvh - 65px) !important;
    max-height: calc(100dvh - 65px) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .msg-hub-layout {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: calc(100vh - 190px) !important;
    gap: 0 !important;
    margin-top: 10px !important;
    position: relative !important;
  }
  .msg-sidebar-resizer {
    display: none !important;
  }

  /* Default on Tablet/Mobile: Show Contacts List Full Width & Full Height */
  .msg-contacts-card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: calc(100vh - 190px) !important;
    min-height: 500px !important;
    max-height: none !important;
    flex: 1 !important;
    border-radius: var(--radius-md) !important;
  }
  .msg-contacts-list {
    flex: 1 !important;
    height: 100% !important;
    max-height: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  .msg-contacts-list::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  /* Hide Chat Window by default on Tablet/Mobile */
  .msg-chat-window-card {
    display: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    border-radius: var(--radius-md) !important;
  }

  /* When contact name clicked: Hide Contacts, Show Full Chat View with Pinned Composer (WhatsApp Style) */
  .msg-hub-layout.mobile-chat-active {
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    border: none !important;
    border-radius: 0 !important;
  }
  .msg-hub-layout.mobile-chat-active .msg-contacts-card {
    display: none !important;
  }
  .msg-hub-layout.mobile-chat-active .msg-chat-window-card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    border: none !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    background: var(--surface) !important;
  }

  /* 1. Chat Header & Smart External Chat Icon */
  .msg-chat-header {
    flex: 0 0 auto !important;
    padding: 10px 14px !important;
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    z-index: 5 !important;
  }
  .btn-msg-back {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 50% !important;
    border: 1px solid var(--border) !important;
    background: var(--surface-secondary) !important;
    color: var(--text-primary) !important;
    cursor: pointer !important;
    font-size: 14px !important;
    margin-right: 8px !important;
    transition: background-color var(--transition-base), color var(--transition-base), transform 0.15s ease !important;
    flex-shrink: 0 !important;
  }
  .btn-msg-back:hover,
  .btn-msg-back:active {
    background: var(--surface-hover, var(--surface)) !important;
    color: var(--primary) !important;
    transform: scale(0.95) !important;
  }

  /* Smart External Chat Button (Icon Only on Mobile/Tablet) */
  #btnOpenNativeChat {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    padding: 0 !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--surface-secondary) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
  }
  #btnOpenNativeChat span {
    display: none !important;
  }
  #btnOpenNativeChat:hover,
  #btnOpenNativeChat:active {
    background: rgba(26, 115, 232, 0.1) !important;
    color: var(--primary) !important;
    border-color: var(--primary) !important;
  }

  /* 2. Messages Timeline (No Visible Scrollbar) */
  .msg-timeline {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    padding: 14px 14px 16px !important;
  }
  .msg-timeline::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  /* 3. Quick Message Templates Bar (Single Horizontal Line, No Scrollbar) */
  .msg-templates-bar {
    flex: 0 0 auto !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    padding: 6px 12px !important;
    background: var(--surface) !important;
    border-top: 1px solid var(--border) !important;
    overflow: hidden !important;
    z-index: 6 !important;
  }
  .templates-label {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    color: var(--text-secondary) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    margin: 0 !important;
  }
  .templates-chips-scroll {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    padding: 2px 0 !important;
  }
  .templates-chips-scroll::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }
  .template-chip {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 4px 10px !important;
    font-size: 11.5px !important;
    border-radius: 9999px !important;
    border: 1px solid var(--border) !important;
    background: var(--surface-secondary) !important;
  }
  .btn-manage-templates-action {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 4px 9px !important;
    font-size: 11px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
  }

  /* 4. Text Composer Box (Pinned at Bottom, Rounded Input, Circular Send Button) */
  .msg-composer-box {
    flex: 0 0 auto !important;
    display: block !important;
    padding: 8px 12px 10px !important;
    background: var(--surface) !important;
    border-top: 1px solid var(--border) !important;
    position: relative !important;
    z-index: 10 !important;
  }
  .composer-input-row {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
  }
  #msgComposerTextarea {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 80px !important;
    resize: none !important;
    padding: 8px 14px !important;
    font-size: 13.5px !important;
    line-height: 1.4 !important;
    border-radius: 20px !important;
    background: var(--surface-secondary) !important;
    border: 1.2px solid var(--border) !important;
    color: var(--text-primary) !important;
    box-sizing: border-box !important;
    outline: none !important;
    transition: border-color var(--transition-base), background-color var(--transition-base), box-shadow var(--transition-base) !important;
  }
  #msgComposerTextarea:focus {
    border-color: var(--primary) !important;
    background: var(--surface) !important;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15) !important;
  }
  .btn-send-msg {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    background: var(--primary) !important;
    color: #ffffff !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(26, 115, 232, 0.3) !important;
    transition: transform 0.15s ease, background-color 0.15s ease !important;
  }
  .btn-send-msg:active {
    transform: scale(0.92) !important;
  }
  .btn-send-msg span {
    display: none !important;
  }
  .btn-send-msg i {
    font-size: 14px !important;
    margin-left: 2px !important;
  }
  .composer-footer-note {
    display: none !important;
  }

  /* Universal Scrollbar Hiding for Touch Views */
  .msg-channel-filter-pills {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  .msg-channel-filter-pills::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }
  .profile-layout-grid {
    grid-template-columns: 1fr !important;
  }
}

/* 3. Small Tablets & Phones (max-width: 768px) */
@media (max-width: 768px) {
  .admin-content {
    padding: 16px 14px;
  }
  .page-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    margin-bottom: 16px !important;
  }
  .page-header > div:first-child,
  .page-header > h1,
  .page-header > h2,
  .page-header > .page-title {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }
  .page-title {
    font-size: 17px !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 0 !important;
  }
  .page-actions {
    width: auto !important;
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    justify-content: flex-end !important;
  }
  .page-actions .btn {
    flex: 0 0 auto !important;
    width: auto !important;
    white-space: nowrap !important;
    height: 36px !important;
    padding: 6px 12px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }
  .metrics-grid > .stat-card:nth-child(odd):last-child {
    grid-column: span 2;
  }
  .stat-card {
    padding: 14px 16px;
  }
  .stat-value {
    font-size: 20px;
  }
  .stat-label {
    font-size: 12px;
  }
  .tabs-filter {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    white-space: nowrap;
    padding: 4px;
  }
  .tabs-filter::-webkit-scrollbar {
    display: none;
  }
  .tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 12.5px;
  }
  /* ========================================================================
     Mobile Table Card Architecture (docs/rules.md Rule 26 & docs/design.md Section 71)
     Transforms wide multi-column tables into native-feeling mobile order cards
     with ZERO horizontal overflow.
     ======================================================================== */
  
  /* Order Tables: Recent Orders & All Orders */
  #recentOrdersTable,
  #allOrdersTable,
  .pd-orders-table-wrap table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  #recentOrdersTable thead,
  #allOrdersTable thead,
  .profile-orders-table thead,
  .pd-orders-table-wrap table thead {
    display: none !important;
  }

  #recentOrdersTable tbody,
  #allOrdersTable tbody,
  .profile-orders-table tbody,
  .pd-orders-table-wrap table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 0 12px 0 !important;
  }

  #view-dashboard .table-card,
  #view-orders .table-card,
  .table-card:has(#recentOrdersTable),
  .table-card:has(#allOrdersTable) {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  #view-dashboard .table-card .table-header-bar,
  #view-orders .table-card .table-header-bar,
  .table-card:has(#recentOrdersTable) .table-header-bar,
  .table-card:has(#allOrdersTable) .table-header-bar {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 12px !important;
    padding: 12px 16px !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  #view-dashboard .table-card .table-responsive,
  #view-orders .table-card .table-responsive,
  .table-card:has(#recentOrdersTable) .table-responsive,
  .table-card:has(#allOrdersTable) .table-responsive {
    overflow-x: visible !important;
    padding: 0 !important;
    background: transparent !important;
  }

  #recentOrdersTable tbody tr,
  #allOrdersTable tbody tr,
  .pd-orders-table-wrap table tbody tr {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "header total"
      "customer customer"
      "items items"
      "payment status"
      "actions actions" !important;
    gap: 8px !important;
    align-items: center !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 11px 13px !important;
    margin-bottom: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #recentOrdersTable tbody tr:hover,
  #allOrdersTable tbody tr:hover,
  .pd-orders-table-wrap table tbody tr:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(65, 150, 255, 0.12) !important;
  }

  /* Empty state fallback for order card tables */
  #recentOrdersTable tbody tr:has(td[colspan]),
  #allOrdersTable tbody tr:has(td[colspan]),
  .pd-orders-table-wrap table tbody tr:has(td[colspan]) {
    display: block !important;
    text-align: center !important;
  }

  #recentOrdersTable tbody tr td[colspan],
  #allOrdersTable tbody tr td[colspan],
  .pd-orders-table-wrap table tbody tr td[colspan] {
    display: block !important;
    width: 100% !important;
    padding: 32px 16px !important;
    border: none !important;
  }

  /* Cell 1: Header Area (Order ID + Custom Badge + Date/Time inline) */
  #recentOrdersTable tbody tr td:nth-child(1),
  #allOrdersTable tbody tr td:nth-child(1),
  .pd-orders-table-wrap table tbody tr td:nth-child(1) {
    grid-area: header !important;
    padding: 0 !important;
    border: none !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 4px 8px !important;
    min-width: 0 !important;
  }

  #recentOrdersTable tbody tr td:nth-child(1) > div:last-child,
  #allOrdersTable tbody tr td:nth-child(1) > div:last-child,
  .pd-orders-table-wrap table tbody tr td:nth-child(1) > div:last-child {
    margin-top: 0 !important;
    font-size: 11px !important;
    white-space: nowrap !important;
  }

  /* Cell 4: Top-Right Total Amount Highlight */
  #recentOrdersTable tbody tr td:nth-child(4),
  #allOrdersTable tbody tr td:nth-child(4),
  .pd-orders-table-wrap table tbody tr td:nth-child(4) {
    grid-area: total !important;
    padding: 0 !important;
    border: none !important;
    text-align: right !important;
    justify-self: end !important;
    align-self: center !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    color: var(--primary) !important;
    white-space: nowrap !important;
  }

  #recentOrdersTable tbody tr td:nth-child(4) strong,
  #allOrdersTable tbody tr td:nth-child(4) strong,
  .pd-orders-table-wrap table tbody tr td:nth-child(4) strong {
    font-size: 16px !important;
    color: var(--primary) !important;
    font-weight: 800 !important;
  }

  /* Cell 2: Customer Identity Block */
  #recentOrdersTable tbody tr td:nth-child(2),
  #allOrdersTable tbody tr td:nth-child(2),
  .pd-orders-table-wrap table tbody tr td:nth-child(2) {
    grid-area: customer !important;
    padding: 7px 10px !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    background: var(--surface-secondary) !important;
    box-sizing: border-box !important;
  }

  /* Cell 3: Ordered Products Summary */
  #recentOrdersTable tbody tr td:nth-child(3),
  #allOrdersTable tbody tr td:nth-child(3),
  .pd-orders-table-wrap table tbody tr td:nth-child(3) {
    grid-area: items !important;
    padding: 1px 0 !important;
    border: none !important;
    font-size: 12.5px !important;
    line-height: 1.4 !important;
  }

  /* Cell 5: Payment Gateway, Method & TrxID (left side of payment+status row) */
  #recentOrdersTable tbody tr td:nth-child(5),
  #allOrdersTable tbody tr td:nth-child(5),
  .pd-orders-table-wrap table tbody tr td:nth-child(5) {
    grid-area: payment !important;
    padding: 6px 0 !important;
    border: none !important;
    border-top: 1px dashed var(--border) !important;
    border-bottom: 1px dashed var(--border) !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 5px 6px !important;
    min-height: 40px !important;
    height: 100% !important;
    box-sizing: border-box !important;
  }

  /* Cell 6: Order Status Interactive Dropdown (right side of payment+status row) */
  #recentOrdersTable tbody tr td:nth-child(6),
  #allOrdersTable tbody tr td:nth-child(6),
  .pd-orders-table-wrap table tbody tr td:nth-child(6) {
    grid-area: status !important;
    padding: 6px 0 !important;
    border: none !important;
    border-top: 1px dashed var(--border) !important;
    border-bottom: 1px dashed var(--border) !important;
    justify-self: stretch !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    min-height: 40px !important;
    height: 100% !important;
    box-sizing: border-box !important;
  }

  /* Cell 7: Row Action Buttons (compact right-aligned bottom bar) */
  #recentOrdersTable tbody tr td:nth-child(7),
  #allOrdersTable tbody tr td:nth-child(7),
  .pd-orders-table-wrap table tbody tr td:nth-child(7) {
    grid-area: actions !important;
    padding: 2px 0 0 0 !important;
    border: none !important;
    justify-self: end !important;
    align-self: center !important;
  }

  #recentOrdersTable tbody tr td:nth-child(7) .action-btns,
  #allOrdersTable tbody tr td:nth-child(7) .action-btns,
  .pd-orders-table-wrap table tbody tr td:nth-child(7) .action-btns {
    justify-content: flex-end !important;
    gap: 6px !important;
  }

  /* Global Mobile Overflow & Multi-Option Fit Fixes across ALL Admin Views */
  .admin-main,
  .view-section,
  .card,
  .table-card,
  .analytics-toolbar-card,
  .notice-workspace-grid > * {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-header {
    gap: 12px !important;
  }

  .page-header .page-actions {
    width: 100% !important;
    max-width: 100% !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .page-header .page-actions .btn {
    flex: 1 1 auto !important;
    justify-content: center !important;
    font-size: 12.5px !important;
    padding: 8px 12px !important;
  }

  .reports-type-tabs,
  .tabs-filter,
  .backup-tabs-list {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: visible !important;
  }

  .tabs-filter .tab-indicator {
    display: none !important;
  }

  .reports-type-btn,
  .backup-tab-btn,
  .tabs-filter .tab-btn {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
    justify-content: center !important;
  }

  .tabs-filter .tab-btn.active {
    background: var(--primary-light, #EBF5FF) !important;
    color: var(--primary) !important;
    border-radius: var(--radius-pill, 9999px) !important;
  }

  .table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  #view-notice .form-group > div[style*="repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  #view-notice .form-group > div[style*="repeat(3"] {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }

  #view-notice div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }


  /* Customer Directory Table Card Layout */
  #customersTable {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  #customersTable thead {
    display: none !important;
  }

  #customersTable tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 0 12px 0 !important;
  }

  #view-customers .table-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  #view-customers .table-card .table-header-bar {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 12px !important;
    padding: 12px 16px !important;
  }

  #view-customers .table-card .table-responsive {
    overflow-x: visible !important;
    padding: 0 !important;
  }

  /* Replaced by Section 16 Mobile Card Architecture */

  /* ========================================================================
     Product Inventory Mobile Card Architecture (docs/rules.md Rule 27 & docs/design.md Section 72)
     Transforms 9-column inventory table into sleek, responsive native product cards
     with ZERO horizontal overflow.
     ======================================================================== */
  #view-inventory table.data-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  #view-inventory table.data-table thead {
    display: none !important;
  }

  #view-inventory table.data-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 0 12px 0 !important;
  }

  #view-inventory .table-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  #view-inventory .table-card .table-header-bar {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 12px !important;
    padding: 14px 16px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  #view-inventory .table-card .table-header-bar > div:last-child {
    width: 100% !important;
    max-width: 100% !important;
  }

  #view-inventory .table-card .table-header-bar #productSearchInput {
    width: 100% !important;
    height: 40px !important;
    border-radius: var(--radius-sm) !important;
    font-size: 13.5px !important;
  }

  #view-inventory .table-card .table-responsive {
    overflow-x: visible !important;
    padding: 0 !important;
    background: transparent !important;
  }

  #view-inventory table.data-table tbody tr {
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    grid-template-areas:
      "serial brand category"
      "product product product"
      "pricing pricing margin"
      "stock switch actions" !important;
    gap: 10px !important;
    align-items: center !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 14px 16px !important;
    margin-bottom: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #view-inventory table.data-table tbody tr:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(65, 150, 255, 0.12) !important;
  }

  /* Empty state fallback */
  #view-inventory table.data-table tbody tr:has(td[colspan]) {
    display: block !important;
    text-align: center !important;
  }

  #view-inventory table.data-table tbody tr td[colspan] {
    display: block !important;
    width: 100% !important;
    padding: 32px 16px !important;
    border: none !important;
  }

  /* Cell 1: Serial Badge */
  #view-inventory table.data-table tbody tr td:nth-child(1) {
    grid-area: serial !important;
    width: auto !important;
    text-align: left !important;
    display: inline-flex !important;
    align-items: center !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: var(--text-secondary) !important;
    background: var(--surface-secondary) !important;
    padding: 3px 9px !important;
    border-radius: 12px !important;
    border: 1px solid var(--border) !important;
  }

  /* Cell 3: Company / Brand Tag */
  #view-inventory table.data-table tbody tr td:nth-child(3) {
    grid-area: brand !important;
    padding: 0 !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
  }

  /* Cell 4: Category Badge */
  #view-inventory table.data-table tbody tr td:nth-child(4) {
    grid-area: category !important;
    padding: 0 !important;
    border: none !important;
    justify-self: end !important;
    text-align: right !important;
    display: flex !important;
    align-items: center !important;
  }

  /* Cell 2: Product Thumbnail & Full Details */
  #view-inventory table.data-table tbody tr td:nth-child(2) {
    grid-area: product !important;
    padding: 10px 0 !important;
    border: none !important;
    border-top: 1px dashed var(--border) !important;
    border-bottom: 1px dashed var(--border) !important;
    width: 100% !important;
  }

  /* Cell 5: Selling Price & Cost */
  #view-inventory table.data-table tbody tr td:nth-child(5) {
    grid-area: pricing !important;
    padding: 0 !important;
    border: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
  }

  /* Cell 6: Profit Margin Badge */
  #view-inventory table.data-table tbody tr td:nth-child(6) {
    grid-area: margin !important;
    padding: 0 !important;
    border: none !important;
    justify-self: end !important;
    text-align: right !important;
    display: flex !important;
    align-items: center !important;
  }

  /* Cell 7: Stock Amount */
  #view-inventory table.data-table tbody tr td:nth-child(7) {
    grid-area: stock !important;
    padding: 0 !important;
    border: none !important;
    align-self: center !important;
    white-space: nowrap !important;
    font-size: 13px !important;
  }

  /* Cell 8: In-Stock Switch Toggle */
  #view-inventory table.data-table tbody tr td:nth-child(8) {
    grid-area: switch !important;
    padding: 0 !important;
    border: none !important;
    align-self: center !important;
    justify-self: center !important;
    display: flex !important;
    align-items: center !important;
  }

  /* Cell 9: Action Buttons */
  #view-inventory table.data-table tbody tr td:nth-child(9) {
    grid-area: actions !important;
    padding: 0 !important;
    border: none !important;
    justify-self: end !important;
    align-self: center !important;
  }

  #view-inventory table.data-table tbody tr td:nth-child(9) .action-btns {
    justify-content: flex-end !important;
    gap: 6px !important;
  }

  /* ========================================================================
     1. Analytics Top Products Leaderboard Card Layout (Image 1)
     Transforms 6-column leaderboard table into sleek mobile performance cards
     ======================================================================== */
  #analyticsTopProductsTable {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  #analyticsTopProductsTable thead {
    display: none !important;
  }

  #analyticsTopProductsTable tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 0 12px 0 !important;
  }

  #view-analytics .table-card:has(#analyticsTopProductsTable),
  .table-card:has(#analyticsTopProductsTable) {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  #view-analytics .table-card:has(#analyticsTopProductsTable) .table-header-bar,
  .table-card:has(#analyticsTopProductsTable) .table-header-bar {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 12px !important;
    padding: 12px 16px !important;
  }

  #view-analytics .table-card:has(#analyticsTopProductsTable) .table-responsive,
  .table-card:has(#analyticsTopProductsTable) .table-responsive {
    overflow-x: visible !important;
    padding: 0 !important;
    background: transparent !important;
  }

  #analyticsTopProductsTable tbody tr {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-areas:
      "product product"
      "sold revenue"
      "profit status" !important;
    gap: 10px !important;
    align-items: center !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 14px 16px !important;
    margin-bottom: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #analyticsTopProductsTable tbody tr:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(65, 150, 255, 0.12) !important;
  }

  #analyticsTopProductsTable tbody tr:has(td[colspan]) {
    display: block !important;
    text-align: center !important;
  }

  #analyticsTopProductsTable tbody tr td[colspan] {
    display: block !important;
    width: 100% !important;
    padding: 24px 16px !important;
    border: none !important;
  }

  /* Cell 1: Rank Badge positioned in top-left */
  #analyticsTopProductsTable tbody tr td:nth-child(1) {
    position: absolute !important;
    top: 14px !important;
    left: 14px !important;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2 !important;
  }

  /* Cell 2: Product Thumbnail & Title (offset to avoid overlapping rank badge) */
  #analyticsTopProductsTable tbody tr td:nth-child(2) {
    grid-area: product !important;
    padding: 0 0 10px 42px !important;
    border: none !important;
    border-bottom: 1px dashed var(--border) !important;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Cell 3: Sold Units */
  #analyticsTopProductsTable tbody tr td:nth-child(3) {
    grid-area: sold !important;
    padding: 0 !important;
    border: none !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
  }

  /* Cell 4: Total Revenue */
  #analyticsTopProductsTable tbody tr td:nth-child(4) {
    grid-area: revenue !important;
    padding: 0 !important;
    border: none !important;
    justify-self: end !important;
    text-align: right !important;
    font-size: 14.5px !important;
    font-weight: 800 !important;
    color: var(--primary) !important;
  }

  /* Cell 5: Profit & Margin */
  #analyticsTopProductsTable tbody tr td:nth-child(5) {
    grid-area: profit !important;
    padding: 0 !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
  }

  /* Cell 6: Stock Status Badge */
  #analyticsTopProductsTable tbody tr td:nth-child(6) {
    grid-area: status !important;
    padding: 0 !important;
    border: none !important;
    justify-self: end !important;
    text-align: right !important;
  }

  /* ========================================================================
     2. Product Attributes & Variants Mobile Card Layout (Image 2)
     Transforms attributes and value tags into neat responsive mobile cards
     ======================================================================== */
  #view-attributes table.data-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  #view-attributes table.data-table thead {
    display: none !important;
  }

  #view-attributes table.data-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 0 12px 0 !important;
  }

  #view-attributes .table-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  #view-attributes .table-card .table-header-bar {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 12px !important;
    padding: 12px 16px !important;
  }

  #view-attributes .table-card .table-responsive {
    overflow-x: visible !important;
    padding: 0 !important;
    background: transparent !important;
  }

  #view-attributes table.data-table tbody tr {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "title id"
      "values values"
      "cats cats"
      "status actions" !important;
    gap: 10px !important;
    align-items: center !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 14px 16px !important;
    margin-bottom: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #view-attributes table.data-table tbody tr:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(65, 150, 255, 0.12) !important;
  }

  #view-attributes table.data-table tbody tr:has(td[colspan]) {
    display: block !important;
    text-align: center !important;
  }

  #view-attributes table.data-table tbody tr td[colspan] {
    display: block !important;
    width: 100% !important;
    padding: 24px 16px !important;
    border: none !important;
  }

  /* Cell 1: Attribute ID */
  #view-attributes table.data-table tbody tr td:nth-child(1) {
    grid-area: id !important;
    justify-self: end !important;
    align-self: flex-start !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Cell 2: Attribute Name & Sub-name */
  #view-attributes table.data-table tbody tr td:nth-child(2) {
    grid-area: title !important;
    padding: 0 !important;
    border: none !important;
    min-width: 0 !important;
  }

  /* Cell 3: Values chip cloud (full width wrap) */
  #view-attributes table.data-table tbody tr td:nth-child(3) {
    grid-area: values !important;
    padding: 8px 0 !important;
    border: none !important;
    border-top: 1px dashed var(--border) !important;
    border-bottom: 1px dashed var(--border) !important;
    width: 100% !important;
  }

  #view-attributes table.data-table tbody tr td:nth-child(3) > div {
    max-width: 100% !important;
    gap: 6px !important;
  }

  #view-attributes table.data-table tbody tr td:nth-child(3) .badge {
    font-size: 11.5px !important;
    padding: 3px 8px !important;
  }

  /* Cell 4: Applicable Categories */
  #view-attributes table.data-table tbody tr td:nth-child(4) {
    grid-area: cats !important;
    padding: 0 !important;
    border: none !important;
    font-size: 12.5px !important;
  }

  /* Cell 5: Status Toggle Button */
  #view-attributes table.data-table tbody tr td:nth-child(5) {
    grid-area: status !important;
    justify-self: start !important;
    align-self: center !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Cell 6: Action Buttons */
  #view-attributes table.data-table tbody tr td:nth-child(6) {
    grid-area: actions !important;
    justify-self: end !important;
    align-self: center !important;
    padding: 0 !important;
    border: none !important;
  }

  #view-attributes table.data-table tbody tr td:nth-child(6) .action-btns {
    justify-content: flex-end !important;
    gap: 6px !important;
  }

  /* ========================================================================
     3. Brands & Manufacturers Mobile Card Layout (Image 3)
     Transforms brand list into compact mobile cards with logo and action buttons
     ======================================================================== */
  #view-brands table.data-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  #view-brands table.data-table thead {
    display: none !important;
  }

  #view-brands table.data-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 0 12px 0 !important;
  }

  #view-brands .table-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  #view-brands .table-card .table-header-bar {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 12px !important;
    padding: 12px 16px !important;
  }

  #view-brands .table-card .table-responsive {
    overflow-x: visible !important;
    padding: 0 !important;
    background: transparent !important;
  }

  #view-brands table.data-table tbody tr {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "brand id"
      "products products"
      "status actions" !important;
    gap: 10px !important;
    align-items: center !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 14px 16px !important;
    margin-bottom: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #view-brands table.data-table tbody tr:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(65, 150, 255, 0.12) !important;
  }

  #view-brands table.data-table tbody tr:has(td[colspan]) {
    display: block !important;
    text-align: center !important;
  }

  #view-brands table.data-table tbody tr td[colspan] {
    display: block !important;
    width: 100% !important;
    padding: 24px 16px !important;
    border: none !important;
  }

  /* Cell 1: Brand ID */
  #view-brands table.data-table tbody tr td:nth-child(1) {
    grid-area: id !important;
    justify-self: end !important;
    align-self: flex-start !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Cell 2: Brand Logo, Title & Group */
  #view-brands table.data-table tbody tr td:nth-child(2) {
    grid-area: brand !important;
    padding: 0 !important;
    border: none !important;
    min-width: 0 !important;
  }

  /* Cell 3: Connected Products Count */
  #view-brands table.data-table tbody tr td:nth-child(3) {
    grid-area: products !important;
    padding: 8px 12px !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    background: var(--surface-secondary) !important;
    font-size: 13px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Cell 4: Status Toggle Button */
  #view-brands table.data-table tbody tr td:nth-child(4) {
    grid-area: status !important;
    justify-self: start !important;
    align-self: center !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Cell 5: Action Buttons */
  #view-brands table.data-table tbody tr td:nth-child(5) {
    grid-area: actions !important;
    justify-self: end !important;
    align-self: center !important;
    padding: 0 !important;
    border: none !important;
  }

  #view-brands table.data-table tbody tr td:nth-child(5) .action-btns {
    justify-content: flex-end !important;
    gap: 6px !important;
  }

  /* ========================================================================
     4. Tax & VAT Rules Mobile Card Layout (Image 4)
     Transforms tax rate matrix into clear mobile cards with rates & country
     ======================================================================== */
  #view-tax-rules table.data-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  #view-tax-rules table.data-table thead {
    display: none !important;
  }

  #view-tax-rules table.data-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 0 12px 0 !important;
  }

  #view-tax-rules .table-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  #view-tax-rules .table-card .table-header-bar {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 12px !important;
    padding: 12px 16px !important;
  }

  #view-tax-rules .table-card .table-responsive {
    overflow-x: visible !important;
    padding: 0 !important;
    background: transparent !important;
  }

  #view-tax-rules table.data-table tbody tr {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "desc id"
      "rate country"
      "status actions" !important;
    gap: 10px !important;
    align-items: center !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 14px 16px !important;
    margin-bottom: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #view-tax-rules table.data-table tbody tr:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(65, 150, 255, 0.12) !important;
  }

  #view-tax-rules table.data-table tbody tr:has(td[colspan]) {
    display: block !important;
    text-align: center !important;
  }

  #view-tax-rules table.data-table tbody tr td[colspan] {
    display: block !important;
    width: 100% !important;
    padding: 24px 16px !important;
    border: none !important;
  }

  /* Cell 1: Tax Rule ID */
  #view-tax-rules table.data-table tbody tr td:nth-child(1) {
    grid-area: id !important;
    justify-self: end !important;
    align-self: flex-start !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Cell 2: Tax Rule Description */
  #view-tax-rules table.data-table tbody tr td:nth-child(2) {
    grid-area: desc !important;
    padding: 0 !important;
    border: none !important;
    min-width: 0 !important;
  }

  /* Cell 3: VAT Rate */
  #view-tax-rules table.data-table tbody tr td:nth-child(3) {
    grid-area: rate !important;
    padding: 6px 12px !important;
    background: var(--surface-secondary) !important;
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border) !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--primary) !important;
    display: inline-flex !important;
    align-items: center !important;
    width: fit-content !important;
  }

  /* Cell 4: Applicable Country */
  #view-tax-rules table.data-table tbody tr td:nth-child(4) {
    grid-area: country !important;
    justify-self: end !important;
    padding: 6px 12px !important;
    background: var(--surface-secondary) !important;
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border) !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: var(--text-secondary) !important;
  }

  /* Cell 5: Status Toggle Button */
  #view-tax-rules table.data-table tbody tr td:nth-child(5) {
    grid-area: status !important;
    justify-self: start !important;
    align-self: center !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Cell 6: Action Buttons */
  #view-tax-rules table.data-table tbody tr td:nth-child(6) {
    grid-area: actions !important;
    justify-self: end !important;
    align-self: center !important;
    padding: 0 !important;
    border: none !important;
  }

  #view-tax-rules table.data-table tbody tr td:nth-child(6) .action-btns {
    justify-content: flex-end !important;
    gap: 6px !important;
  }

  /* ========================================================================
     5. Shipping Rules Mobile Card Layout (Image 5)
     Transforms shipping matrix into neat responsive cards with zones and rates
     ======================================================================== */
  #view-shipping-rules table.data-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  #view-shipping-rules table.data-table thead {
    display: none !important;
  }

  #view-shipping-rules table.data-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 0 12px 0 !important;
  }

  #view-shipping-rules .table-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  #view-shipping-rules .table-card .table-header-bar {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 12px !important;
    padding: 12px 16px !important;
  }

  #view-shipping-rules .table-card .table-responsive {
    overflow-x: visible !important;
    padding: 0 !important;
    background: transparent !important;
  }

  #view-shipping-rules .metrics-grid .stat-card:last-child {
    grid-column: span 2;
  }

  #view-shipping-rules table.data-table tbody tr {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "title title"
      "zone zone"
      "fee condition"
      "status actions" !important;
    gap: 10px !important;
    align-items: center !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 14px 16px !important;
    margin-bottom: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #view-shipping-rules table.data-table tbody tr:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(65, 150, 255, 0.12) !important;
  }

  #view-shipping-rules table.data-table tbody tr:has(td[colspan]) {
    display: block !important;
    text-align: center !important;
  }

  #view-shipping-rules table.data-table tbody tr td[colspan] {
    display: block !important;
    width: 100% !important;
    padding: 24px 16px !important;
    border: none !important;
  }

  /* Cell 1: Shipping Rule Title */
  #view-shipping-rules table.data-table tbody tr td:nth-child(1) {
    grid-area: title !important;
    padding: 0 !important;
    border: none !important;
    font-size: 14.5px !important;
    color: var(--text-primary) !important;
  }

  /* Cell 2: Delivery Zone */
  #view-shipping-rules table.data-table tbody tr td:nth-child(2) {
    grid-area: zone !important;
    padding: 6px 12px !important;
    background: var(--surface-secondary) !important;
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border) !important;
    font-size: 12.5px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Cell 3: Delivery Fee */
  #view-shipping-rules table.data-table tbody tr td:nth-child(3) {
    grid-area: fee !important;
    padding: 0 !important;
    border: none !important;
    font-size: 15px !important;
    font-weight: 800 !important;
  }

  /* Cell 4: Free Delivery Threshold Condition */
  #view-shipping-rules table.data-table tbody tr td:nth-child(4) {
    grid-area: condition !important;
    justify-self: end !important;
    text-align: right !important;
    padding: 0 !important;
    border: none !important;
    font-size: 12px !important;
    color: var(--text-secondary) !important;
  }

  /* Cell 5: Status Toggle Button */
  #view-shipping-rules table.data-table tbody tr td:nth-child(5) {
    grid-area: status !important;
    justify-self: start !important;
    align-self: center !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Cell 6: Action Buttons */
  #view-shipping-rules table.data-table tbody tr td:nth-child(6) {
    grid-area: actions !important;
    justify-self: end !important;
    align-self: center !important;
    padding: 0 !important;
    border: none !important;
  }

  #view-shipping-rules table.data-table tbody tr td:nth-child(6) .action-btns {
    justify-content: flex-end !important;
    gap: 6px !important;
  }

  /* ========================================================================
     6. Special Collections Mobile Card Layout (Batch 2 - Image 1)
     Transforms collections table into sleek responsive cards
     ======================================================================== */
  #view-collections table.data-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  #view-collections table.data-table thead {
    display: none !important;
  }

  #view-collections table.data-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 0 12px 0 !important;
  }

  #view-collections .table-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  #view-collections .table-card .table-header-bar {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 12px !important;
    padding: 12px 16px !important;
  }

  #view-collections .table-card .table-responsive {
    overflow-x: visible !important;
    padding: 0 !important;
    background: transparent !important;
  }

  #view-collections table.data-table tbody tr {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "title id"
      "badge products"
      "status actions" !important;
    gap: 10px !important;
    align-items: center !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 14px 16px !important;
    margin-bottom: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #view-collections table.data-table tbody tr:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(65, 150, 255, 0.12) !important;
  }

  #view-collections table.data-table tbody tr:has(td[colspan]) {
    display: block !important;
    text-align: center !important;
  }

  #view-collections table.data-table tbody tr td[colspan] {
    display: block !important;
    width: 100% !important;
    padding: 24px 16px !important;
    border: none !important;
  }

  /* Cell 1: Collection ID */
  #view-collections table.data-table tbody tr td:nth-child(1) {
    grid-area: id !important;
    justify-self: end !important;
    align-self: flex-start !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Cell 2: Icon + Name */
  #view-collections table.data-table tbody tr td:nth-child(2) {
    grid-area: title !important;
    padding: 0 !important;
    border: none !important;
    min-width: 0 !important;
  }

  /* Cell 3: Badge */
  #view-collections table.data-table tbody tr td:nth-child(3) {
    grid-area: badge !important;
    padding: 0 !important;
    border: none !important;
    justify-self: start !important;
  }

  /* Cell 4: Product Count */
  #view-collections table.data-table tbody tr td:nth-child(4) {
    grid-area: products !important;
    padding: 0 !important;
    border: none !important;
    justify-self: end !important;
    font-size: 13px !important;
  }

  /* Cell 5: Status Toggle Button */
  #view-collections table.data-table tbody tr td:nth-child(5) {
    grid-area: status !important;
    justify-self: start !important;
    align-self: center !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Cell 6: Action Buttons */
  #view-collections table.data-table tbody tr td:nth-child(6) {
    grid-area: actions !important;
    justify-self: end !important;
    align-self: center !important;
    padding: 0 !important;
    border: none !important;
  }

  #view-collections table.data-table tbody tr td:nth-child(6) .action-btns {
    justify-content: flex-end !important;
    gap: 6px !important;
  }

  /* ========================================================================
     7. Bundle Deals & Combo Packs Mobile Card Layout (Batch 2 - Image 2)
     Transforms bundle deals list into compact cards with regular, combo & savings
     ======================================================================== */
  #view-bundle-deals table.data-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  #view-bundle-deals table.data-table thead {
    display: none !important;
  }

  #view-bundle-deals table.data-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 0 12px 0 !important;
  }

  #view-bundle-deals .table-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  #view-bundle-deals .table-card .table-header-bar {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 12px !important;
    padding: 12px 16px !important;
  }

  #view-bundle-deals .table-card .table-responsive {
    overflow-x: visible !important;
    padding: 0 !important;
    background: transparent !important;
  }

  #view-bundle-deals table.data-table tbody tr {
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    grid-template-areas:
      "title title title"
      "regular combo discount"
      "status status actions" !important;
    gap: 10px !important;
    align-items: center !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 14px 16px !important;
    margin-bottom: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #view-bundle-deals table.data-table tbody tr:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(65, 150, 255, 0.12) !important;
  }

  #view-bundle-deals table.data-table tbody tr:has(td[colspan]) {
    display: block !important;
    text-align: center !important;
  }

  #view-bundle-deals table.data-table tbody tr td[colspan] {
    display: block !important;
    width: 100% !important;
    padding: 24px 16px !important;
    border: none !important;
  }

  /* Cell 1: Bundle Title & Items */
  #view-bundle-deals table.data-table tbody tr td:nth-child(1) {
    grid-area: title !important;
    padding: 0 0 10px 0 !important;
    border: none !important;
    border-bottom: 1px dashed var(--border) !important;
    width: 100% !important;
  }

  /* Cell 2: Regular Price */
  #view-bundle-deals table.data-table tbody tr td:nth-child(2) {
    grid-area: regular !important;
    padding: 0 !important;
    border: none !important;
    font-size: 13px !important;
  }

  /* Cell 3: Combo Price */
  #view-bundle-deals table.data-table tbody tr td:nth-child(3) {
    grid-area: combo !important;
    padding: 0 !important;
    border: none !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    color: var(--primary) !important;
  }

  /* Cell 4: Discount Saving Badge */
  #view-bundle-deals table.data-table tbody tr td:nth-child(4) {
    grid-area: discount !important;
    justify-self: end !important;
    align-self: center !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Cell 5: Status Toggle Button */
  #view-bundle-deals table.data-table tbody tr td:nth-child(5) {
    grid-area: status !important;
    justify-self: start !important;
    align-self: center !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Cell 6: Action Buttons */
  #view-bundle-deals table.data-table tbody tr td:nth-child(6) {
    grid-area: actions !important;
    justify-self: end !important;
    align-self: center !important;
    padding: 0 !important;
    border: none !important;
  }

  #view-bundle-deals table.data-table tbody tr td:nth-child(6) .action-btns {
    justify-content: flex-end !important;
    gap: 6px !important;
  }

  /* ========================================================================
     8. Discount Vouchers & Coupons Mobile Card Layout (Batch 2 - Image 3)
     Transforms coupon table into stylish coupon-ticket cards with zero horizontal overflow
     ======================================================================== */
  #view-vouchers table.data-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  #view-vouchers table.data-table thead {
    display: none !important;
  }

  #view-vouchers table.data-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 0 12px 0 !important;
  }

  #view-vouchers .table-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  #view-vouchers .table-card .table-header-bar {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 12px !important;
    padding: 12px 16px !important;
  }

  #view-vouchers .table-card .table-responsive {
    overflow-x: visible !important;
    padding: 0 !important;
    background: transparent !important;
  }

  #view-vouchers table.data-table tbody tr {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "code discount"
      "minspend expiry"
      "usage usage"
      "status actions" !important;
    gap: 10px !important;
    align-items: center !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 14px 16px !important;
    margin-bottom: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #view-vouchers table.data-table tbody tr:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(65, 150, 255, 0.12) !important;
  }

  #view-vouchers table.data-table tbody tr:has(td[colspan]) {
    display: block !important;
    text-align: center !important;
  }

  #view-vouchers table.data-table tbody tr td[colspan] {
    display: block !important;
    width: 100% !important;
    padding: 24px 16px !important;
    border: none !important;
  }

  /* Cell 1: Voucher Code Badge */
  #view-vouchers table.data-table tbody tr td:nth-child(1) {
    grid-area: code !important;
    justify-self: start !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Cell 2: Discount Value */
  #view-vouchers table.data-table tbody tr td:nth-child(2) {
    grid-area: discount !important;
    justify-self: end !important;
    font-size: 15px !important;
    color: var(--primary) !important;
    font-weight: 800 !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Cell 3: Min Spend Requirement */
  #view-vouchers table.data-table tbody tr td:nth-child(3) {
    grid-area: minspend !important;
    font-size: 12.5px !important;
    color: var(--text-secondary) !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Cell 4: Expiry Date */
  #view-vouchers table.data-table tbody tr td:nth-child(4) {
    grid-area: expiry !important;
    justify-self: end !important;
    font-size: 12px !important;
    color: var(--text-tertiary) !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Cell 5: Usage Counter Pill */
  #view-vouchers table.data-table tbody tr td:nth-child(5) {
    grid-area: usage !important;
    padding: 6px 12px !important;
    background: var(--surface-secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 12px !important;
  }

  /* Cell 6: Status Toggle Button */
  #view-vouchers table.data-table tbody tr td:nth-child(6) {
    grid-area: status !important;
    justify-self: start !important;
    align-self: center !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Cell 7: Action Buttons */
  #view-vouchers table.data-table tbody tr td:nth-child(7) {
    grid-area: actions !important;
    justify-self: end !important;
    align-self: center !important;
    padding: 0 !important;
    border: none !important;
  }

  #view-vouchers table.data-table tbody tr td:nth-child(7) .action-btns {
    justify-content: flex-end !important;
    gap: 6px !important;
  }

  /* ========================================================================
     9. App & Web Issue Reports Mobile Card Layout (Batch 2 - Image 4)
     Transforms 8-column reports table into clean mobile cards with platform and status dropdowns
     ======================================================================== */
  #appReportsTable {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  #appReportsTable thead {
    display: none !important;
  }

  #appReportsTable tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 0 12px 0 !important;
  }

  #view-app-reports .table-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  #view-app-reports .table-card .table-header-bar {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 12px !important;
    padding: 12px 16px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  #view-app-reports .app-reports-filter-actions {
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }

  #view-app-reports .app-report-filter-select,
  #view-app-reports .search-box-wrap {
    width: 100% !important;
  }

  #view-app-reports .table-card .table-responsive {
    overflow-x: visible !important;
    padding: 0 !important;
    background: transparent !important;
  }

  #appReportsTable tbody tr {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "id date"
      "platform category"
      "issue issue"
      "reporter reporter"
      "status actions" !important;
    gap: 10px !important;
    align-items: center !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 14px 16px !important;
    margin-bottom: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #appReportsTable tbody tr:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(65, 150, 255, 0.12) !important;
  }

  #appReportsTable tbody tr:has(td[colspan]) {
    display: block !important;
    text-align: center !important;
  }

  #appReportsTable tbody tr td[colspan] {
    display: block !important;
    width: 100% !important;
    padding: 24px 16px !important;
    border: none !important;
  }

  /* Cell 1: Report ID */
  #appReportsTable tbody tr td:nth-child(1) {
    grid-area: id !important;
    justify-self: start !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Cell 2: Date & Time */
  #appReportsTable tbody tr td:nth-child(2) {
    grid-area: date !important;
    justify-self: end !important;
    font-size: 11.5px !important;
    color: var(--text-tertiary) !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Cell 3: Platform & Device */
  #appReportsTable tbody tr td:nth-child(3) {
    grid-area: platform !important;
    padding: 0 !important;
    border: none !important;
    min-width: 0 !important;
  }

  /* Cell 4: Reporter Details */
  #appReportsTable tbody tr td:nth-child(4) {
    grid-area: reporter !important;
    padding: 8px 12px !important;
    background: var(--surface-secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  /* Cell 5: Category Badge */
  #appReportsTable tbody tr td:nth-child(5) {
    grid-area: category !important;
    justify-self: end !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Cell 6: Issue Title & Description */
  #appReportsTable tbody tr td:nth-child(6) {
    grid-area: issue !important;
    padding: 6px 0 !important;
    border: none !important;
    border-top: 1px dashed var(--border) !important;
    border-bottom: 1px dashed var(--border) !important;
    width: 100% !important;
  }

  /* Cell 7: Status Dropdown */
  #appReportsTable tbody tr td:nth-child(7) {
    grid-area: status !important;
    justify-self: start !important;
    align-self: center !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Cell 8: Action Buttons */
  #appReportsTable tbody tr td:nth-child(8) {
    grid-area: actions !important;
    justify-self: end !important;
    align-self: center !important;
    padding: 0 !important;
    border: none !important;
  }

  #appReportsTable tbody tr td:nth-child(8) .table-actions {
    justify-content: flex-end !important;
    gap: 6px !important;
  }

  /* ========================================================================
     10. Team Members Mobile Card Layout (Batch 2 - Image 5)
     Eliminates vertical single-letter text squishing with roomy, native member cards
     ======================================================================== */
  #view-team-members table.data-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  #view-team-members table.data-table thead {
    display: none !important;
  }

  #view-team-members table.data-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 0 12px 0 !important;
  }

  #view-team-members .table-card:has(#teamMembersTableBody),
  #view-team-members .table-card:last-child {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  #view-team-members .table-card:has(#teamMembersTableBody) .table-header-bar {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 12px !important;
    padding: 12px 16px !important;
  }

  #view-team-members .table-card .table-responsive {
    overflow-x: visible !important;
    padding: 0 !important;
    background: transparent !important;
  }

  #view-team-members .team-toolbar-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  #view-team-members .team-search-wrap,
  #view-team-members .team-filter-wrap {
    width: 100% !important;
  }

  #view-team-members .team-filter-wrap .form-select {
    flex: 1 !important;
  }

  #view-team-members table.data-table tbody tr {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "info role"
      "contact contact"
      "lastactive lastactive"
      "status actions" !important;
    gap: 10px !important;
    align-items: center !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 14px 16px !important;
    margin-bottom: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #view-team-members table.data-table tbody tr:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(65, 150, 255, 0.12) !important;
  }

  #view-team-members table.data-table tbody tr:has(td[colspan]) {
    display: block !important;
    text-align: center !important;
  }

  #view-team-members table.data-table tbody tr td[colspan] {
    display: block !important;
    width: 100% !important;
    padding: 24px 16px !important;
    border: none !important;
  }

  /* Cell 1: Member Identity (No more 1-letter vertical stacking!) */
  #view-team-members table.data-table tbody tr td:nth-child(1) {
    grid-area: info !important;
    padding: 0 !important;
    border: none !important;
    width: auto !important;
    min-width: 0 !important;
  }

  #view-team-members .team-member-info-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
  }

  #view-team-members .team-avatar {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    flex-shrink: 0 !important;
  }

  #view-team-members .team-member-name {
    font-size: 14.5px !important;
    word-break: normal !important;
    white-space: nowrap !important;
    display: block !important;
  }

  /* Cell 2: Contact Details */
  #view-team-members table.data-table tbody tr td:nth-child(2) {
    grid-area: contact !important;
    padding: 8px 12px !important;
    background: var(--surface-secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  /* Cell 3: Current Role Pill */
  #view-team-members table.data-table tbody tr td:nth-child(3) {
    grid-area: role !important;
    justify-self: end !important;
    align-self: flex-start !important;
    padding: 0 !important;
    border: none !important;
    width: auto !important;
  }

  /* Cell 4: Status Toggle Slider */
  #view-team-members table.data-table tbody tr td:nth-child(4) {
    grid-area: status !important;
    justify-self: start !important;
    align-self: center !important;
    padding: 0 !important;
    border: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: auto !important;
  }

  /* Cell 5: Last Active */
  #view-team-members table.data-table tbody tr td:nth-child(5) {
    grid-area: lastactive !important;
    padding: 0 !important;
    border: none !important;
    font-size: 12px !important;
    color: var(--text-tertiary) !important;
    width: auto !important;
  }

  /* Cell 6: Action Buttons */
  #view-team-members table.data-table tbody tr td:nth-child(6) {
    grid-area: actions !important;
    justify-self: end !important;
    align-self: center !important;
    padding: 0 !important;
    border: none !important;
    width: auto !important;
  }

  #view-team-members table.data-table tbody tr td:nth-child(6) .action-btns {
    justify-content: flex-end !important;
    gap: 6px !important;
  }

  /* ========================================================================
     11. Customer Profile Orders Mobile Card Layout (Batch 3 - Image 1)
     Dedicated 6-column architecture (ID/Date, Items, Total, Payment, Status, Actions)
     Eliminates nested inner scrollbars and misaligned cells
     ======================================================================== */
  #custProfileOrdersPanel .table-responsive {
    max-height: none !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .profile-orders-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  .profile-orders-table thead {
    display: none !important;
  }

  .profile-orders-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 0 12px 0 !important;
  }

  .profile-orders-table tbody tr {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "header total"
      "items items"
      "payment payment"
      "status actions" !important;
    gap: 10px !important;
    align-items: center !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 14px 16px !important;
    margin-bottom: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .profile-orders-table tbody tr:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(65, 150, 255, 0.12) !important;
  }

  .profile-orders-table tbody tr:has(td[colspan]) {
    display: block !important;
    text-align: center !important;
  }

  .profile-orders-table tbody tr td[colspan] {
    display: block !important;
    width: 100% !important;
    padding: 32px 16px !important;
    border: none !important;
  }

  /* Cell 1: Order ID & Date */
  .profile-orders-table tbody tr td:nth-child(1) {
    grid-area: header !important;
    padding: 0 !important;
    border: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 3px !important;
    min-width: 0 !important;
  }

  /* Cell 2: Ordered Items Summary */
  .profile-orders-table tbody tr td:nth-child(2) {
    grid-area: items !important;
    padding: 0 !important;
    border: none !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    width: 100% !important;
    background: transparent !important;
  }

  /* Cell 3: Total Amount (Top-Right bold primary highlight) */
  .profile-orders-table tbody tr td:nth-child(3) {
    grid-area: total !important;
    padding: 0 !important;
    border: none !important;
    text-align: right !important;
    justify-self: end !important;
    align-self: flex-start !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    color: var(--primary) !important;
    white-space: nowrap !important;
  }

  .profile-orders-table tbody tr td:nth-child(3) strong {
    font-size: 16px !important;
    color: var(--primary) !important;
    font-weight: 800 !important;
  }

  /* Cell 4: Payment Details (Gateways, TrxID, Phone) */
  .profile-orders-table tbody tr td:nth-child(4) {
    grid-area: payment !important;
    padding: 8px 12px !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    background: var(--surface-secondary) !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    width: 100% !important;
  }

  /* Cell 5: Delivery Status Badge */
  .profile-orders-table tbody tr td:nth-child(5) {
    grid-area: status !important;
    padding: 0 !important;
    border: none !important;
    align-self: center !important;
    justify-self: start !important;
  }

  /* Cell 6: Action Buttons (Print invoice, View details) */
  .profile-orders-table tbody tr td:nth-child(6) {
    grid-area: actions !important;
    padding: 0 !important;
    border: none !important;
    justify-self: end !important;
    align-self: center !important;
  }

  .profile-orders-table tbody tr td:nth-child(6) .action-btns {
    justify-content: flex-end !important;
    gap: 6px !important;
  }

  /* ========================================================================
     12. Customer Profile Activity Audit Trail Mobile Card Layout (Batch 3 - Image 2)
     Eliminates wide 140px timestamp squishing and nested scrollbar box
     ======================================================================== */
  #custProfileActivityPanel .cust-acts-list-wrap {
    max-height: none !important;
    overflow: visible !important;
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  #custProfileActivityPanel .member-act-item {
    flex-direction: column !important;
    gap: 8px !important;
    align-items: stretch !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 12px 14px !important;
    margin-bottom: 0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    box-sizing: border-box !important;
    width: 100% !important;
  }

  #custProfileActivityPanel .member-act-time {
    min-width: 0 !important;
    width: 100% !important;
    font-size: 11.5px !important;
    color: var(--text-tertiary) !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
  }

  #custProfileActivityPanel .member-act-body {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* ========================================================================
     13. Flash Sales Management Mobile Card Layout & Responsive Toolbar (Batch 3 - Image 3)
     Full-width responsive filtering toolbar + 7-column card architecture
     ======================================================================== */
  .flash-sales-toolbar {
    margin-bottom: 12px !important;
  }

  .flash-sales-toolbar .toolbar-left-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    align-items: stretch !important;
  }

  .flash-sales-toolbar .toolbar-label {
    display: none !important;
  }

  .flash-sales-toolbar .toolbar-select,
  .flash-sales-toolbar .custom-select-wrap.has-toolbar-select {
    width: 100% !important;
    min-width: 0 !important;
  }

  .flash-sales-toolbar .search-box-inline {
    width: 100% !important;
    margin-top: 4px !important;
  }

  .flash-sales-toolbar .search-box-inline input {
    flex: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  #view-flash-sales table.data-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  #view-flash-sales table.data-table thead {
    display: none !important;
  }

  #view-flash-sales table.data-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 0 12px 0 !important;
  }

  #view-flash-sales .table-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  #view-flash-sales .table-card .table-responsive {
    overflow-x: visible !important;
    padding: 0 !important;
    background: transparent !important;
  }

  #view-flash-sales table.data-table tbody tr {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "title status"
      "start start"
      "end end"
      "created actions" !important;
    gap: 8px 10px !important;
    align-items: center !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 14px 16px !important;
    margin-bottom: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #view-flash-sales table.data-table tbody tr:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(65, 150, 255, 0.12) !important;
  }

  #view-flash-sales table.data-table tbody tr:has(td[colspan]) {
    display: block !important;
    text-align: center !important;
  }

  #view-flash-sales table.data-table tbody tr td[colspan] {
    display: block !important;
    width: 100% !important;
    padding: 32px 16px !important;
    border: none !important;
  }

  /* Cell 1: Campaign Title & Products Count */
  #view-flash-sales table.data-table tbody tr td:nth-child(1) {
    grid-area: title !important;
    padding: 0 !important;
    border: none !important;
    min-width: 0 !important;
  }

  /* Cell 2: Status Badge */
  #view-flash-sales table.data-table tbody tr td:nth-child(2) {
    grid-area: status !important;
    justify-self: end !important;
    align-self: flex-start !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Cell 3: Start Time */
  #view-flash-sales table.data-table tbody tr td:nth-child(3) {
    grid-area: start !important;
    padding: 6px 10px !important;
    background: var(--surface-secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 12px !important;
    color: var(--text-secondary) !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #view-flash-sales table.data-table tbody tr td:nth-child(3)::before {
    content: "অফার শুরু:";
    font-weight: 700;
    color: var(--primary);
    margin-right: 6px !important;
    display: inline-block !important;
  }

  /* Cell 4: End Time */
  #view-flash-sales table.data-table tbody tr td:nth-child(4) {
    grid-area: end !important;
    padding: 6px 10px !important;
    background: var(--surface-secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 12px !important;
    color: var(--text-secondary) !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #view-flash-sales table.data-table tbody tr td:nth-child(4)::before {
    content: "অফার শেষ:";
    font-weight: 700;
    color: #EF4444;
    margin-right: 6px !important;
    display: inline-block !important;
  }

  /* Cell 5: Created Date */
  #view-flash-sales table.data-table tbody tr td:nth-child(5) {
    grid-area: created !important;
    padding: 0 !important;
    border: none !important;
    font-size: 11px !important;
    color: var(--text-tertiary) !important;
    align-self: center !important;
    display: flex !important;
    align-items: center !important;
  }

  #view-flash-sales table.data-table tbody tr td:nth-child(5)::before {
    content: "ফ্ল্যাশ বানানোর তারিখ:";
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 6px !important;
    display: inline-block !important;
  }

  /* Cell 6: Smart Action Buttons */
  #view-flash-sales table.data-table tbody tr td:nth-child(6) {
    grid-area: actions !important;
    justify-self: end !important;
    align-self: center !important;
    padding: 0 !important;
    border: none !important;
  }

  #view-flash-sales .action-btns,
  #view-flash-sales .smart-actions-wrap {
    justify-content: flex-end !important;
    display: flex !important;
    gap: 6px !important;
  }

  /* ========================================================================
     14. Customer Messaging Hub Mobile & Tablet Single-Pane UI (Batch 3 & 6 - Image 2)
     WhatsApp/Messenger style: Contacts list first (Image 2), clicking name opens full chat
     ======================================================================== */
  #view-messages .page-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  #view-messages .page-actions {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  #view-messages .page-actions .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .msg-hub-layout {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: calc(100vh - 190px) !important;
    gap: 0 !important;
    margin-top: 10px !important;
  }

  /* Default Contacts View (Image 2) */
  .msg-contacts-card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: calc(100vh - 190px) !important;
    min-height: 520px !important;
    max-height: none !important;
    flex: 1 !important;
    border-radius: var(--radius-md) !important;
  }

  .msg-contacts-list {
    flex: 1 !important;
    height: 100% !important;
    max-height: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .msg-sidebar-resizer {
    display: none !important;
  }

  /* Default Chat View: Hidden until a contact is tapped */
  .msg-chat-window-card {
    display: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: calc(100vh - 190px) !important;
    min-height: 520px !important;
    border-radius: var(--radius-md) !important;
  }

  /* When Contact is Clicked: Hide Contacts, Show Full Chat View */
  .msg-hub-layout.mobile-chat-active .msg-contacts-card {
    display: none !important;
  }

  .msg-hub-layout.mobile-chat-active .msg-chat-window-card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: calc(100vh - 190px) !important;
    min-height: 520px !important;
  }

  .msg-hub-layout.mobile-chat-active .msg-timeline {
    flex: 1 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-height: none !important;
    padding: 14px 12px !important;
  }

  .msg-chat-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 10px 14px !important;
    border-bottom: 1px solid var(--border) !important;
  }

  .chat-header-user {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 1 !important;
    min-width: 0 !important;
  }

  .btn-msg-back {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 50% !important;
    border: 1px solid var(--border) !important;
    background: var(--surface) !important;
    color: var(--text-primary) !important;
    cursor: pointer !important;
    font-size: 15px !important;
    margin-right: 4px !important;
    flex-shrink: 0 !important;
  }
  .btn-msg-back:hover,
  .btn-msg-back:active {
    background: var(--surface-secondary) !important;
    color: var(--primary) !important;
  }

  .chat-user-avatar {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    font-size: 18px !important;
    flex-shrink: 0 !important;
  }

  .chat-user-name-row {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
  }

  .chat-user-name-row h3 {
    font-size: 14px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .active-channel-badge {
    font-size: 10.5px !important;
    padding: 2px 6px !important;
  }

  .chat-user-meta {
    font-size: 11px !important;
    margin: 2px 0 0 0 !important;
    color: var(--text-secondary) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .chat-header-actions {
    flex-shrink: 0 !important;
  }

  .msg-bubble {
    max-width: 88% !important;
  }

  .msg-templates-bar {
    flex-wrap: nowrap !important;
    gap: 8px !important;
    padding: 6px 12px !important;
  }

  .templates-chips-scroll {
    width: auto !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }

  .templates-chips-scroll::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  /* ========================================================================
     15. Categories Directory Mobile Card Layout (Batch 3 - Image 5)
     Eliminates vertical single-letter category title squishing
     ======================================================================== */
  #view-categories table.data-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  #view-categories table.data-table thead {
    display: none !important;
  }

  #view-categories table.data-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 0 12px 0 !important;
  }

  #view-categories .table-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  #view-categories .table-card .table-responsive {
    overflow-x: visible !important;
    padding: 0 !important;
    background: transparent !important;
  }

  #view-categories table.data-table tbody tr {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "title code"
      "products products"
      "status actions" !important;
    gap: 10px !important;
    align-items: center !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 14px 16px !important;
    margin-bottom: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #view-categories table.data-table tbody tr:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(65, 150, 255, 0.12) !important;
  }

  #view-categories table.data-table tbody tr:has(td[colspan]) {
    display: block !important;
    text-align: center !important;
  }

  #view-categories table.data-table tbody tr td[colspan] {
    display: block !important;
    width: 100% !important;
    padding: 32px 16px !important;
    border: none !important;
  }

  /* Cell 1: Category Code / ID */
  #view-categories table.data-table tbody tr td:nth-child(1) {
    grid-area: code !important;
    justify-self: end !important;
    align-self: flex-start !important;
    padding: 0 !important;
    border: none !important;
    width: auto !important;
  }

  #view-categories table.data-table tbody tr td:nth-child(1) code {
    background: var(--surface-secondary) !important;
    border: 1px solid var(--border) !important;
    padding: 2px 8px !important;
    border-radius: 6px !important;
    font-size: 11.5px !important;
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
  }

  /* Cell 2: Category Name & Icon (No more single-letter vertical squishing!) */
  #view-categories table.data-table tbody tr td:nth-child(2) {
    grid-area: title !important;
    padding: 0 !important;
    border: none !important;
    min-width: 0 !important;
  }

  #view-categories table.data-table tbody tr td:nth-child(2) strong {
    font-size: 14.5px !important;
    word-break: normal !important;
    white-space: normal !important;
    display: block !important;
  }

  /* Cell 3: Total Products Count */
  #view-categories table.data-table tbody tr td:nth-child(3) {
    grid-area: products !important;
    padding: 8px 12px !important;
    background: var(--surface-secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 13px !important;
  }

  #view-categories table.data-table tbody tr td:nth-child(3)::before {
    content: "মোট সংরক্ষিত পণ্য:";
    font-size: 11.5px;
    color: var(--text-secondary);
    font-weight: 500;
  }

  /* Cell 4: Status Toggle Button */
  #view-categories table.data-table tbody tr td:nth-child(4) {
    grid-area: status !important;
    justify-self: start !important;
    align-self: center !important;
    padding: 0 !important;
    border: none !important;
    width: auto !important;
  }

  /* Cell 5: Action Buttons (Edit & Delete) */
  #view-categories table.data-table tbody tr td:nth-child(5) {
    grid-area: actions !important;
    justify-self: end !important;
    align-self: center !important;
    padding: 0 !important;
    border: none !important;
    width: auto !important;
  }

  #view-categories table.data-table tbody tr td:nth-child(5) .action-btns {
    justify-content: flex-end !important;
    gap: 6px !important;
  }

  /* ========================================================================
     16. Customer Directory Mobile Card Architecture & Responsive Toolbar (Batch 4 - Image 1)
     Transforms customers table into balanced, executive mobile cards
     ======================================================================== */
  #view-customers .cust-toolbar-card {
    padding: 12px 14px !important;
    margin-bottom: 12px !important;
  }

  #view-customers .cust-toolbar-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
  }

  #view-customers .cust-search-wrap {
    width: 100% !important;
  }

  #view-customers .cust-filter-wrap {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }

  #view-customers .cust-filter-wrap label {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  #view-customers .cust-filter-wrap .form-select,
  #view-customers .cust-filter-wrap .custom-select-wrap {
    flex: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  #view-customers .cust-stat-badge {
    width: 100% !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  #customersTable {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  #customersTable thead {
    display: none !important;
  }

  #customersTable tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 0 12px 0 !important;
  }

  #view-customers .table-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  #view-customers .table-card .table-responsive {
    overflow-x: visible !important;
    padding: 0 !important;
    background: transparent !important;
  }

  #customersTable tbody tr {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "info tier"
      "contact contact"
      "orders spent"
      "actions actions" !important;
    gap: 10px !important;
    align-items: center !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 14px 16px !important;
    margin-bottom: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #customersTable tbody tr:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(65, 150, 255, 0.12) !important;
  }

  #customersTable tbody tr:has(td[colspan]) {
    display: block !important;
    text-align: center !important;
  }

  #customersTable tbody tr td[colspan] {
    display: block !important;
    width: 100% !important;
    padding: 32px 16px !important;
    border: none !important;
  }

  /* Cell 1: Customer Identity & Address */
  #customersTable tbody tr td:nth-child(1) {
    grid-area: info !important;
    padding: 0 !important;
    border: none !important;
    min-width: 0 !important;
  }

  /* Cell 5: Loyalty Tier Badge (Top-Right) */
  #customersTable tbody tr td:nth-child(5) {
    grid-area: tier !important;
    justify-self: end !important;
    align-self: flex-start !important;
    padding: 0 !important;
    border: none !important;
    width: auto !important;
  }

  /* Cell 2: Contact Details (Phone & Email) */
  #customersTable tbody tr td:nth-child(2) {
    grid-area: contact !important;
    padding: 8px 12px !important;
    background: var(--surface-secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    box-sizing: border-box !important;
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }

  /* Cell 3: Orders Count Chip */
  #customersTable tbody tr td:nth-child(3) {
    grid-area: orders !important;
    padding: 0 !important;
    border: none !important;
    justify-self: start !important;
    width: auto !important;
  }

  /* Cell 4: Lifetime Spent Amount */
  #customersTable tbody tr td:nth-child(4) {
    grid-area: spent !important;
    padding: 0 !important;
    border: none !important;
    justify-self: end !important;
    text-align: right !important;
    width: auto !important;
  }

  /* Cell 6: Action Buttons (Google Map, Edit, View Profile) */
  #customersTable tbody tr td:nth-child(6) {
    grid-area: actions !important;
    padding: 0 !important;
    border: none !important;
    width: 100% !important;
  }

  #customersTable tbody tr td:nth-child(6) .cust-action-group {
    justify-content: flex-end !important;
    gap: 8px !important;
    width: 100% !important;
  }

  /* ========================================================================
     17. App Reports Global Tabs & Full-Width Filters (Batch 4 - Image 2)
     Eliminates narrow 155px dropdown whitespace and aligns platform tabs
     ======================================================================== */
  #appReportsTabsFilter {
    width: 100% !important;
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 4px !important;
    box-sizing: border-box !important;
  }

  #appReportsTabsFilter::-webkit-scrollbar {
    display: none !important;
  }

  #appReportsTabsFilter .tab-btn {
    flex: 1 !important;
    justify-content: center !important;
    white-space: nowrap !important;
    padding: 8px 10px !important;
    font-size: 12px !important;
    text-align: center !important;
  }

  #view-app-reports .custom-select-wrap.has-report-filter {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
  }

  #view-app-reports .custom-select-wrap.has-report-filter .custom-select-trigger {
    width: 100% !important;
    justify-content: space-between !important;
  }

  #view-app-reports .search-box-wrap {
    width: 100% !important;
    max-width: 100% !important;
  }

  #view-app-reports .search-box-wrap input {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* ========================================================================
     18. Activity Audit Log Mobile Card Layout, Multi-Row Wrap Tabs & Toolbar Standard (Batch 5 Refinement)
     Fixes: 
     - Hidden thead and full-width block cards (no squeezed columns or blank space on right)
     - Tabs wrap onto multiple rows so all 8 category pills are 100% visible on mobile
     - Fixes search box height and prevents floating detached search icon
     - Full-width user filter box, date stepper, reset button and count chip
     ======================================================================== */
  #view-activity-log .analytics-toolbar-card {
    padding: 12px 14px !important;
  }

  /* 1. Category Tabs: Multi-Row Wrap Layout so all 8 tabs are visible on mobile */
  #view-activity-log .act-category-tabs-wrap {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 0 !important;
    overflow: visible !important;
  }
  #view-activity-log .act-category-pills-list {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 7px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background: var(--surface-secondary) !important;
    padding: 8px !important;
    border-radius: var(--radius-card) !important;
    border: 1px solid var(--border) !important;
    overflow: visible !important;
  }
  #view-activity-log .act-category-pill {
    flex: 0 1 auto !important;
    white-space: nowrap !important;
    font-size: 12px !important;
    padding: 7px 11px !important;
    border-radius: var(--radius-sm) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    box-shadow: none !important;
  }
  #view-activity-log .act-category-pill i {
    font-size: 12px !important;
  }

  /* 2. Toolbar Controls: Strict 40px Full-Width Stack */
  #view-activity-log .act-toolbar-controls {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
    padding-top: 12px !important;
    margin-top: 12px !important;
    border-top: 1px solid var(--border) !important;
  }

  /* Fixed Search Box: Prevents vertical stretching and floating icon */
  #view-activity-log .act-search-box {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    flex: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  #view-activity-log .act-search-box .search-icon {
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: var(--text-tertiary) !important;
    font-size: 14px !important;
    pointer-events: none !important;
    z-index: 2 !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
  }
  #view-activity-log .act-search-box .search-input {
    width: 100% !important;
    height: 40px !important;
    line-height: 40px !important;
    padding: 0 14px 0 38px !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 13px !important;
    color: var(--text-primary) !important;
    box-sizing: border-box !important;
  }

  /* User Filter Dropdown */
  #view-activity-log .act-user-filter-box {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 40px !important;
    flex: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  #view-activity-log .act-user-select {
    width: 100% !important;
    height: 40px !important;
    padding: 0 34px 0 14px !important;
    font-size: 13px !important;
    box-sizing: border-box !important;
    border-radius: var(--radius-sm) !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
  }
  #view-activity-log .act-user-select-chevron {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    pointer-events: none !important;
    font-size: 11px !important;
    color: var(--text-tertiary) !important;
  }

  /* Date Stepper Filter Mount */
  #view-activity-log #activityDateFilterMount,
  #view-activity-log .act-date-filter-mount {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  #view-activity-log .act-date-filter-mount .gdf-smart-wrapper,
  #view-activity-log .act-date-filter-mount .gdf-bar {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    justify-content: space-between !important;
  }
  #view-activity-log .gdf-bar .gdf-pill-btn {
    font-size: 12px !important;
  }

  /* Reset Filter Button & Counter Badge */
  #view-activity-log #btnResetActivityFilters,
  #view-activity-log .act-btn-reset {
    width: 100% !important;
    height: 38px !important;
    justify-content: center !important;
    font-size: 13px !important;
    box-sizing: border-box !important;
  }
  #view-activity-log #actFilteredCountBadge,
  #view-activity-log .act-count-chip {
    align-self: flex-start !important;
    font-size: 12px !important;
    padding: 4px 10px !important;
  }

  /* 3. Activity Table Container: Display Block, Hide Thead, 100% Full-Width Mobile Cards */
  #activityTableWrap,
  #view-activity-log .table-responsive {
    overflow-x: visible !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    width: 100% !important;
  }
  #view-activity-log table.data-table {
    display: block !important;
    width: 100% !important;
    border: none !important;
  }
  #view-activity-log table.data-table thead {
    display: none !important;
  }
  #view-activity-log table.data-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
  }
  #view-activity-log table.data-table tbody tr {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    align-items: stretch !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 14px 16px !important;
    margin-bottom: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  #view-activity-log table.data-table tbody tr:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(65, 150, 255, 0.12) !important;
  }
  #view-activity-log table.data-table tbody tr td {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    border: none !important;
    box-sizing: border-box !important;
  }
  #view-activity-log table.data-table tbody tr:has(td[colspan]) {
    display: block !important;
    text-align: center !important;
  }
  #view-activity-log table.data-table tbody tr td[colspan] {
    display: block !important;
    width: 100% !important;
    padding: 32px 16px !important;
    border: none !important;
  }

  /* Cell 2: User/Operator (Top Row - 100% Full Width) */
  #view-activity-log table.data-table tbody tr td:nth-child(2) {
    order: 1 !important;
    width: 100% !important;
    padding: 0 !important;
    border: none !important;
    min-width: 0 !important;
  }
  #view-activity-log .act-user-cell {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
  }
  #view-activity-log .act-user-avatar {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    flex-shrink: 0 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
  }
  #view-activity-log .act-user-meta {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    flex: 1 !important;
    min-width: 0 !important;
  }
  #view-activity-log .act-user-name {
    font-size: 14.5px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  #view-activity-log .act-user-role-wrap {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  #view-activity-log .act-role-badge {
    white-space: nowrap !important;
    word-break: keep-all !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 3px 8px !important;
    font-size: 11.5px !important;
    border-radius: 6px !important;
    flex-shrink: 0 !important;
  }
  #view-activity-log .act-phone-tag {
    white-space: nowrap !important;
    font-size: 11.5px !important;
    color: var(--text-secondary) !important;
  }

  /* Cell 1: Timestamp Strip (Row 2 - Full Width Bar) */
  #view-activity-log table.data-table tbody tr td:nth-child(1) {
    order: 2 !important;
    width: 100% !important;
    padding: 0 !important;
    border: none !important;
  }
  #view-activity-log .act-time-wrap {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    background: var(--surface-secondary) !important;
    border: 1px solid var(--border) !important;
    padding: 6px 12px !important;
    border-radius: var(--radius-sm) !important;
    box-sizing: border-box !important;
  }
  #view-activity-log .act-rel-time {
    white-space: nowrap !important;
    font-weight: 600 !important;
    color: var(--primary) !important;
    font-size: 12px !important;
  }
  #view-activity-log .act-exact-time {
    white-space: nowrap !important;
    color: var(--text-secondary) !important;
    font-size: 11.5px !important;
  }

  /* Cell 3: Event & Category Tag (Row 3) */
  #view-activity-log table.data-table tbody tr td:nth-child(3) {
    order: 3 !important;
    width: 100% !important;
    padding: 0 !important;
    border: none !important;
  }
  #view-activity-log .act-event-wrap {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    width: 100% !important;
  }
  #view-activity-log .act-event-title {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    line-height: 1.4 !important;
  }
  #view-activity-log .act-cat-row {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  /* Cell 4: Modification Details (Row 4) */
  #view-activity-log table.data-table tbody tr td:nth-child(4) {
    order: 4 !important;
    width: 100% !important;
    padding: 10px 12px !important;
    background: var(--surface-secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    box-sizing: border-box !important;
    font-size: 12.5px !important;
    line-height: 1.5 !important;
    color: var(--text-secondary) !important;
  }

  /* Cell 5: Network & Device (Row 5) */
  #view-activity-log table.data-table tbody tr td:nth-child(5) {
    order: 5 !important;
    width: 100% !important;
    padding: 4px 0 0 0 !important;
    border: none !important;
    border-top: 1px dashed var(--border) !important;
  }
  #view-activity-log .act-client-meta {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    font-size: 11.5px !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    color: var(--text-tertiary) !important;
  }

  /* ========================================================================
     19. Data Backup & Export Mobile Touch Responsive Layout (Batch 4 - Image 4)
     Fixes wrapped step buttons, scrolling tabs & zero overflow multi-select grid
     ======================================================================== */
  .backup-tabs-wrap {
    width: 100% !important;
    overflow: hidden !important;
  }

  .backup-tabs-list {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
    gap: 6px !important;
    padding: 6px !important;
  }

  .backup-tab-btn {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    padding: 8px 14px !important;
    font-size: 12.5px !important;
  }

  .backup-step-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .backup-step-header > div:last-child {
    margin-left: 0 !important;
    width: 100% !important;
    display: flex !important;
    gap: 8px !important;
  }

  .backup-step-header > div:last-child .btn {
    flex: 1 !important;
    justify-content: center !important;
    white-space: nowrap !important;
    padding: 8px 12px !important;
  }

  .backup-entity-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .backup-entity-card {
    padding: 10px 12px !important;
    gap: 8px !important;
  }

  .backup-entity-card .backup-entity-title {
    font-size: 13.5px !important;
  }

  .backup-entity-card .backup-entity-desc {
    font-size: 11.5px !important;
  }

  /* ========================================================================
     20. Role Permission Matrix Mobile Sticky Header & Feature Architecture (Batch 4 - Image 5)
     Enables smooth touch horizontal matrix browsing with sticky left column
     ======================================================================== */
  #rolesMatrixSection .table-responsive {
    -webkit-overflow-scrolling: touch !important;
    overflow-x: auto !important;
    scrollbar-width: thin !important;
    max-width: 100% !important;
  }

  .perm-matrix-table {
    min-width: 580px !important;
  }

  .perm-matrix-table th.perm-col-feature,
  .perm-matrix-table td.perm-rule-title-cell {
    position: sticky !important;
    left: 0 !important;
    z-index: 5 !important;
    background: var(--surface) !important;
    min-width: 145px !important;
    max-width: 165px !important;
    width: 155px !important;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.06) !important;
  }

  .perm-matrix-table thead th.perm-col-feature {
    z-index: 6 !important;
    background: var(--surface) !important;
  }

  .perm-matrix-table .perm-module-header-row td {
    position: sticky !important;
    left: 0 !important;
    z-index: 4 !important;
  }

  .perm-matrix-table th.perm-col-role,
  .perm-matrix-table td.perm-switch-cell {
    min-width: 80px !important;
    width: 85px !important;
    text-align: center !important;
  }

  .perm-matrix-table td.perm-switch-cell {
    background: var(--surface) !important;
  }



  /* General Data Table Fallback for remaining audit/system tables */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
    width: 100%;
    scrollbar-width: thin;
  }
  .data-table th,
  .data-table td {
    padding: 10px 12px;
    font-size: 13px;
  }
  .table-footer {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    text-align: center;
  }
  .pagination-controls {
    width: 100%;
    justify-content: center;
  }
  .modal-overlay {
    padding: 10px;
  }
  .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 94vh !important;
    border-radius: var(--radius-lg) !important;
  }
  .modal-header {
    padding: 14px 16px;
  }
  .modal-title {
    font-size: 16px;
  }
  .modal-body {
    padding: 14px 16px;
  }
  .modal-footer {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .modal-footer .btn {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }
  .form-grid-2,
  .form-grid-3,
  .form-grid-4,
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .global-date-filter {
    width: 100%;
  }
  .gdf-bar {
    flex-wrap: wrap;
    width: 100%;
    gap: 8px;
  }
  .gdf-left-group {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }
  .gdf-left-group::-webkit-scrollbar {
    display: none;
  }
  .gdf-right-group {
    width: 100%;
    justify-content: space-between;
  }
  .gdf-stepper {
    flex: 1;
    justify-content: space-between;
  }
  .gdf-smart-popover {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 340px;
    margin: auto;
  }
  .cust-profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
  }
  .cust-profile-actions {
    width: 100%;
    justify-content: center;
  }
  .cust-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }
  .backup-grid,
  .settings-grid {
    grid-template-columns: 1fr !important;
  }
  .backup-actions-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
}

/* 4. Compact Mobile Devices (max-width: 480px) */
@media (max-width: 480px) {
  .admin-topbar {
    height: auto;
    padding: 8px 10px 10px;
    gap: 0;
  }
  .topbar-row-main {
    gap: 6px;
  }
  /* Compact Mobile Unified 36x36px Topbar Buttons */
  .menu-toggle-btn,
  .mobile-search-toggle-btn,
  #topbarNotificationBtn,
  #topbarAdminProfile,
  #topbarMoreBtn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    border-radius: 9px !important;
    padding: 0 !important;
  }
  #topbarAdminProfile .profile-avatar {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    font-size: 12px !important;
  }
  .mobile-brand-title {
    font-size: 16px !important;
  }
  .topbar-right {
    gap: 6px !important;
  }
  .topbar-search-row.open {
    max-height: 56px !important;
    margin-top: 8px !important;
  }
  .topbar-search-row .search-input {
    height: 38px;
    font-size: 12.5px;
    padding: 0 12px 0 34px;
    border-radius: 10px;
  }
  .topbar-search-row .search-bar-wrap i {
    left: 12px;
    font-size: 13px;
  }
  .topbar-overflow-dropdown {
    width: 275px;
  }
  .admin-content {
    padding: 12px 8px;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }
  .stat-card {
    padding: 10px 10px;
    min-width: 0;
  }
  .stat-info {
    min-width: 0;
  }
  .stat-value {
    font-size: 16px;
    font-weight: 700;
  }
  .stat-label {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .stat-trend {
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .stat-icon-wrap {
    width: 32px;
    height: 32px;
    font-size: 13px;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .metrics-grid > .stat-card:nth-child(odd):last-child {
    grid-column: span 2;
  }
  .table-header-bar {
    padding: 12px 10px;
  }
  .table-title {
    font-size: 15px;
  }
  .modal-card {
    max-height: 96vh;
    border-radius: 12px;
  }
  .modal-footer .btn {
    flex: 1 1 100%;
    width: 100%;
  }
  .cust-kpi-grid {
    grid-template-columns: 1fr !important;
  }


  /* ========================================================================
     21. Recycle Bin Mobile Card Grid & Action Optimization (Batch 5 - Image 2)
     Transforms 4-col desktop table into touch cards with 100% visible restore & purge buttons
     ======================================================================== */
  #view-trash .page-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  #view-trash .page-header .page-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }
  #view-trash .page-header .page-actions .btn {
    width: 100% !important;
    justify-content: center !important;
    font-size: 13px !important;
    padding: 8px 10px !important;
    white-space: nowrap !important;
  }
  .trash-settings-banner {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 14px 16px !important;
  }
  .trash-settings-left {
    width: 100% !important;
  }
  .trash-settings-controls {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
    padding-top: 8px !important;
    border-top: 1px dashed rgba(239, 68, 68, 0.2) !important;
  }
  .trash-control-group {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
  }
  .trash-toolbar {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: stretch !important;
  }
  .trash-filter-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 6px !important;
    width: 100% !important;
    padding-bottom: 4px !important;
  }
  .trash-filter-tabs::-webkit-scrollbar {
    display: none !important;
  }
  .trash-filter-btn {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 7px 12px !important;
    font-size: 12.5px !important;
  }
  .trash-search-wrap {
    width: 100% !important;
  }
  .trash-search-wrap .form-input {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #trashTableWrap table.data-table {
    display: block !important;
    width: 100% !important;
    border: none !important;
  }
  #trashTableWrap table.data-table thead {
    display: none !important;
  }
  #trashTableWrap table.data-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
  }
  #trashTableWrap table.data-table tbody tr {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "title expiry"
      "meta meta"
      "actions actions" !important;
    gap: 10px !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 14px 16px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  }
  #trashTableWrap table.data-table tbody tr td:nth-child(1) {
    grid-area: title !important;
    padding: 0 !important;
    border: none !important;
    min-width: 0 !important;
  }
  #trashTableWrap table.data-table tbody tr td:nth-child(3) {
    grid-area: expiry !important;
    padding: 0 !important;
    border: none !important;
    justify-self: end !important;
    align-self: flex-start !important;
  }
  #trashTableWrap table.data-table tbody tr td:nth-child(2) {
    grid-area: meta !important;
    padding: 8px 10px !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    background: var(--surface-secondary) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    font-size: 11.5px !important;
  }
  #trashTableWrap table.data-table tbody tr td:nth-child(4) {
    grid-area: actions !important;
    padding: 0 !important;
    border: none !important;
    width: 100% !important;
  }
  .trash-row-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .btn-trash-action {
    width: 100% !important;
    justify-content: center !important;
    height: 38px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: var(--radius-sm) !important;
  }

  /* ========================================================================
     22. Reports Inventory & Stock Valuation Mobile Cards (Batch 5 - Image 3)
     Transforms 7-column statement table into zero-overflow mobile cards
     ======================================================================== */
  #view-reports .page-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  #view-reports .page-header .page-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }
  #view-reports .page-header .page-actions .btn {
    width: 100% !important;
    justify-content: center !important;
    font-size: 13px !important;
    padding: 8px 10px !important;
  }
  #view-reports .reports-type-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 8px !important;
    width: 100% !important;
    padding-bottom: 4px !important;
  }
  #view-reports .reports-type-tabs::-webkit-scrollbar {
    display: none !important;
  }
  #view-reports .reports-type-btn {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: 12.5px !important;
    padding: 8px 12px !important;
  }
  #view-reports .table-card .table-header-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 12px 14px !important;
  }
  #view-reports .table-card .table-header-bar > div:last-child {
    width: 100% !important;
  }
  #view-reports #reportSearchInput {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  #view-reports .table-card .table-responsive {
    overflow-x: visible !important;
    padding: 0 !important;
    background: transparent !important;
  }

  #reportPreviewTable {
    display: block !important;
    width: 100% !important;
    border: none !important;
  }
  #reportPreviewTable thead {
    display: none !important;
  }
  #reportPreviewTable tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
  }
  #reportPreviewTable tbody tr {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "title title"
      "cat status"
      "cost sale"
      "worth worth" !important;
    gap: 8px 10px !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 14px 16px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  }
  #reportPreviewTable tbody tr td:nth-child(1) {
    grid-area: title !important;
    padding: 0 !important;
    border: none !important;
    min-width: 0 !important;
  }
  #reportPreviewTable tbody tr td:nth-child(2) {
    grid-area: cat !important;
    padding: 0 !important;
    border: none !important;
    align-self: center !important;
  }
  #reportPreviewTable tbody tr td:nth-child(3) {
    display: none !important; /* Unified stock count and status rendered inside td:nth-child(7) via universal renderStockBadge */
  }
  #reportPreviewTable tbody tr td:nth-child(7) {
    grid-area: status !important;
    padding: 0 !important;
    border: none !important;
    justify-self: end !important;
    align-self: center !important;
  }
  #reportPreviewTable tbody tr td:nth-child(4) {
    grid-area: cost !important;
    padding: 6px 10px !important;
    background: var(--surface-secondary) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 12px !important;
    border: 1px solid var(--border) !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
  }
  #reportPreviewTable tbody tr td:nth-child(4)::before {
    content: "ক্রয়: " !important;
    font-size: 11px !important;
    color: var(--text-tertiary) !important;
    font-weight: normal !important;
  }
  #reportPreviewTable tbody tr td:nth-child(5) {
    grid-area: sale !important;
    padding: 6px 10px !important;
    background: var(--surface-secondary) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 12px !important;
    border: 1px solid var(--border) !important;
    text-align: right !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 4px !important;
  }
  #reportPreviewTable tbody tr td:nth-child(5)::before {
    content: "বিক্রয়: " !important;
    font-size: 11px !important;
    color: var(--text-tertiary) !important;
    font-weight: normal !important;
  }
  #reportPreviewTable tbody tr td:nth-child(6) {
    grid-area: worth !important;
    padding: 8px 12px !important;
    background: var(--primary-light, rgba(65, 150, 255, 0.08)) !important;
    border: 1px solid rgba(65, 150, 255, 0.2) !important;
    border-radius: var(--radius-sm) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  #reportPreviewTable tbody tr td:nth-child(6)::before {
    content: "মোট স্টক মূল্য:" !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: var(--text-secondary) !important;
  }

  /* ========================================================================
     23. Order Management Tabs Touch Scroll & Search Bar Layout (Batch 5 - Image 4)
     Fixes cut-off status tabs and cramps between search bar & column reset button
     ======================================================================== */
  #view-orders .table-card .table-header-bar {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    align-items: stretch !important;
    padding: 12px 14px !important;
  }
  #view-orders #orderTabsFilter {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 6px !important;
    padding-bottom: 4px !important;
  }
  #view-orders #orderTabsFilter::-webkit-scrollbar {
    display: none !important;
  }
  #view-orders #orderTabsFilter .tab-btn {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
  }
  #view-orders .table-header-bar > div:last-child {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
  }
  #view-orders .table-header-bar > div:last-child > div:first-child {
    flex: 1 !important;
    width: auto !important;
  }
  #view-orders #orderSearchInput {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  #view-orders #resetOrderTableColumnsBtn,
  #resetOrderTableColumnsBtn {
    display: none !important;
  }
  #allOrdersTable tbody tr td:nth-child(7) .action-btns {
    justify-content: flex-end !important;
    display: flex !important;
    gap: 6px !important;
  }

  /* Ultra-compact order card adjustments (max-width: 420px) */
  #recentOrdersTable tbody tr,
  #allOrdersTable tbody tr,
  .pd-orders-table-wrap table tbody tr {
    padding: 12px !important;
  }
}

@media (max-width: 420px) {
  #recentOrdersTable tbody tr,
  #allOrdersTable tbody tr,
  .pd-orders-table-wrap table tbody tr {
    grid-template-areas:
      "header total"
      "customer customer"
      "items items"
      "payment status"
      "actions actions" !important;
  }
  #recentOrdersTable tbody tr td:nth-child(6),
  #allOrdersTable tbody tr td:nth-child(6) {
    width: auto !important;
    justify-content: flex-end !important;
  }
  #recentOrdersTable tbody tr td:nth-child(7),
  #allOrdersTable tbody tr td:nth-child(7) {
    width: 100% !important;
    justify-self: stretch !important;
  }
  #recentOrdersTable tbody tr td:nth-child(7) .action-btns,
  #allOrdersTable tbody tr td:nth-child(7) .action-btns {
    width: 100% !important;
    justify-content: flex-end !important;
  }

  /* Ultra-compact inventory card layout */
  #view-inventory table.data-table tbody tr {
    grid-template-areas:
      "serial brand category"
      "product product product"
      "pricing pricing margin"
      "stock switch switch"
      "actions actions actions" !important;
    padding: 12px 14px !important;
  }
  #view-inventory table.data-table tbody tr td:nth-child(9) {
    width: 100% !important;
    justify-self: stretch !important;
    padding-top: 8px !important;
    border-top: 1px dashed var(--border-light, rgba(0,0,0,0.06)) !important;
  }
  #view-inventory table.data-table tbody tr td:nth-child(9) .action-btns {
    width: 100% !important;
    justify-content: flex-end !important;
  }
}

@media (max-width: 540px) {
  #soundToggleBtn {
    display: none !important;
  }
}

/* ==========================================================================
   Customer Profile Button & View Trigger Styles
   ========================================================================== */
.btn-customer-profile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  border: 1px solid rgba(65, 150, 255, 0.28);
  background: rgba(65, 150, 255, 0.08);
  color: var(--primary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  outline: none;
  flex-shrink: 0;
}

.btn-customer-profile:hover {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  transform: translateY(-1px) scale(1.08);
  box-shadow: 0 4px 10px rgba(65, 150, 255, 0.35);
}

.btn-customer-profile:active {
  transform: translateY(0) scale(0.95);
}

[data-theme="dark"] .btn-customer-profile {
  background: rgba(65, 150, 255, 0.15);
  border-color: rgba(65, 150, 255, 0.35);
  color: #60A5FA;
}

[data-theme="dark"] .btn-customer-profile:hover {
  background: #3B82F6;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Dedicated Customer Table Profile Action Button */
.btn-profile-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 12px;
  height: 32px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(65, 150, 255, 0.08);
  color: var(--primary);
  border: 1px solid rgba(65, 150, 255, 0.28);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-profile-action:hover {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(65, 150, 255, 0.3);
}

.btn-profile-action:active {
  transform: translateY(0);
}

[data-theme="dark"] .btn-profile-action {
  background: rgba(65, 150, 255, 0.15);
  border-color: rgba(65, 150, 255, 0.35);
  color: #60A5FA;
}

[data-theme="dark"] .btn-profile-action:hover {
  background: #3B82F6;
  color: #FFFFFF;
}

/* High-Contrast Customer Tier Badges */
.cust-tier-badge {
  font-size: 11px;
  padding: 2px 8px;
  height: 20px;
  border-radius: 9999px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  vertical-align: middle;
}

.cust-tier-badge.tier-vip {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.cust-tier-badge.tier-regular {
  background: #EFF6FF;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
}

.cust-tier-badge.tier-new {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
}

[data-theme="dark"] .cust-tier-badge.tier-vip {
  background: rgba(5, 150, 105, 0.2);
  color: #34D399;
  border-color: rgba(52, 211, 153, 0.35);
}

[data-theme="dark"] .cust-tier-badge.tier-regular {
  background: rgba(37, 99, 235, 0.2);
  color: #60A5FA;
  border-color: rgba(96, 165, 250, 0.35);
}

[data-theme="dark"] .cust-tier-badge.tier-new {
  background: rgba(245, 158, 11, 0.22);
  color: #FCD34D;
  border-color: rgba(252, 211, 77, 0.35);
}

/* Compact Non-Scrolling Profile Orders Table */
.profile-orders-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-height: 290px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface);
}

.profile-orders-table {
  width: 100% !important;
  min-width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.profile-orders-table thead th {
  background: var(--surface-secondary);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.profile-orders-table tbody td {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.profile-orders-table tbody tr:hover {
  background-color: var(--bg);
}

.profile-orders-table .pay-cell-wrap {
  gap: 3px;
}

.profile-orders-table .pay-badges-wrap {
  gap: 4px;
}

.profile-orders-table .pay-trx-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 4px;
}

.profile-orders-table .pay-chip {
  height: 24px;
  padding: 0 7px;
  font-size: 11px;
}

.profile-orders-table .pay-chip i {
  font-size: 11px;
}

.profile-orders-table .status-badge {
  padding: 2px 7px;
  font-size: 11px;
}

.profile-orders-table .action-btns .btn-action {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

/* ==========================================================================
   Order Status Custom Dropdown Popover (Solves Native Select Missing Icons)
   Docs/design.md Section 20 & 21
   ========================================================================== */
.order-status-custom-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.order-status-pill-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.order-status-pill-btn:hover {
  filter: brightness(0.96);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.order-status-pill-btn .status-chevron {
  font-size: 9px;
  margin-left: 2px;
  opacity: 0.7;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.order-status-custom-dropdown.open .order-status-pill-btn .status-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.order-status-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  min-width: 185px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.06);
  padding: 6px;
  z-index: 1050;
  display: none;
  animation: dropdownPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.order-status-custom-dropdown.open .order-status-menu {
  display: block;
}

.order-status-custom-dropdown.dropup .order-status-menu {
  top: auto;
  bottom: calc(100% + 5px);
  box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.14), 0 -2px 6px rgba(0, 0, 0, 0.06);
  animation: dropdownPopUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.order-status-custom-dropdown.align-right .order-status-menu {
  left: auto;
  right: 0;
}

/* Global Floating Portal attached directly to document.body (Zero Clipping & Smart Dropup) */
.order-status-portal {
  position: fixed !important;
  z-index: 99999 !important;
  display: none;
}

.order-status-portal.dropup {
  box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.14), 0 -2px 6px rgba(0, 0, 0, 0.06);
  animation: dropdownPopUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownPopUp {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dropdownPop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.order-status-menu-header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  padding: 4px 8px 6px 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 5px;
}

.order-status-menu-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 5px;
}

.order-status-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.order-status-menu-item:hover {
  background: var(--surface-secondary);
}

.order-status-menu-item.active {
  background: rgba(65, 150, 255, 0.08);
  border-color: rgba(65, 150, 255, 0.25);
  color: var(--primary);
  font-weight: 700;
}

.status-menu-icon-wrap {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.status-menu-label {
  flex: 1;
  white-space: nowrap;
}

.status-check-icon {
  font-size: 11px;
  color: var(--primary);
  margin-left: auto;
}

/* Status Menu Icon Backgrounds */
.status-menu-icon-wrap.badge-pending {
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.status-menu-icon-wrap.badge-processing {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.status-menu-icon-wrap.badge-shipped {
  background: #F5F3FF;
  color: #6D28D9;
  border: 1px solid #DDD6FE;
}

.status-menu-icon-wrap.badge-delivered {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.status-menu-icon-wrap.badge-cancelled {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

[data-theme="dark"] .order-status-menu {
  background: #1E293B;
  border-color: #334155;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .order-status-menu-item:hover {
  background: #334155;
}

/* Payment Status Custom Dropdown in Details Modal (Matches Photo 1 UI) */
.payment-status-custom-dropdown {
  position: relative;
  flex: 1;
}

.payment-status-dropdown-btn {
  width: 100%;
  height: 32px;
  font-size: 12.5px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  box-sizing: border-box;
  outline: none;
  font-family: var(--font-family);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.payment-status-dropdown-btn:hover {
  border-color: var(--border-focus);
  background: var(--surface-secondary);
}

.payment-status-custom-dropdown.open .payment-chevron {
  transform: rotate(180deg);
}

.payment-status-custom-dropdown .payment-status-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  width: 100%;
  min-width: 195px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.06);
  padding: 6px;
  z-index: 1050;
  display: none;
  animation: dropdownPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.payment-status-custom-dropdown.open .payment-status-menu {
  display: block;
}

[data-theme="dark"] .payment-status-custom-dropdown .payment-status-menu {
  background: #1E293B;
  border-color: #334155;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   Trash / Recycle Bin Styles (User Request 2)
   ========================================================================== */
.trash-settings-banner {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.04) 0%, rgba(65, 150, 255, 0.04) 100%);
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.trash-settings-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.trash-settings-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.12);
  color: #EF4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.trash-settings-info h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.trash-settings-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

.trash-settings-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.trash-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.trash-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.trash-filter-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.trash-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.trash-filter-btn:hover {
  background: var(--surface-secondary);
  color: var(--text-primary);
  border-color: rgba(65, 150, 255, 0.3);
}

.trash-filter-btn.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(65, 150, 255, 0.3);
}

.trash-search-wrap {
  position: relative;
  min-width: 260px;
}

.trash-search-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 13px;
}

.trash-search-wrap .form-input {
  padding-left: 34px;
}

.trash-item-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.trash-item-type-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.trash-item-type-pill.badge-product {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.trash-item-type-pill.badge-order {
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.trash-item-type-pill.badge-voucher {
  background: #FDF4FF;
  color: #A21CAF;
  border: 1px solid #F5D0FE;
}

.trash-item-type-pill.badge-flash {
  background: #FFF7ED;
  color: #C2410C;
  border: 1px solid #FFEDD5;
}

.trash-item-type-pill.badge-team {
  background: #F5F3FF;
  color: #6D28D9;
  border: 1px solid #DDD6FE;
}

.trash-item-type-pill.badge-role {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.trash-item-name {
  font-size: 13px;
  color: var(--text-primary);
}

.trash-item-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.trash-date-text {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 600;
}

.trash-user-text {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.trash-expiry-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  background: rgba(65, 150, 255, 0.1);
  color: var(--primary);
  border: 1px solid rgba(65, 150, 255, 0.25);
  white-space: nowrap;
}

.trash-expiry-badge.urgent {
  background: #FEF2F2;
  color: #DC2626;
  border-color: #FECACA;
  animation: pulseWarning 2s infinite;
}

.trash-expiry-badge.permanent {
  background: var(--surface-secondary);
  color: var(--text-secondary);
  border-color: var(--border);
}

@keyframes pulseWarning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.trash-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.btn-trash-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-trash-action.restore {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.25);
}

.btn-trash-action.restore:hover {
  background: #10B981;
  color: #FFFFFF;
  border-color: #10B981;
  transform: translateY(-1px);
}

.btn-trash-action.delete {
  background: rgba(239, 68, 68, 0.1);
  color: #DC2626;
  border-color: rgba(239, 68, 68, 0.25);
}

.btn-trash-action.delete:hover {
  background: #EF4444;
  color: #FFFFFF;
  border-color: #EF4444;
  transform: translateY(-1px);
}

/* ==========================================================================
   Roles & Permissions Matrix Styles (User Request 3)
   ========================================================================== */
.roles-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.role-overview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.role-overview-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.role-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.role-card-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.role-badge-tag {
  font-size: 13px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.system-protected-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.12);
  color: #8B5CF6;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.role-member-count {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.role-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
  min-height: 34px;
}

.role-perm-stat-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.role-stat-text {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
}

.role-progress-track {
  width: 100%;
  height: 6px;
  background: var(--surface-secondary);
  border-radius: 999px;
  overflow: hidden;
}

.role-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.role-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.btn-role-action.matrix {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-role-action.matrix:hover {
  background: var(--surface-secondary);
  color: var(--primary);
  border-color: var(--primary);
}

.role-action-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-role-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
}

.btn-role-icon:hover {
  background: var(--surface-secondary);
  color: var(--primary);
}

.btn-role-icon.delete:hover {
  color: #EF4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Permission Matrix Table */
.matrix-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-secondary);
}

.perm-matrix-table thead th {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
}

.perm-col-feature {
  width: 35%;
  min-width: 250px;
  text-align: left;
}

.perm-role-head-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.perm-module-header-row td {
  background: var(--surface-secondary);
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.perm-mod-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--primary);
}

.perm-rule-row td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.perm-rule-title-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.perm-rule-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.perm-rule-key {
  font-size: 10px;
  font-family: monospace;
  color: var(--text-tertiary);
}

/* Custom Permission Toggle Switch */
.perm-toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  cursor: pointer;
}

.perm-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.perm-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 22px;
}

.perm-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.perm-toggle-switch input:checked + .perm-slider {
  background-color: var(--primary);
}

.perm-toggle-switch input:checked + .perm-slider:before {
  transform: translateX(16px);
}

.perm-toggle-switch.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.perm-toggle-switch.locked input:checked + .perm-slider {
  background-color: #8B5CF6;
}

/* Modal Permissions Grid */
.modal-permissions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface-secondary);
}

.modal-perm-group-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.modal-perm-items-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  padding-left: 18px;
}

.modal-perm-item-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
}

/* ==========================================================================
   Team Members Styles (User Request 3)
   ========================================================================== */
.team-toolbar-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.team-search-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.team-search-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 13px;
}

.team-search-wrap .form-input {
  padding-left: 34px;
}

.team-filter-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-primary);
}

.team-member-info-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: var(--surface-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.team-member-name {
  font-size: 13px;
  color: var(--text-primary);
}

.team-member-date {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.team-contact-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-primary);
}

.team-role-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.status-toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
  vertical-align: middle;
}

.status-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.status-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: 0.25s ease;
  border-radius: 20px;
}

.status-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s ease;
  border-radius: 50%;
}

.status-toggle-switch input:checked + .status-slider {
  background-color: #10B981;
}

.status-toggle-switch input:checked + .status-slider:before {
  transform: translateX(16px);
}

.status-label-text {
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
}

.status-label-text.active {
  color: #059669;
}

.status-label-text.inactive {
  color: var(--text-tertiary);
}

.team-last-active {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Generic Switch Toggle for Header Banners */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  cursor: pointer;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: 0.25s ease;
  border-radius: 22px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s ease;
  border-radius: 50%;
}

.switch-toggle input:checked + .switch-slider {
  background-color: var(--primary);
}

.switch-toggle input:checked + .switch-slider:before {
  transform: translateX(18px);
}

/* ==========================================================================
   Order Management Enhancements: Custom Order Badge, Compact Items & Audit Trail
   ========================================================================== */

/* Custom Order Badge (Matches .order-items-total-pill UI exactly, icon-free) */
.badge-custom-order {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 1.5px 7px;
  border-radius: var(--radius-pill);
  background: var(--surface-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  white-space: nowrap;
}

[data-theme="dark"] .badge-custom-order {
  background: var(--surface-secondary);
  color: var(--text-secondary);
  border-color: var(--border);
}

/* Compact Ordered Items Preview Cell */
.order-items-preview-cell {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  line-height: 1.45;
  font-size: 12.5px;
  color: var(--text-primary);
}

.order-items-preview-text {
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-word;
}

.order-items-plain-total,
.order-items-total-pill {
  display: inline !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: var(--text-secondary) !important;
  font-weight: 500 !important;
  font-size: 12.5px !important;
  white-space: nowrap;
}

.order-items-more-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(65, 150, 255, 0.1);
  color: var(--primary);
  border: 1px solid rgba(65, 150, 255, 0.25);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.order-items-more-pill:hover {
  background: rgba(65, 150, 255, 0.2);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.order-items-total-tag {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 10.5px;
}

/* Order Edit Pill Button in Details Modal (Matches .status-badge dimensions) */
.btn-order-edit-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: transparent;
  border: 1px solid rgba(65, 150, 255, 0.45);
  color: var(--primary);
  cursor: pointer;
  line-height: 1.2;
  box-sizing: border-box;
  transition: var(--transition);
}

.btn-order-edit-pill:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

[data-theme="dark"] .btn-order-edit-pill {
  border-color: rgba(65, 150, 255, 0.5);
  color: #60A5FA;
}

[data-theme="dark"] .btn-order-edit-pill:hover {
  background: rgba(65, 150, 255, 0.15);
}

/* Order Audit Trail & History in View Modal (Crisp, Fresh & Minimal) */
.order-audit-section {
  background: var(--surface-secondary);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.order-audit-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
}

.order-audit-entry-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.order-audit-entry-card:hover {
  border-color: rgba(65, 150, 255, 0.3);
}

.order-audit-entry-card.initial-entry {
  border-left: 3px solid #00C896;
}

.audit-entry-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.audit-editor-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.audit-editor-info strong {
  color: var(--text-primary);
  font-weight: 700;
}

.audit-timestamp {
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.audit-entry-note {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--surface-secondary);
  padding: 3px 8px;
  border-radius: 4px;
  border-left: 2px solid var(--primary);
  margin-top: 2px;
}

/* Edit Order Item Row in Edit Modal */
.edit-order-item-row {
  display: grid;
  grid-template-columns: 2.2fr 1.2fr 1.1fr 1.0fr 80px 42px;
  gap: 10px;
  align-items: center;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.edit-order-item-row .btn-remove-item {
  height: 38px;
  width: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.1);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.edit-order-item-row .btn-remove-item:hover {
  background: #EF4444;
  color: white;
}

/* ==========================================================================
   Payment Collection Modal & Account / TrxID Input Styling
   Refined per UI Bugfix & Received Mobile/Card Number Requirement
   ========================================================================== */
.collect-pay-fields-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface-secondary);
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.collect-pay-field-group {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.collect-pay-field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.collect-pay-field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.btn-gen-test-trx,
.btn-select-pay-account,
.btn-fill-cust-phone {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px dashed var(--primary);
  background: rgba(37, 99, 235, 0.06);
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-gen-test-trx:hover,
.btn-select-pay-account:hover,
.btn-fill-cust-phone:hover {
  background: var(--primary);
  color: #ffffff;
  border-style: solid;
}

.collect-pay-acc-picker-wrap {
  position: relative;
  display: inline-block;
}

/* Select Number Popover Dropdown */
.collect-pay-account-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 320px;
  max-width: 90vw;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  z-index: 1050;
  overflow: hidden;
  animation: dropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.collect-pay-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  background: var(--surface-secondary);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.collect-pay-dropdown-close {
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.collect-pay-dropdown-close:hover {
  color: var(--danger);
}

.collect-pay-dropdown-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
}

.collect-pay-dropdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.18s ease;
}

.collect-pay-dropdown-item:hover {
  background: rgba(37, 99, 235, 0.05);
  border-color: var(--primary);
}

.collect-pay-dropdown-item.customer-opt {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.3);
}

.collect-pay-dropdown-item.customer-opt:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: #10B981;
}

.collect-pay-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.collect-pay-item-label {
  font-size: 12px;
  color: var(--text-primary);
}

.collect-pay-item-label strong {
  font-weight: 700;
}

.collect-pay-item-sub {
  font-size: 10.5px;
  color: var(--text-secondary);
}

.collect-pay-badge-tag {
  font-size: 10px;
  font-weight: 700;
  background: #10B981;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.collect-pay-dropdown-divider {
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 4px 0 2px 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.saved-accounts-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.saved-acc-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.18s ease;
}

.saved-acc-item:hover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
}

.saved-acc-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.saved-acc-num {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.saved-acc-tag {
  font-size: 11px;
  color: var(--text-secondary);
}

.saved-acc-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-delete-saved-acc {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.18s, background 0.18s;
}

.btn-delete-saved-acc:hover {
  color: #EF4444;
  background: rgba(239, 68, 68, 0.1);
}

.add-account-section {
  margin-top: 4px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-secondary);
  border: 1px dashed var(--border);
}

.add-account-header {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 7px;
}

.add-account-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-form-input {
  width: 100% !important;
  height: 32px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  font-family: 'LiAdorNoirrit', 'Hind Siliguri', sans-serif !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  box-sizing: border-box !important;
  outline: none !important;
}

.mini-form-input:focus {
  border-color: var(--primary) !important;
}

.btn-save-new-account {
  width: 100%;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: var(--primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: opacity 0.2s;
}

.btn-save-new-account:hover {
  opacity: 0.9;
}

.collect-pay-input-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.collect-pay-input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-secondary);
  font-size: 14px;
  pointer-events: none;
  transition: color 0.2s;
  z-index: 2;
}

.collect-pay-input-wrap:focus-within .collect-pay-input-icon {
  color: var(--primary);
}

.collect-pay-input {
  width: 100% !important;
  height: 42px !important;
  padding: 0 12px 0 36px !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 8px !important;
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  font-size: 13.5px !important;
  box-sizing: border-box !important;
  outline: none !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
}

.collect-pay-input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

.collect-pay-trx-input {
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, 'LiAdorNoirrit', 'Hind Siliguri', sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: 0.6px !important;
  text-transform: uppercase !important;
}

/* Ensure Bengali text in placeholder looks authentic and beautiful */
.collect-pay-input::placeholder,
.collect-pay-trx-input::placeholder {
  font-family: 'LiAdorNoirrit', 'Hind Siliguri', 'Inter', sans-serif !important;
  font-size: 13px !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  font-weight: 400 !important;
  color: var(--text-secondary) !important;
  opacity: 0.8 !important;
}

.collect-pay-field-error {
  display: none;
  align-items: center;
  gap: 5px;
  color: #EF4444;
  font-size: 11.5px;
  font-weight: 500;
  margin-top: 5px;
}

/* Account Number / Mobile tag next to TrxID */
.pay-acc-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 4px;
  margin-right: 5px;
  white-space: nowrap;
}

.pay-acc-tag i {
  font-size: 10.5px;
  color: #6B7280;
}

[data-theme="dark"] .collect-pay-fields-grid {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .collect-pay-input {
  background: var(--surface-secondary) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .btn-gen-test-trx,
[data-theme="dark"] .btn-select-pay-account,
[data-theme="dark"] .btn-fill-cust-phone {
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
  border-color: #3B82F6;
}

[data-theme="dark"] .btn-gen-test-trx:hover,
[data-theme="dark"] .btn-select-pay-account:hover,
[data-theme="dark"] .btn-fill-cust-phone:hover {
  background: #2563EB;
  color: #ffffff;
}

[data-theme="dark"] .pay-acc-tag {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #E2E8F0;
}

[data-theme="dark"] .collect-pay-account-dropdown {
  background: #1E2433;
  border-color: #2A3045;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .collect-pay-dropdown-header,
[data-theme="dark"] .add-account-section {
  background: #161A24;
  border-color: #2A3045;
}

[data-theme="dark"] .collect-pay-dropdown-item,
[data-theme="dark"] .saved-acc-item,
[data-theme="dark"] .mini-form-input {
  background: #161A24 !important;
  border-color: #2A3045 !important;
  color: #FFFFFF !important;
}

/* ==========================================================================
   Global Confirmation Dialog Component (.confirm-modal-*)
   Replaces native browser alert/confirm with modern Utsaho Dialog
   ========================================================================== */
.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirm-modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.confirm-modal-card {
  width: 90%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px 24px 22px;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.25);
  text-align: center;
  transform: scale(0.92) translateY(10px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font-family);
}

.confirm-modal-overlay.visible .confirm-modal-card {
  transform: scale(1) translateY(0);
}

.confirm-modal-icon-badge {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin: 0 auto 16px;
  transition: transform 0.2s ease;
}

.confirm-modal-icon-badge.danger {
  background: #FEE2E2;
  color: #EF4444;
  border: 1px solid #FECACA;
}

.confirm-modal-icon-badge.warning {
  background: #FEF3C7;
  color: #D97706;
  border: 1px solid #FDE68A;
}

.confirm-modal-icon-badge.info {
  background: #EFF6FF;
  color: #3B82F6;
  border: 1px solid #BFDBFE;
}

.confirm-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 10px;
  line-height: 1.35;
}

.confirm-modal-message {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  margin: 0 0 24px;
  line-height: 1.6;
  word-break: break-word;
}

.confirm-modal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-confirm-cancel {
  flex: 1;
  height: 42px;
  border-radius: var(--radius-md, 10px);
  background: var(--surface-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family);
}

.btn-confirm-cancel:hover {
  background: #E2E8F0;
  border-color: #CBD5E1;
}

.btn-confirm-ok {
  flex: 1;
  height: 42px;
  border-radius: var(--radius-md, 10px);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  font-family: var(--font-family);
}

.btn-confirm-ok.danger {
  background: #EF4444;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-confirm-ok.danger:hover {
  background: #DC2626;
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.btn-confirm-ok.warning {
  background: #F59E0B;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.btn-confirm-ok.warning:hover {
  background: #D97706;
  transform: translateY(-1px);
}

.btn-confirm-ok.info {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(65, 150, 255, 0.25);
}

.btn-confirm-ok.info:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* Dark Theme Overrides for Confirm Modal */
[data-theme="dark"] .confirm-modal-overlay {
  background: rgba(0, 0, 0, 0.75);
}

[data-theme="dark"] .confirm-modal-card {
  background: #161A24;
  border-color: #2A3045;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .confirm-modal-icon-badge.danger {
  background: rgba(239, 68, 68, 0.16);
  color: #F87171;
  border-color: rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .confirm-modal-icon-badge.warning {
  background: rgba(245, 158, 11, 0.16);
  color: #FCD34D;
  border-color: rgba(245, 158, 11, 0.3);
}

[data-theme="dark"] .confirm-modal-icon-badge.info {
  background: rgba(59, 130, 246, 0.16);
  color: #93C5FD;
  border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .btn-confirm-cancel {
  background: #1E2433;
  color: #E2E8F0;
  border-color: #2A3045;
}

[data-theme="dark"] .btn-confirm-cancel:hover {
  background: #2A3045;
  color: #FFFFFF;
}

/* ==========================================================================
   Brand Logo & Image Thumbnail Styles
   ========================================================================== */
.brand-logo-wrap {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--surface-secondary, #F8FAFC);
  border: 1px solid var(--border, #E2E8F0);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-logo-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light, rgba(0, 168, 107, 0.08));
  color: var(--primary, #00A86B);
  font-size: 15px;
}

.brand-logo-preview-box {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 2px dashed var(--border, #CBD5E1);
  background: var(--surface-secondary, #F8FAFC);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.brand-logo-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

[data-theme="dark"] .brand-logo-wrap {
  background: #1A202C;
  border-color: #2D3748;
}

[data-theme="dark"] .brand-logo-preview-box {
  background: #1A202C;
  border-color: #4A5568;
}

/* ==========================================================================
   Smart Customer Avatar & Connection Badges (Requirement 1 & 2)
   ========================================================================== */
.cust-smart-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #FFFFFF;
  color: var(--primary, #00A86B);
  border: 2px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06), 0 0 0 3px rgba(0, 168, 107, 0.08);
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.cust-smart-avatar.sm {
  width: 36px;
  height: 36px;
  font-size: 15px;
  border-width: 1.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05), 0 0 0 2px rgba(0, 168, 107, 0.08);
}

.cust-smart-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

[data-theme="dark"] .cust-smart-avatar {
  background: #1E2433;
  color: #34D399;
  border-color: #374151;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(52, 211, 153, 0.12);
}

/* Connection Badges */
.cust-connect-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.cust-connect-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.25px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.cust-connect-pill .cust-smart-phone-icon {
  font-size: 13px;
  color: #16A34A;
  display: inline-block;
  vertical-align: middle;
}

.cust-connect-pill.connected {
  background: #F0FDF4;
  color: #15803D;
  border: 1px solid #BBF7D0;
}

.cust-connect-pill.connected.email {
  background: #EFF6FF;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
}

.cust-connect-pill.connected.email .fa-google {
  color: #2563EB;
  font-size: 12px;
}

.cust-connect-pill.connected .verified-icon {
  font-size: 11px;
  color: #16A34A;
  margin-left: 2px;
}

.cust-connect-pill.connected.email .verified-icon {
  color: #2563EB;
}

.cust-connect-pill.unlinked {
  background: #F8FAFC;
  color: #64748B;
  border: 1px dashed #CBD5E1;
  cursor: pointer;
}

.cust-connect-pill.unlinked:hover {
  background: #EFF6FF;
  border-color: #93C5FD;
  color: #2563EB;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.08);
}

[data-theme="dark"] .cust-connect-pill.connected {
  background: rgba(16, 185, 129, 0.12);
  color: #6EE7B7;
  border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .cust-connect-pill.connected .cust-smart-phone-icon,
[data-theme="dark"] .cust-connect-pill.connected .verified-icon {
  color: #34D399;
}

[data-theme="dark"] .cust-connect-pill.connected.email {
  background: rgba(59, 130, 246, 0.12);
  color: #93C5FD;
  border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .cust-connect-pill.connected.email .fa-google,
[data-theme="dark"] .cust-connect-pill.connected.email .verified-icon {
  color: #60A5FA;
}

[data-theme="dark"] .cust-connect-pill.unlinked {
  background: rgba(255, 255, 255, 0.04);
  color: #94A3B8;
  border-color: #334155;
}

[data-theme="dark"] .cust-connect-pill.unlinked:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: #60A5FA;
  color: #93C5FD;
}

/* Table email badge */
.cust-email-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.cust-email-badge.connected {
  color: #2563EB;
  font-weight: 500;
}

.cust-email-badge.unlinked {
  color: var(--text-tertiary);
  font-style: italic;
  font-size: 10.5px;
}

[data-theme="dark"] .cust-email-badge.connected {
  color: #93C5FD;
}

/* ==========================================================================
   Global Image Upload & URL Control Component (Dual-Mode Image Input)
   ========================================================================== */
.image-uploader-control {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 14px;
  background: var(--surface-secondary, #F8FAFC);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: var(--radius-md, 12px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

.image-uploader-control:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(65, 150, 255, 0.12);
}

.image-uploader-preview-wrap {
  flex-shrink: 0;
}

.image-uploader-preview {
  width: 82px;
  height: 82px;
  border-radius: var(--radius-md, 12px);
  border: 2px dashed var(--border, #CBD5E1);
  background: var(--surface, #FFFFFF);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.image-uploader-preview.circle-avatar {
  border-radius: 50% !important;
  width: 76px;
  height: 76px;
}

.image-uploader-preview.has-image {
  border-style: solid;
  border-color: var(--border);
}

.image-uploader-preview .placeholder-icon {
  font-size: 26px;
  color: var(--text-tertiary, #94A3B8);
  opacity: 0.6;
}

.image-uploader-preview .preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-uploader-preview .btn-clear-image {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  color: #FFFFFF;
  border: none;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
  z-index: 2;
}

.image-uploader-preview .btn-clear-image:hover {
  background: var(--danger, #EF4444);
  transform: scale(1.1);
}

.image-uploader-body {
  flex: 1;
  min-width: 0;
}

.image-uploader-tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 10px;
  background: rgba(0, 0, 0, 0.05);
  padding: 3px;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.img-tab-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.img-tab-btn:hover {
  color: var(--text-primary);
}

.img-tab-btn.active {
  background: var(--surface);
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.img-tab-panel {
  display: none;
}

.img-tab-panel.active {
  display: block;
  animation: fadeIn 0.18s ease-out;
}

.img-dropzone {
  border: 2px dashed var(--border, #CBD5E1);
  border-radius: var(--radius-sm, 8px);
  padding: 12px 14px;
  text-align: center;
  background: var(--surface);
  cursor: pointer;
  display: block;
  position: relative;
  transition: all 0.2s ease;
}

.img-dropzone:hover,
.img-dropzone.drag-over {
  border-color: var(--primary);
  background: rgba(65, 150, 255, 0.06);
  transform: translateY(-1px);
}

.img-file-hidden {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.dropzone-icon {
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 2px;
}

.dropzone-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.dropzone-hint {
  font-size: 10.5px;
  color: var(--text-tertiary);
}

.upload-file-status {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--success, #00C896);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 200, 150, 0.08);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 200, 150, 0.2);
}

.img-url-input {
  width: 100%;
}

@media (max-width: 580px) {
  .image-uploader-control {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .image-uploader-preview-wrap {
    display: flex;
    justify-content: center;
  }
  .image-uploader-tabs {
    width: 100%;
    justify-content: center;
  }
}

/* Dark mode overrides for ImageUploadControl */
[data-theme="dark"] .image-uploader-control {
  background: #181E2C;
  border-color: #2D3748;
}

[data-theme="dark"] .image-uploader-control:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(65, 150, 255, 0.2);
}

[data-theme="dark"] .image-uploader-preview {
  background: #10141E;
  border-color: #4A5568;
}

[data-theme="dark"] .image-uploader-tabs {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .img-tab-btn.active {
  background: #1E2538;
  color: #60A5FA;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .img-dropzone {
  background: #10141E;
  border-color: #4A5568;
}

[data-theme="dark"] .img-dropzone:hover,
[data-theme="dark"] .img-dropzone.drag-over {
  border-color: #60A5FA;
  background: rgba(96, 165, 250, 0.1);
}

[data-theme="dark"] .upload-file-status {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.25);
  color: #6EE7B7;
}

/* ==========================================================================
   Customer Intelligence & Directory Styling (Smart & Fresh UI)
   ========================================================================== */
.cust-toolbar-card {
  margin-bottom: 20px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.cust-toolbar-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cust-search-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.cust-search-wrap .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 14px;
  pointer-events: none;
}

.cust-search-wrap .form-input {
  padding-left: 40px;
  height: 42px;
  font-size: 13.5px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  width: 100%;
  box-sizing: border-box;
}

.cust-filter-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cust-filter-wrap .form-select {
  height: 42px;
  border-radius: var(--radius-sm);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
}

.cust-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(65, 150, 255, 0.2);
  white-space: nowrap;
}

/* Customer Table Enhancements */
#view-customers .table-card {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
  overflow: visible;
}

#view-customers .data-table {
  border-collapse: separate;
  border-spacing: 0;
}

#view-customers .data-table thead th {
  background: #F8FAFC !important;
  color: #475569 !important;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 18px;
  border-bottom: 1.5px solid #E2E8F0 !important;
}

[data-theme="dark"] #view-customers .data-table thead th {
  background: #1A2234 !important;
  color: #94A3B8 !important;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.08) !important;
}

#view-customers .data-table tbody tr {
  transition: all 0.18s ease;
  border-bottom: 1px solid var(--border);
}

#view-customers .data-table tbody tr:hover {
  background: rgba(65, 150, 255, 0.04) !important;
}

#view-customers .data-table td {
  padding: 14px 18px;
  vertical-align: middle;
}

/* Avatar Box */
.cust-avatar-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease;
}

.cust-row:hover .cust-avatar-box {
  transform: scale(1.05);
}

.cust-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

/* Dynamic Palette Classes for Avatars without image */
.cust-avatar-box.palette-emerald { background: #ECFDF5; color: #059669; border: 1.5px solid #A7F3D0; }
.cust-avatar-box.palette-blue    { background: #EFF6FF; color: #2563EB; border: 1.5px solid #BFDBFE; }
.cust-avatar-box.palette-violet  { background: #F5F3FF; color: #7C3AED; border: 1.5px solid #DDD6FE; }
.cust-avatar-box.palette-amber   { background: #FFFBEB; color: #D97706; border: 1.5px solid #FDE68A; }
.cust-avatar-box.palette-rose    { background: #FFF1F2; color: #E11D48; border: 1.5px solid #FECDD3; }
.cust-avatar-box.palette-teal    { background: #F0FDFA; color: #0D9488; border: 1.5px solid #99F6E4; }

[data-theme="dark"] .cust-avatar-box.palette-emerald { background: rgba(5, 150, 105, 0.15); color: #34D399; border-color: rgba(52, 211, 153, 0.3); }
[data-theme="dark"] .cust-avatar-box.palette-blue    { background: rgba(37, 99, 235, 0.15); color: #60A5FA; border-color: rgba(96, 165, 250, 0.3); }
[data-theme="dark"] .cust-avatar-box.palette-violet  { background: rgba(124, 58, 237, 0.15); color: #A78BFA; border-color: rgba(167, 139, 250, 0.3); }
[data-theme="dark"] .cust-avatar-box.palette-amber   { background: rgba(217, 119, 6, 0.15); color: #FBBF24; border-color: rgba(251, 191, 36, 0.3); }
[data-theme="dark"] .cust-avatar-box.palette-rose    { background: rgba(225, 29, 72, 0.15); color: #FB7185; border-color: rgba(251, 113, 133, 0.3); }
[data-theme="dark"] .cust-avatar-box.palette-teal    { background: rgba(13, 148, 136, 0.15); color: #2DD4BF; border-color: rgba(45, 212, 191, 0.3); }

/* Customer Info */
.cust-info-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cust-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-block;
  transition: color 0.15s ease;
}

.cust-name:hover {
  color: var(--primary);
}

.cust-address {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cust-address i {
  color: #94A3B8;
  font-size: 11px;
  flex-shrink: 0;
}

/* Contact Column */
.cust-contact-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cust-phone-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F1F5F9;
  color: #0F172A;
  font-family: monospace;
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid #E2E8F0;
  text-decoration: none;
  width: fit-content;
  transition: all 0.18s ease;
}

.cust-phone-pill i {
  color: #0284C7;
  font-size: 11.5px;
}

.cust-phone-pill:hover {
  background: #E0F2FE;
  border-color: #BAE6FD;
  color: #0369A1;
  transform: translateY(-1px);
}

[data-theme="dark"] .cust-phone-pill {
  background: rgba(255, 255, 255, 0.05);
  color: #E2E8F0;
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .cust-phone-pill:hover {
  background: rgba(2, 132, 199, 0.18);
  border-color: rgba(2, 132, 199, 0.4);
  color: #38BDF8;
}

.cust-email-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
  font-family: monospace;
}

.cust-email-badge.connected i {
  color: #4285F4;
  font-size: 11px;
}

.cust-email-badge.unlinked {
  color: var(--text-tertiary);
  opacity: 0.5;
}

/* Orders Chip */
.cust-orders-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: #F0FDF4;
  color: #166534;
  border: 1px solid #DCFCE7;
  font-size: 12.5px;
  white-space: nowrap;
}

.cust-orders-chip i {
  color: #16A34A;
  font-size: 11.5px;
}

.cust-orders-chip strong {
  font-weight: 800;
  font-size: 13.5px;
}

[data-theme="dark"] .cust-orders-chip {
  background: rgba(22, 163, 74, 0.12);
  color: #4ADE80;
  border-color: rgba(74, 222, 128, 0.25);
}

/* Spent Cell */
.cust-spent-wrap {
  display: flex;
  flex-direction: column;
}

.cust-spent-amount {
  font-size: 14.5px;
  font-weight: 800;
  color: #047857;
  font-family: var(--font-family);
  letter-spacing: -0.2px;
}

[data-theme="dark"] .cust-spent-amount {
  color: #34D399;
}

.cust-spent-sub {
  font-size: 10.5px;
  color: var(--text-tertiary);
  margin-top: 1px;
}

/* Loyalty Tier Pills (Clean, Modern, NO STARS!) */
.cust-tier-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.cust-tier-pill.vip {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.cust-tier-pill.vip i {
  color: #059669;
  font-size: 10px;
}

.cust-tier-pill.regular {
  background: #EFF6FF;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
}

.cust-tier-pill.regular i {
  color: #2563EB;
  font-size: 10px;
}

.cust-tier-pill.new {
  background: #F8FAFC;
  color: #475569;
  border: 1px solid #E2E8F0;
  font-weight: 600;
}

[data-theme="dark"] .cust-tier-pill.vip {
  background: rgba(6, 95, 70, 0.2);
  color: #34D399;
  border-color: rgba(52, 211, 153, 0.3);
}

[data-theme="dark"] .cust-tier-pill.regular {
  background: rgba(30, 64, 175, 0.2);
  color: #60A5FA;
  border-color: rgba(96, 165, 250, 0.3);
}

[data-theme="dark"] .cust-tier-pill.new {
  background: rgba(255, 255, 255, 0.05);
  color: #94A3B8;
  border-color: rgba(255, 255, 255, 0.1);
}

/* Smart Action Buttons */
.cust-action-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.btn-smart-profile {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(65, 150, 255, 0.2);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-smart-profile:hover {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(65, 150, 255, 0.25);
}

.btn-smart-edit {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-smart-edit:hover {
  background: #FFFBEB;
  color: #D97706;
  border-color: #FDE68A;
  transform: translateY(-1px);
}

[data-theme="dark"] .btn-smart-edit:hover {
  background: rgba(217, 119, 6, 0.18);
  color: #FBBF24;
  border-color: rgba(251, 191, 36, 0.3);
}

/* ==========================================================================
   Store & System Settings Modernized UI (docs/design.md Utsaho System)
   ========================================================================== */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 8px 16px -4px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.settings-card:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}

.settings-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.settings-card-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.settings-card-title {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.settings-card-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.tier-setting-block {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  transition: all 0.2s ease;
}

.tier-setting-block.regular-block {
  border-left: 3.5px solid #3B82F6;
}

.tier-setting-block.vip-block {
  border-left: 3.5px solid #10B981;
}

[data-theme="dark"] .tier-setting-block {
  background: #141A29;
  border-color: #232D42;
}

[data-theme="dark"] .tier-setting-block.regular-block {
  border-left-color: #60A5FA;
}

[data-theme="dark"] .tier-setting-block.vip-block {
  border-left-color: #34D399;
}

.vps-status-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.vps-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
}

.vps-status-row .vps-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.vps-status-row .vps-value {
  color: var(--text-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.vps-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  display: inline-block;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Trash / Recycle Bin Table Slate Header & Modernization */
#view-trash .data-table thead th {
  background: #F8FAFC !important;
  color: #475569 !important;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 18px;
  border-bottom: 1.5px solid #E2E8F0 !important;
}

[data-theme="dark"] #view-trash .data-table thead th {
  background: #1A2234 !important;
  color: #94A3B8 !important;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.08) !important;
}

/* ==========================================================================
   Customer Messaging Hub (WhatsApp, Messenger, Telegram - Request 4 & docs)
   ========================================================================== */
.msg-hub-layout {
  display: flex;
  gap: 0;
  height: calc(100vh - 170px);
  min-height: 620px;
  margin-top: 14px;
  position: relative;
}

@media (max-width: 992px) {
  .msg-hub-layout {
    flex-direction: column;
    height: auto;
    min-height: unset;
  }
}

.msg-contacts-card {
  width: 380px;
  min-width: 280px;
  max-width: 560px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

/* Draggable Splitter Handle (Point 1: Red Mark Resizer) */
.msg-sidebar-resizer {
  width: 14px;
  margin: 0 3px;
  cursor: col-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
  user-select: none;
  touch-action: none;
  flex-shrink: 0;
}

.msg-resizer-line {
  width: 4px;
  height: 48px;
  border-radius: 4px;
  background: var(--border);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.msg-sidebar-resizer:hover .msg-resizer-line,
.msg-sidebar-resizer.is-dragging .msg-resizer-line {
  background: var(--primary);
  width: 5px;
  height: 72px;
  box-shadow: 0 0 10px rgba(26, 115, 232, 0.45);
}

body.msg-resizing {
  cursor: col-resize !important;
  user-select: none !important;
}

.msg-search-box-wrap {
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.msg-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.msg-search-box i {
  position: absolute;
  left: 14px;
  color: var(--text-secondary);
  font-size: 13px;
  pointer-events: none;
}

.msg-search-box input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-secondary);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.msg-search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: var(--surface);
}

/* Channel Filter Pills (Comfortably fits all 4 without scroll, 3px slim scrollbar fallback) */
.msg-channel-filter-pills {
  display: flex;
  gap: 5px;
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}

.channel-filter-pill {
  padding: 5px 6px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
  flex: 1;
  text-align: center;
  white-space: nowrap;
}

.channel-filter-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.channel-filter-pill.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: transparent;
}

.channel-filter-pill.pill-wa.active { background: #25D366; }
.channel-filter-pill.pill-fb.active { background: #0084FF; }
.channel-filter-pill.pill-tg.active { background: #229ED9; }

/* Super-Slim 3px Scrollbars for Messaging (Point 1: scroll bar আরো ছোট হবে) */
.msg-channel-filter-pills::-webkit-scrollbar,
.msg-contacts-list::-webkit-scrollbar,
.msg-templates-bar::-webkit-scrollbar,
.templates-chips-scroll::-webkit-scrollbar,
.msg-timeline::-webkit-scrollbar,
.templates-manage-list::-webkit-scrollbar {
  width: 3px !important;
  height: 3px !important;
}

.msg-channel-filter-pills::-webkit-scrollbar-thumb,
.msg-contacts-list::-webkit-scrollbar-thumb,
.msg-templates-bar::-webkit-scrollbar-thumb,
.templates-chips-scroll::-webkit-scrollbar-thumb,
.msg-timeline::-webkit-scrollbar-thumb,
.templates-manage-list::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

[data-theme="dark"] .msg-channel-filter-pills::-webkit-scrollbar-thumb,
[data-theme="dark"] .msg-contacts-list::-webkit-scrollbar-thumb,
[data-theme="dark"] .msg-templates-bar::-webkit-scrollbar-thumb,
[data-theme="dark"] .templates-chips-scroll::-webkit-scrollbar-thumb,
[data-theme="dark"] .msg-timeline::-webkit-scrollbar-thumb,
[data-theme="dark"] .templates-manage-list::-webkit-scrollbar-thumb {
  background: #475569;
}

.msg-contacts-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.msg-contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 0.18s ease;
  position: relative;
}

.msg-contact-item:hover {
  background: var(--surface-secondary);
}

.msg-contact-item.active {
  background: rgba(37, 99, 235, 0.08);
  border-inline-start: 3px solid var(--primary);
}

[data-theme="dark"] .msg-contact-item.active {
  background: rgba(37, 99, 235, 0.16);
}

.msg-contact-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  position: relative;
}

.channel-avatar-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  background: #FFFFFF;
  border: 1.5px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: transform 0.18s ease;
}

.msg-contact-item:hover .channel-avatar-dot {
  transform: scale(1.15);
}

/* WhatsApp: Official Green */
.channel-avatar-dot.dot-whatsapp,
.channel-avatar-dot.dot-wa,
.channel-avatar-dot.dot-wh {
  background: #FFFFFF;
  color: #25D366;
  border-color: rgba(37, 211, 102, 0.45);
}

/* Messenger: Official Facebook Blue */
.channel-avatar-dot.dot-messenger,
.channel-avatar-dot.dot-fb,
.channel-avatar-dot.dot-me {
  background: #FFFFFF;
  color: #0084FF;
  border-color: rgba(0, 132, 255, 0.45);
}

/* Telegram: Official Sky Blue */
.channel-avatar-dot.dot-telegram,
.channel-avatar-dot.dot-tg,
.channel-avatar-dot.dot-te {
  background: #FFFFFF;
  color: #229ED9;
  border-color: rgba(34, 158, 217, 0.45);
}

[data-theme="dark"] .channel-avatar-dot {
  background: #1E293B;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .channel-avatar-dot.dot-whatsapp,
[data-theme="dark"] .channel-avatar-dot.dot-wa,
[data-theme="dark"] .channel-avatar-dot.dot-wh {
  background: #1E293B;
  color: #25D366;
  border-color: rgba(37, 211, 102, 0.6);
}

[data-theme="dark"] .channel-avatar-dot.dot-messenger,
[data-theme="dark"] .channel-avatar-dot.dot-fb,
[data-theme="dark"] .channel-avatar-dot.dot-me {
  background: #1E293B;
  color: #38BDF8;
  border-color: rgba(0, 132, 255, 0.6);
}

[data-theme="dark"] .channel-avatar-dot.dot-telegram,
[data-theme="dark"] .channel-avatar-dot.dot-tg,
[data-theme="dark"] .channel-avatar-dot.dot-te {
  background: #1E293B;
  color: #38BDF8;
  border-color: rgba(34, 158, 217, 0.6);
}

.msg-contact-info {
  flex: 1;
  min-width: 0;
}

.msg-contact-header-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
  gap: 6px;
}

.msg-contact-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-contact-time {
  font-size: 11px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.msg-contact-snippet {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

/* Chat Main Window */
.msg-chat-window-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.msg-chat-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
}

.chat-header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.chat-user-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.chat-user-name-row h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.active-channel-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.active-channel-badge.badge-wa { background: #DCF8C6; color: #128C7E; }
.active-channel-badge.badge-fb { background: #E7F3FF; color: #0084FF; }
.active-channel-badge.badge-tg { background: #E1F5FE; color: #0288D1; }

[data-theme="dark"] .active-channel-badge.badge-wa { background: rgba(37, 211, 102, 0.2); color: #4ADE80; }
[data-theme="dark"] .active-channel-badge.badge-fb { background: rgba(0, 132, 255, 0.2); color: #60A5FA; }
[data-theme="dark"] .active-channel-badge.badge-tg { background: rgba(34, 158, 217, 0.2); color: #38BDF8; }

.chat-user-meta {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

#btnOpenNativeChat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.smart-external-chat-icon {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

#btnOpenNativeChat:hover .smart-external-chat-icon {
  transform: translate(1px, -1px);
}

/* Chat Timeline */
.msg-timeline {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface-secondary);
}

.msg-date-divider {
  align-self: center;
  padding: 4px 12px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 4px 0;
}

[data-theme="dark"] .msg-date-divider {
  background: rgba(255, 255, 255, 0.08);
}

.msg-bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.msg-bubble.sent {
  align-self: flex-end;
  background: #2563EB;
  color: #FFFFFF;
  border-bottom-right-radius: 3px;
}

.msg-bubble.sent.wa-bubble { background: #128C7E; }
.msg-bubble.sent.fb-bubble { background: #0084FF; }
.msg-bubble.sent.tg-bubble { background: #0088CC; }

.msg-bubble.received {
  align-self: flex-start;
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 3px;
}

.msg-meta-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: 10.5px;
  margin-top: 4px;
  opacity: 0.85;
}

.msg-bubble.sent .msg-meta-row {
  color: rgba(255, 255, 255, 0.85);
}

.msg-bubble.received .msg-meta-row {
  color: var(--text-secondary);
}

.msg-channel-icon-tag {
  font-size: 11px;
}

/* Templates Bar (Point 4: Dynamic Templates + Manage & Edit Action) */
.msg-templates-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  position: relative;
}

.templates-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.templates-chips-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  flex: 1;
  padding: 2px 0;
  scrollbar-width: thin;
}

.template-chip {
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.template-chip:hover {
  background: var(--primary);
  color: #FFFFFF;
  border-color: transparent;
  transform: translateY(-1px);
}

.btn-manage-templates-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary);
  border: 1px solid rgba(26, 115, 232, 0.25);
  background: rgba(26, 115, 232, 0.06);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-manage-templates-action:hover {
  background: var(--primary);
  color: #FFFFFF;
  border-color: transparent;
}

/* Composer Box */
.msg-composer-box {
  padding: 12px 18px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

#composerChannelIndicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

#composerChannelIndicator strong {
  color: var(--text-primary);
}

/* Quick Templates Modal Items & Variable Buttons */
.btn-var-insert {
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px dashed var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-var-insert:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(26, 115, 232, 0.08);
}

.templates-manage-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

.template-manage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: background 0.15s;
}

.template-manage-item:hover {
  background: var(--surface-secondary);
}

.template-manage-item-info {
  min-width: 0;
  flex: 1;
}

.template-manage-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.template-manage-item-snippet {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.template-manage-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.composer-input-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

#msgComposerTextarea {
  flex: 1;
  resize: none;
  min-height: 48px;
  max-height: 120px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface-secondary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#msgComposerTextarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: var(--surface);
}

.btn-send-msg {
  height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.composer-footer-note {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

/* API Credentials Modal Tab styles */
.api-tab-card {
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}

.api-tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.api-tab-title {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

/* ==========================================================================
   Dashboard Metrics Masking & Privacy Mode (docs/design.md Section 46)
   ========================================================================== */
.btn-mask-toggle {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 3px 6px;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-mask-toggle:hover {
  color: var(--primary);
  background: var(--surface-secondary);
}

.stat-value.masked-figure {
  letter-spacing: 2.5px !important;
  color: var(--text-secondary) !important;
  user-select: none;
}

/* ==========================================================================
   Global Smart Date Filter Component (docs/design.md Section 52)
   ========================================================================== */
.global-date-filter {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 16px;
  box-shadow: none;
  position: relative;
}

.analytics-toolbar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.02);
  position: relative;
  transition: background-color var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.gdf-smart-wrapper {
  width: 100%;
  position: relative;
}

.gdf-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
}

/* --- Left Group: Filter Tag & Segmented Capsule Control --- */
.gdf-left-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gdf-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 4px 10px;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: 9999px;
  user-select: none;
}

.gdf-tag i {
  color: var(--primary);
  font-size: 12px;
}

.gdf-segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 3px;
  user-select: none;
}

.gdf-seg-btn {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 13px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

.gdf-seg-btn:hover {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.06);
}

.gdf-seg-btn.active {
  background: var(--surface, #FFFFFF) !important;
  color: var(--primary, #4F46E5) !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="dark"] .gdf-seg-btn.active {
  background: #1E2433 !important;
  color: #818CF8 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* --- Center Group: Live Pulse Indicator --- */
.gdf-center-group {
  display: flex;
  align-items: center;
}

.gdf-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-tertiary, #64748B);
  padding: 3px 10px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 9999px;
  user-select: none;
}

.gdf-live-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
  animation: gdfPulse 2s infinite;
}

@keyframes gdfPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* --- Right Group: Stepper & Trigger --- */
.gdf-right-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gdf-stepper {
  display: inline-flex;
  align-items: center;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.gdf-nav-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all 0.2s ease;
}

.gdf-nav-btn:hover:not(:disabled) {
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.gdf-nav-btn.disabled,
.gdf-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.gdf-date-trigger {
  height: 30px;
  padding: 0 12px;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  border-radius: 9999px;
  transition: all 0.2s ease;
  user-select: none;
}

.gdf-date-trigger:hover {
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.gdf-cal-icon {
  color: var(--primary);
  font-size: 12px;
}

.gdf-days-badge {
  background: rgba(99, 102, 241, 0.12);
  color: #4F46E5;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  line-height: 1.2;
}

[data-theme="dark"] .gdf-days-badge {
  background: rgba(99, 102, 241, 0.24);
  color: #A5B4FC;
}

.gdf-arrow-icon {
  font-size: 10px;
  color: var(--text-tertiary);
  transition: transform 0.2s ease;
}

.gdf-arrow-icon.open {
  transform: rotate(180deg);
}

.gdf-today-chip {
  height: 32px;
  padding: 0 11px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.gdf-today-chip:hover {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* --- Smart Date Range Popover --- */
.gdf-smart-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 440px;
  max-width: 95vw;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.06);
  z-index: 1050;
  overflow: hidden;
  animation: gdfPopoverIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gdfPopoverIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.gdf-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-secondary);
}

.gdf-popover-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.gdf-popover-title i {
  color: var(--primary);
}

.gdf-popover-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.gdf-popover-close-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
}

.gdf-popover-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gdf-popover-shortcuts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gdf-shortcuts-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.gdf-shortcuts-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gdf-quick-chip {
  padding: 4px 11px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface-secondary);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.gdf-quick-chip:hover {
  background: rgba(99, 102, 241, 0.1);
  color: #4F46E5;
  border-color: rgba(99, 102, 241, 0.35);
}

.gdf-quick-chip.active {
  background: var(--primary) !important;
  color: #FFFFFF !important;
  border-color: var(--primary) !important;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.35) !important;
  font-weight: 700 !important;
}

.gdf-popover-inputs-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.gdf-input-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gdf-input-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.gdf-input-field {
  position: relative;
  display: flex;
  align-items: center;
}

.gdf-field-icon {
  position: absolute;
  left: 9px;
  font-size: 12px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.gdf-date-ctrl {
  width: 100%;
  height: 34px;
  padding: 4px 8px 4px 28px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease;
}

.gdf-date-ctrl:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.gdf-inputs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 12px;
  margin-top: 14px;
}

.gdf-popover-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.gdf-popover-summary {
  font-size: 12px;
  color: var(--text-secondary);
}

.gdf-popover-summary strong {
  color: var(--primary);
  font-weight: 700;
}

.gdf-popover-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gdf-btn-cancel {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 8px;
}

.gdf-btn-apply {
  height: 32px;
  padding: 0 14px;
  font-size: 12px;
  border-radius: 8px;
  font-weight: 600;
}

/* Responsive Handling */
@media (max-width: 991px) {
  .gdf-center-group {
    display: none;
  }
}

@media (max-width: 768px) {
  .gdf-bar {
    justify-content: flex-end;
    gap: 10px;
  }
  .gdf-right-group {
    width: 100%;
    justify-content: flex-end;
  }
  .gdf-stepper {
    flex: 1;
    justify-content: space-between;
  }
  .gdf-smart-popover {
    left: 0;
    right: 0;
    width: 100%;
  }
}

.analytics-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.analytics-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.analytics-chart-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.analytics-chart-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 3px 0 0 0;
}

.chart-dataset-toggles {
  display: inline-flex;
  background: var(--surface-secondary);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border);
  gap: 2px;
}

.chart-dataset-toggle-btn {
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.chart-dataset-toggle-btn.active {
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-weight: 700;
}

.analytics-legend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.analytics-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--border);
}

.legend-color-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-name {
  color: var(--text-primary);
  font-weight: 500;
}

.legend-val {
  color: var(--text-primary);
  font-size: 12px;
}

.analytics-rank-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  border-radius: 50% !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  margin: 0 auto !important;
  text-align: center !important;
  padding: 0 !important;
  background: var(--surface-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  white-space: nowrap !important;
}

.analytics-rank-badge.gold {
  background: #FEF3C7 !important;
  color: #B45309 !important;
  border: 1.5px solid #F59E0B !important;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.28) !important;
}

.analytics-rank-badge.silver {
  background: #F1F5F9 !important;
  color: #334155 !important;
  border: 1.5px solid #94A3B8 !important;
  box-shadow: 0 1px 3px rgba(100, 116, 139, 0.18) !important;
}

.analytics-rank-badge.bronze {
  background: #FFEDD5 !important;
  color: #C2410C !important;
  border: 1.5px solid #FB923C !important;
  box-shadow: 0 1px 3px rgba(234, 88, 12, 0.18) !important;
}

.analytics-rank-badge.rank-other {
  background: var(--surface-secondary) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border) !important;
  font-weight: 600 !important;
}

/* Product thumbnail small standard across analytics and tables */
.product-thumb-small {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface-secondary);
  display: block;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-thumb-small:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Global Data-table Image Safeguard: Never allow any table cell image to exceed thumbnail size */
.data-table td img {
  max-width: 48px;
  max-height: 48px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

/* Analytics Leaderboard Row Styling */
.analytics-leaderboard-row td {
  padding: 12px 14px !important;
  vertical-align: middle;
}

.analytics-leaderboard-row:hover {
  background: var(--surface-hover) !important;
}

/* Responsive charts grid */
@media (max-width: 1024px) {
  .analytics-charts-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Dark Mode Adaptations for Analytics */
[data-theme="dark"] .analytics-preset-pill:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #A5B4FC;
}

[data-theme="dark"] .analytics-rank-badge.gold {
  background: rgba(245, 158, 11, 0.2);
  color: #FDE68A;
  border-color: rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .analytics-rank-badge.silver {
  background: rgba(148, 163, 184, 0.2);
  color: #E2E8F0;
  border-color: rgba(148, 163, 184, 0.4);
}

[data-theme="dark"] .analytics-rank-badge.bronze {
  background: rgba(234, 88, 12, 0.2);
  color: #FDBA74;
  border-color: rgba(234, 88, 12, 0.4);
}

/* ==========================================================================
   Reports View Styling (docs/design.md Section 47)
   ========================================================================== */
.reports-view-header {
  margin-bottom: 24px;
}

.reports-type-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-secondary);
  padding: 6px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.reports-type-tabs::-webkit-scrollbar {
  display: none;
}

.reports-type-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.reports-type-btn:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.04);
}

.reports-type-btn.active {
  background: var(--surface);
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.reports-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.reports-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.reports-stat-card:hover {
  border-color: var(--border-focus);
}

.report-meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
}

/* ==========================================================================
   Single Product Detail View Styling (#view-product-detail)
   ========================================================================== */
.single-prod-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .single-prod-layout {
    grid-template-columns: 1fr;
  }
}

.single-prod-gallery-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.single-prod-main-img-wrap {
  width: 100%;
  height: 280px;
  background: var(--surface-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.single-prod-main-img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.single-prod-main-img:hover {
  transform: scale(1.04);
}

.single-prod-badge-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--primary);
  color: #FFFFFF;
}

.single-prod-quick-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 12px;
}

.single-prod-quick-meta-item {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.single-prod-quick-meta-item .meta-lbl {
  color: var(--text-secondary);
  font-size: 11px;
}

.single-prod-quick-meta-item .meta-val {
  color: var(--text-primary);
  font-weight: 700;
}

/* Pricing Hero Banner */
.single-prod-pricing-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface-secondary);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.single-prod-price-hero {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}

.single-prod-pills-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.single-prod-cost-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.single-prod-margin-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* 3-Day Price History Card & Step Cards */
.price-history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-bottom: 20px;
}

.price-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.price-3day-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 640px) {
  .price-3day-grid {
    grid-template-columns: 1fr;
  }
}

.price-history-step-card {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-secondary);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: var(--transition);
}

.price-history-step-card.step-today {
  border: 2px solid var(--primary);
  background: rgba(37, 99, 235, 0.04);
}

.price-history-date-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.price-history-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
}

.price-history-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.price-history-status-badge.changed {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.price-history-status-badge.carried {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.25);
}

.price-inline-edit-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

/* Product Admin Note Card */
.prod-note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-bottom: 20px;
}

.prod-note-textarea {
  width: 100%;
  min-height: 90px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-secondary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  transition: var(--transition);
  box-sizing: border-box;
}

.prod-note-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.prod-note-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Table Enhancements: 3-Day Price badge and Product Note pill */
.price-3day-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  margin-top: 3px;
  cursor: pointer;
  transition: var(--transition);
}

.price-3day-badge:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.prod-table-note-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 9999px;
  background: rgba(245, 158, 11, 0.12);
  color: #B45309;
  border: 1px solid rgba(245, 158, 11, 0.3);
  cursor: pointer;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: var(--transition);
}

.prod-table-note-pill:hover {
  background: rgba(245, 158, 11, 0.22);
}

.btn-table-add-note {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px dashed var(--border);
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
}

.btn-table-add-note:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}

.prod-title-link {
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}

.prod-title-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ==========================================================================
   Single Product Detail — Reference Redesign (docs/design.md Section 49)
   ========================================================================== */
.pd-page-header {
  align-items: flex-start;
  margin-bottom: 18px;
}

.pd-page-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.pd-heading-text {
  min-width: 0;
}

.pd-heading-text .page-title {
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.2px;
  overflow-wrap: anywhere;
}

.pd-heading-text .page-desc {
  font-size: 12.5px;
  margin-top: 4px;
  line-height: 1.5;
}

.pd-back-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-top: 1px;
}

.pd-back-btn i {
  color: var(--primary);
  font-size: 11px;
}

.pd-back-btn:hover {
  color: var(--primary);
}

.pd-page-actions {
  gap: 10px;
  align-items: center;
}

.pd-pagination {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 34px;
  padding: 3px 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
}

.pd-page-nav {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 11px;
  transition: var(--transition);
}

.pd-page-nav:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.pd-page-counter {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 0 8px;
  white-space: nowrap;
}

.pd-edit-btn {
  height: 34px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 12.5px;
  gap: 6px;
}

.pd-layout {
  display: grid;
  grid-template-columns: 318px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.pd-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.pd-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.pd-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.pd-media-card {
  padding: 14px;
}

.pd-media-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1.08 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
}

.pd-media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.pd-media-wrap:hover .pd-media-img {
  transform: scale(1.025);
}

.pd-media-stock-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #FFFFFF;
  line-height: 1.3;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2;
}

.pd-media-stock-badge.is-in {
  background: #047857;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.pd-media-stock-badge.is-out {
  background: #B91C1C;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.pd-stock-panel {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.pd-stock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pd-stock-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 0;
}

.pd-stock-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  flex-shrink: 0;
}

.pd-stock-value {
  font-size: 15px;
  font-weight: 700;
  color: #059669;
  white-space: nowrap;
}

.pd-stock-value.is-low {
  color: #D97706;
}

.pd-stock-value.is-out {
  color: var(--danger);
}

.pd-stock-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 11px;
}

.pd-stock-btn {
  flex: 1 1 0;
  min-width: 0;
  height: 31px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-secondary);
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  transition: var(--transition);
}

.pd-stock-btn i {
  font-size: 8px;
}

.pd-stock-btn:hover:not(:disabled) {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.pd-stock-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pd-stock-toggle {
  margin-left: 2px;
  flex: 0 0 auto;
}

.pd-mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pd-mini-stat {
  min-height: 58px;
  padding: 10px 13px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 0;
}

.pd-mini-stat span {
  font-size: 10.5px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.pd-mini-stat strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pd-summary-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 22px;
}

.pd-summary-header {
  min-width: 0;
}

.pd-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.pd-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: var(--transition);
  border: 1px solid transparent;
}

.pd-chip i {
  font-size: 11px;
  opacity: 0.9;
}

.pd-chip.is-category {
  background: #EFF6FF;
  color: #1D4ED8;
  border-color: #BFDBFE;
}

.pd-chip.is-brand {
  background: #FFFBEB;
  color: #B45309;
  border-color: #FDE68A;
}

.pd-chip.is-unit {
  background: #F0FDF4;
  color: #15803D;
  border-color: #BBF7D0;
}

.pd-chip.is-sku {
  background: #F8FAFC;
  color: #475569;
  border-color: #E2E8F0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  font-weight: 700;
}

[data-theme="dark"] .pd-chip.is-category {
  background: rgba(59, 130, 246, 0.16);
  color: #93C5FD;
  border-color: rgba(59, 130, 246, 0.32);
}

[data-theme="dark"] .pd-chip.is-brand {
  background: rgba(245, 158, 11, 0.16);
  color: #FCD34D;
  border-color: rgba(245, 158, 11, 0.32);
}

[data-theme="dark"] .pd-chip.is-unit {
  background: rgba(34, 197, 94, 0.16);
  color: #86EFAC;
  border-color: rgba(34, 197, 94, 0.32);
}

[data-theme="dark"] .pd-chip.is-sku {
  background: rgba(148, 163, 184, 0.14);
  color: #CBD5E1;
  border-color: rgba(148, 163, 184, 0.28);
}

.pd-product-title {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 800;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.pd-product-en {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

/* ==========================================================================
   Full-Width Executive Pricing Showcase (User Request 4)
   ========================================================================== */
.pd-pricing-showcase {
  display: grid;
  grid-template-columns: 1.35fr 1.15fr 1.2fr;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
}

@media (max-width: 1024px) {
  .pd-pricing-showcase {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .pd-pricing-showcase {
    grid-template-columns: 1fr;
  }
}

.pd-price-metric-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.pd-price-metric-box.is-highlighted {
  background: var(--primary-light);
  border-color: rgba(65, 150, 255, 0.35);
}

.pd-metric-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pd-metric-lbl i {
  font-size: 10.5px;
  color: var(--primary);
}

.pd-metric-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 36px;
}

.pd-hero-price-val {
  font-size: 26px;
  line-height: 1.15;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
}

.pd-hero-old-price {
  font-size: 13px;
  color: var(--text-tertiary);
  text-decoration: line-through;
  white-space: nowrap;
}

.pd-discount-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: #EF4444;
  color: #FFFFFF;
  white-space: nowrap;
}

.pd-hero-cost-val {
  font-size: 24px;
  line-height: 1.15;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  min-height: 36px;
  display: flex;
  align-items: center;
}

.pd-hero-margin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.pd-hero-margin-badge.is-profit {
  color: #059669;
}

.pd-hero-margin-badge.is-loss {
  color: var(--danger);
}

.pd-hero-margin-badge .pd-margin-rate {
  font-size: 11.5px;
  font-weight: 600;
  opacity: 0.85;
}

.pd-metric-lbl-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.pd-btn-inline-edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: var(--transition);
}

.pd-btn-inline-edit:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.pd-price-display-view {
  width: 100%;
}

.pd-quick-price-val-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
}

.pd-quick-price-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #F0FDF4;
  color: #15803D;
  border: 1px solid #BBF7D0;
}

[data-theme="dark"] .pd-quick-price-chip {
  background: rgba(34, 197, 94, 0.15);
  color: #86EFAC;
  border-color: rgba(34, 197, 94, 0.3);
}

.pd-price-edit-view {
  width: 100%;
}

.pd-quick-cancel-btn {
  height: 36px;
  width: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}

.pd-quick-adjust-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.pd-input-symbol-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.pd-curr-symbol {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-tertiary);
  pointer-events: none;
}

.pd-quick-adjust-input {
  width: 100%;
  height: 36px;
  padding: 0 8px 0 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  transition: var(--transition);
}

.pd-quick-adjust-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(65, 150, 255, 0.16);
  outline: none;
}

.pd-quick-adjust-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.pd-section-card {
  padding: 18px 20px;
}

.pd-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.pd-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.pd-section-title-wrap.no-icon {
  gap: 0;
}

.pd-section-icon {
  width: 29px;
  height: 29px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 12.5px;
}

.pd-section-icon.is-amber {
  background: rgba(255, 172, 49, 0.16);
  color: #D97706;
}

.pd-section-icon.is-blue {
  background: var(--primary-light);
  color: var(--primary);
}

.pd-section-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--text-primary);
}

/* Timeline Range Segmented Tabs Filter (User Request 3: Global Order Management Parity) */
.pd-history-tabs {
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.pd-history-tabs .tab-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.pd-history-tabs .tab-btn:hover {
  color: var(--text-primary);
}

.pd-history-tabs .tab-btn.active {
  color: var(--primary);
  font-weight: 700;
}

/* =========================================================================
   Interactive Price Trend Graph (Image 2 Parity)
   ========================================================================= */
.pd-graph-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px 12px 14px;
  margin-bottom: 16px;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: border-color var(--transition);
}

.pd-graph-card:hover {
  border-color: var(--border-focus);
}

.pd-graph-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 4px;
}

.pd-graph-range-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Fresh Executive Metrics Strip (Point 2 Parity) */
.pd-graph-metrics-strip {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 4px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  gap: 12px;
}

.pd-gmetric-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pd-gmetric-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pd-gmetric-dot.is-avg { background: #0284C7; }
.pd-gmetric-dot.is-min { background: #F59E0B; }
.pd-gmetric-dot.is-max { background: #10B981; }

.pd-gmetric-label {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.pd-gmetric-val {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}
.pd-gmetric-val.is-avg { color: #0284C7; }
.pd-gmetric-val.is-min { color: #D97706; }
.pd-gmetric-val.is-max { color: #059669; }

.pd-gmetric-divider {
  width: 1px;
  height: 16px;
  background: var(--border);
}

.pd-graph-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.pd-graph-pill.is-range {
  background: var(--surface-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Graph Body Layout: Pure HTML Y-Axis + SVG Plot Canvas (Point 1 Parity) */
.pd-graph-body-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  position: relative;
  width: 100%;
}

.pd-graph-y-axis {
  position: relative;
  width: 38px;
  flex-shrink: 0;
  height: 220px;
  user-select: none;
}

.pd-y-tick {
  position: absolute;
  right: 6px;
  transform: translateY(-50%);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-tertiary);
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
}

.pd-graph-canvas-wrap {
  flex: 1;
  position: relative;
  height: 220px;
  min-width: 0;
  overflow: visible;
  user-select: none;
}

.pd-price-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.pg-grid-line {
  stroke: var(--border);
  stroke-dasharray: 4 4;
  stroke-width: 1px;
  opacity: 0.85;
}

.pg-ref-line {
  stroke: #94A3B8;
  stroke-dasharray: 5 4;
  stroke-width: 1.2px;
  opacity: 0.65;
}

.pg-line-curve {
  fill: none;
  stroke: #10B981;
  stroke-width: 2.6px;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(16, 185, 129, 0.2));
}

.pg-crosshair-line {
  stroke: #94A3B8;
  stroke-dasharray: 4 4;
  stroke-width: 1.2px;
  opacity: 0.75;
  transition: x1 0.06s ease-out, x2 0.06s ease-out;
}

/* Interactive Pure HTML Active Dot (Zero Distortion / True Circle Parity) */
.pg-active-marker {
  position: absolute;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: left 0.05s ease-out, top 0.05s ease-out, opacity 0.15s ease;
}

.pg-marker-halo {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50% !important;
  background: rgba(16, 185, 129, 0.22);
  border: 1.5px solid rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.35);
}

.pg-marker-dot {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50% !important;
  background: #059669;
  border: 2px solid #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* Floating Tooltip Card (Image 2 Parity) */
.pd-graph-tooltip {
  position: absolute;
  pointer-events: none;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.12), 0 2px 6px -1px rgba(0, 0, 0, 0.06);
  padding: 8px 14px;
  min-width: 130px;
  transition: left 0.06s ease-out, top 0.06s ease-out, opacity 0.15s ease;
  z-index: 10;
  opacity: 0;
}

.pd-graph-tooltip-date {
  font-size: 11.5px;
  font-weight: 500;
  color: #64748B;
  margin-bottom: 4px;
  white-space: nowrap;
  font-family: inherit;
}

.pd-graph-tooltip-val-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.pd-graph-tooltip-price {
  font-size: 17.5px;
  font-weight: 700;
  color: #0F172A;
  line-height: 1;
  font-family: inherit;
}

.pd-graph-tooltip-trend {
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  line-height: 1;
}

.pd-graph-tooltip-trend .is-up {
  color: #059669;
}

.pd-graph-tooltip-trend .is-down {
  color: #EF4444;
}

.pd-graph-tooltip-trend .is-neutral {
  color: #64748B;
}

[data-theme="dark"] .pd-graph-tooltip {
  background: #1E2433;
  border-color: #334155;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .pd-graph-tooltip-date {
  color: #94A3B8;
}

[data-theme="dark"] .pd-graph-tooltip-price {
  color: #F8FAFC;
}

[data-theme="dark"] .pg-ref-line {
  stroke: #64748B;
  opacity: 0.55;
}

[data-theme="dark"] .pg-crosshair-line {
  stroke: #64748B;
  opacity: 0.65;
}

/* Dynamic Daily History Grid */
.pd-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.pd-history-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pd-history-card:hover {
  border-color: var(--border-focus);
}

.pd-history-card.is-today {
  background: var(--primary-light);
  border-color: var(--primary);
}

.pd-history-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.pd-history-day {
  font-size: 11.5px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pd-history-card.is-today .pd-history-day {
  color: var(--primary);
}

.pd-btn-history-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-tertiary);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.pd-history-card:hover .pd-btn-history-edit {
  color: var(--text-secondary);
  border-color: var(--border);
  background: var(--surface);
}

.pd-btn-history-edit:hover {
  background: var(--primary-light) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  transform: scale(1.1);
}

.pd-history-price {
  font-size: 19px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--text-primary);
}

.pd-history-card.is-today .pd-history-price {
  color: var(--primary);
}

.pd-history-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 10.5px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--text-secondary);
}

.pd-history-status i {
  font-size: 8px;
}

.pd-history-status.is-active {
  color: var(--primary);
}

.pd-history-status.is-up {
  color: #059669;
}

.pd-history-status.is-down {
  color: var(--danger);
}

.pd-history-status.is-unchanged {
  color: var(--text-tertiary);
}

.pd-history-note {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.pd-history-note i {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--primary);
  font-size: 11px;
}

/* Progressive Daily Price Lazy Loading Footer (Point 3 Parity) */
.pd-lazy-load-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--surface-secondary);
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.pd-lazy-load-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.pd-lazy-spinner {
  color: var(--primary);
  font-size: 13px;
}

.pd-btn-load-more {
  height: 32px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  gap: 6px;
  display: inline-flex;
  align-items: center;
}

/* Sidebar Note Card Adaptation (User Request 3) */
.pd-side #singleProdNoteSection {
  padding: 14px 16px;
  width: 100%;
}

.pd-side #singleProdNoteSection .pd-section-head {
  margin-bottom: 10px;
}

.pd-side #singleProdNoteSection .pd-section-title {
  font-size: 13.5px;
}

.pd-side #singleProdNoteSection .pd-btn-note-edit {
  height: 26px;
  padding: 0 8px;
  font-size: 11px;
}

.pd-side #singleProdNoteSection .pd-note-textarea {
  min-height: 84px;
  font-size: 12.5px;
}

.pd-btn-note-edit {
  height: 30px;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 600;
  gap: 5px;
  border-radius: 7px;
}

.pd-note-display-view {
  width: 100%;
}

.pd-note-content-box {
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 12px 14px;
  transition: var(--transition);
}

.pd-note-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.pd-note-empty-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 9px;
  background: var(--surface-secondary);
  border: 1px dashed var(--border);
  font-size: 12.5px;
  color: var(--text-tertiary);
}

.pd-note-empty-box i {
  color: #F59E0B;
  font-size: 14px;
  flex-shrink: 0;
}

.pd-note-edit-view {
  width: 100%;
}

.pd-note-textarea {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-secondary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
  transition: var(--transition);
}

.pd-note-textarea::placeholder {
  color: var(--text-tertiary);
}

.pd-note-textarea:hover {
  border-color: var(--primary);
}

.pd-note-textarea:focus {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(65, 150, 255, 0.14);
  outline: none;
}

.pd-note-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.pd-note-footer .btn {
  height: 32px;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  gap: 5px;
}

.pd-btn-note-cancel {
  height: 32px;
  padding: 0 12px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 8px;
  gap: 5px;
}

.pd-orders-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.pd-orders-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--text-primary);
}

.pd-orders-title i {
  color: var(--primary);
  font-size: 14px;
}

.pd-orders-count {
  font-size: 10.5px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.pd-orders-empty {
  min-height: 92px;
  padding: 18px;
  border-radius: 11px;
  background: var(--surface-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
}

.pd-orders-empty i {
  font-size: 24px;
  color: var(--text-tertiary);
  opacity: 0.35;
}

.pd-orders-empty p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.pd-orders-table-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible !important;
  max-height: none !important;
}

/* Recent Orders 10-Item Pagination Bar (Point 4 Parity) */
.pd-orders-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.pd-orders-pagination-info {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.pd-orders-pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pd-page-pills {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pd-page-pill-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.pd-page-pill-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pd-page-pill-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
}

.pd-page-btn {
  height: 28px;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pd-orders-table {
  font-size: 12px;
}

.pd-orders-table .is-center {
  text-align: center;
}

.pd-order-id {
  color: var(--primary);
}

.pd-order-date {
  font-size: 11px;
  color: var(--text-secondary);
}

@media (max-width: 1100px) {
  .pd-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }
}

@media (max-width: 1024px) {
  .pd-layout {
    grid-template-columns: 1fr;
  }

  .pd-media-wrap {
    aspect-ratio: 1.7 / 1;
    max-height: 340px;
  }
}

@media (max-width: 900px) {
  .pd-page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .pd-page-actions {
    justify-content: flex-end;
  }

  .pd-heading-text .page-title {
    font-size: 22px;
  }
}

@media (max-width: 640px) {
  .pd-page-heading {
    flex-wrap: wrap;
  }

  .pd-heading-text .page-desc {
    font-size: 12px;
  }

  .pd-layout {
    gap: 14px;
  }

  .pd-media-wrap {
    aspect-ratio: 1.4 / 1;
  }

  .pd-summary-card,
  .pd-section-card {
    padding: 16px;
  }

  .pd-section-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .pd-history-filters {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .pd-history-grid {
    grid-template-columns: 1fr;
  }

  .pd-orders-head {
    flex-wrap: wrap;
  }
}

/* Dark Mode Overrides for Reports and Single Product View */
[data-theme="dark"] .pd-pricing-showcase {
  background: #181E2C;
  border-color: #283348;
}

[data-theme="dark"] .pd-price-metric-box {
  background: #1F2637;
  border-color: #2E3A52;
}

[data-theme="dark"] .pd-price-metric-box.is-highlighted {
  background: rgba(65, 150, 255, 0.16);
  border-color: rgba(65, 150, 255, 0.35);
}

[data-theme="dark"] .pd-quick-adjust-input {
  background: #181E2C;
  border-color: #2E3A52;
  color: #FFFFFF;
}

[data-theme="dark"] .pd-history-tabs {
  background: #141A29;
  border-color: #2E3A52;
}

[data-theme="dark"] .pd-history-tabs .tab-btn {
  color: #94A3B8;
}

[data-theme="dark"] .pd-history-tabs .tab-btn:hover {
  color: #F8FAFC;
}

[data-theme="dark"] .pd-history-tabs .tab-btn.active {
  color: #60A5FA;
}

[data-theme="dark"] .pd-history-card.is-today {
  background: rgba(65, 150, 255, 0.14);
}

[data-theme="dark"] .reports-type-btn.active {
  background: #1E293B;
  color: #60A5FA;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .price-history-step-card.step-today {
  background: rgba(59, 130, 246, 0.12);
  border-color: #3B82F6;
}

[data-theme="dark"] .price-history-status-badge.changed {
  background: rgba(16, 185, 129, 0.22);
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .price-history-status-badge.carried {
  background: rgba(148, 163, 184, 0.15);
  color: #94A3B8;
  border-color: rgba(148, 163, 184, 0.3);
}

[data-theme="dark"] .single-prod-margin-pill {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .prod-table-note-pill {
  background: rgba(245, 158, 11, 0.2);
  color: #FDE68A;
  border-color: rgba(245, 158, 11, 0.4);
}

/* ==========================================================================
   Admin Profile Module Styles - Modern Executive Design (docs/design.md Section 48.1)
   ========================================================================== */
.profile-page-header {
  margin-bottom: 24px;
}

.profile-header-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-header-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(65, 150, 255, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  border: 1px solid rgba(65, 150, 255, 0.2);
}

.profile-header-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.profile-role-pill-hero {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(255, 172, 49, 0.14) 0%, rgba(245, 158, 11, 0.2) 100%);
  color: #B45309;
  border: 1px solid rgba(255, 172, 49, 0.3);
}

.profile-page-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

@media (max-width: 1080px) {
  .profile-page-grid {
    grid-template-columns: 1fr;
  }
}

/* Card Foundation */
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: var(--transition);
  overflow: hidden;
}

/* Left Column: Fresh Executive Identity Card */
.profile-identity-card {
  text-align: center;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 4px 24px -4px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  overflow: hidden;
}

.profile-card-cover {
  height: 104px;
  background: linear-gradient(135deg, #1D4ED8 0%, #3B82F6 45%, #6366F1 100%);
  position: relative;
  padding: 12px 16px;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.profile-verified-badge {
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.2px;
}

.profile-card-body {
  padding: 0 20px 22px 20px;
}

.profile-avatar-outer {
  display: flex;
  justify-content: center;
  margin-top: -52px;
  margin-bottom: 12px;
}

.profile-avatar-box {
  position: relative;
  display: inline-block;
}

.profile-card-avatar {
  width: 98px;
  height: 98px;
  border-radius: 50%;
  border: 4px solid var(--surface);
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  color: #FFFFFF;
  font-size: 38px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px -2px rgba(37, 99, 235, 0.35);
  overflow: hidden;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.profile-card-avatar:hover {
  transform: scale(1.02);
}

.profile-avatar-camera-btn {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2563EB;
  color: #FFFFFF;
  border: 2.5px solid var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

.profile-avatar-camera-btn:hover {
  transform: scale(1.12);
  background: #1D4ED8;
}

.profile-online-indicator {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #10B981;
  border: 2.5px solid var(--surface);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.profile-card-name {
  font-size: 21px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 2px 0;
  letter-spacing: -0.2px;
}

.profile-card-name-en {
  font-size: 13px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 10px;
  font-weight: 500;
}

.profile-card-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.08);
  color: #4F46E5;
  border: 1px solid rgba(99, 102, 241, 0.2);
  margin-bottom: 16px;
}

[data-theme="dark"] .profile-card-role-pill {
  background: rgba(139, 92, 246, 0.18);
  color: #C4B5FD;
  border-color: rgba(139, 92, 246, 0.35);
}

/* Fresh Airy Bio Quote Card */
.profile-bio-box {
  background: #F8FAFC;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
  text-align: center;
  border: 1px solid #E2E8F0;
  position: relative;
  transition: var(--transition);
}

[data-theme="dark"] .profile-bio-box {
  background: #0F172A;
  border-color: #334155;
}

.profile-bio-box .bio-quote-icon {
  font-size: 11px;
  color: var(--primary);
  opacity: 0.6;
  margin-bottom: 4px;
  display: inline-block;
}

.profile-bio-box p {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 500;
}

/* Fresh Unified Meta Information List (Clean, Seamless Rows) */
.profile-meta-list {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2px 0;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  text-align: left;
  overflow: hidden;
}

[data-theme="dark"] .profile-meta-list {
  background: #0F172A;
  border-color: #334155;
}

.profile-meta-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  transition: background 0.15s ease;
}

.profile-meta-item:last-child {
  border-bottom: none;
}

.profile-meta-item:hover {
  background: rgba(241, 245, 249, 0.7);
}

[data-theme="dark"] .profile-meta-item:hover {
  background: rgba(30, 41, 59, 0.7);
}

.profile-meta-item .meta-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  flex-shrink: 0;
}

.meta-icon-email { background: #EFF6FF; color: #2563EB; border: 1px solid rgba(37, 99, 235, 0.15); }
.meta-icon-phone { background: #ECFDF5; color: #059669; border: 1px solid rgba(5, 150, 105, 0.15); }
.meta-icon-dept { background: #F5F3FF; color: #7C3AED; border: 1px solid rgba(124, 58, 237, 0.15); }
.meta-icon-loc { background: #FFFBEB; color: #D97706; border: 1px solid rgba(217, 119, 6, 0.15); }
.meta-icon-joined { background: #F1F5F9; color: #475569; border: 1px solid rgba(71, 85, 105, 0.15); }

[data-theme="dark"] .meta-icon-email { background: rgba(37, 99, 235, 0.18); color: #60A5FA; border-color: rgba(37, 99, 235, 0.3); }
[data-theme="dark"] .meta-icon-phone { background: rgba(16, 185, 129, 0.18); color: #34D399; border-color: rgba(16, 185, 129, 0.3); }
[data-theme="dark"] .meta-icon-dept { background: rgba(124, 58, 237, 0.18); color: #A78BFA; border-color: rgba(124, 58, 237, 0.3); }
[data-theme="dark"] .meta-icon-loc { background: rgba(245, 158, 11, 0.18); color: #FBBF24; border-color: rgba(245, 158, 11, 0.3); }
[data-theme="dark"] .meta-icon-joined { background: rgba(148, 163, 184, 0.18); color: #CBD5E1; border-color: rgba(148, 163, 184, 0.3); }

.profile-meta-item .meta-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.profile-meta-item .meta-title {
  font-size: 10.5px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.4px;
}

.profile-meta-item .meta-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-copy-meta {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  opacity: 0.75;
}

.profile-meta-item:hover .btn-copy-meta {
  opacity: 1;
}

.btn-copy-meta:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
  transform: scale(1.06);
}

.btn-copy-meta.copied {
  color: #059669;
  border-color: #059669;
  background: rgba(16, 185, 129, 0.12);
}

/* Fresh Security Snapshot Sub-Card */
.profile-security-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 14px 16px;
  text-align: left;
}

[data-theme="dark"] .profile-security-box {
  background: #0F172A;
  border-color: #334155;
}

.security-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #E2E8F0;
}

[data-theme="dark"] .security-box-header {
  border-color: #334155;
}

.sec-box-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.sec-live-chip {
  font-size: 11px;
  font-weight: 700;
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sec-live-chip .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4);
}

.security-meta-grid {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sec-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  gap: 8px;
  padding: 2px 0;
}

.sec-meta-label {
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.sec-meta-label i {
  font-size: 12px;
  opacity: 0.85;
}

.sec-meta-val {
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 175px;
}

.sec-2fa-badge {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

[data-theme="dark"] .sec-2fa-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.35);
}

/* Right Column: Forms & Controls */
.profile-forms-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.profile-form-card {
  border-radius: 16px;
}

.profile-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.card-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-header-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.card-header-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 2px 0;
}

.card-header-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 0;
}

.chip-badge {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chip-blue { background: rgba(65, 150, 255, 0.12); color: var(--primary); }
.chip-amber { background: rgba(245, 158, 11, 0.12); color: #D97706; }
.chip-purple { background: rgba(139, 92, 246, 0.12); color: #7C3AED; }

.profile-form-body {
  padding: 24px;
}

/* Read-Only Details View (Default View Mode) */
.profile-details-view {
  padding: 24px;
  animation: fadeIn 0.22s ease-out;
}

.profile-view-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 20px;
}

@media (max-width: 680px) {
  .profile-view-grid {
    grid-template-columns: 1fr;
  }
}

.profile-view-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  transition: var(--transition);
}

.profile-view-item:hover {
  border-color: rgba(65, 150, 255, 0.4);
}

.profile-view-item.full-width {
  grid-column: 1 / -1;
}

.profile-view-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.profile-view-label i {
  color: var(--primary);
  font-size: 12px;
}

.profile-view-val {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

.profile-view-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.profile-card-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-note-text {
  font-size: 12px;
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Inputs with Inner Left Icons */
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-tertiary);
  font-size: 14px;
  pointer-events: none;
  transition: color 0.15s;
}

.input-with-icon .form-input {
  padding-left: 40px !important;
}

.input-with-icon:focus-within .input-icon {
  color: var(--primary);
}

.pass-toggle-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 14px;
  transition: color 0.15s;
}

.pass-toggle-btn:hover {
  color: var(--text-primary);
}

/* Avatar Management Box */
.avatar-manager-card {
  display: flex;
  gap: 18px;
  align-items: center;
  background: var(--surface-secondary);
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.avatar-thumb-box {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #1D4ED8 100%);
  color: #FFFFFF;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid var(--surface);
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.2);
  overflow: hidden;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-controls-side {
  flex: 1;
  min-width: 0;
}

.avatar-actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form-hint-text {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: 6px;
  display: block;
}

/* Password Strength & Match Feedback */
.pass-strength-meter {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.strength-bar-track {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 9999px;
  overflow: hidden;
}

.strength-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 9999px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-text {
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.pass-match-feedback {
  font-size: 11.5px;
  font-weight: 600;
  margin-top: 6px;
  min-height: 16px;
}

.security-rules-strip {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--surface-secondary);
  padding: 10px 14px;
  border-radius: 8px;
  margin-top: 14px;
  border: 1px solid var(--border);
}

.sec-rule-item {
  font-size: 11.5px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sec-rule-item i {
  color: #10B981;
  font-size: 12px;
}

.btn-warning-accent {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%) !important;
  border-color: #D97706 !important;
  color: #FFFFFF !important;
}

.btn-warning-accent:hover {
  background: linear-gradient(135deg, #D97706 0%, #B45309 100%) !important;
}

/* Permissions & Role Privileges Grid */
.profile-privileges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  padding: 20px 24px;
}

.privilege-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
}

.privilege-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(139, 92, 246, 0.12);
  color: #7C3AED;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.privilege-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.privilege-text strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.privilege-text span {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ==========================================================================
   App & Web Issue Reports Module Styles (docs/design.md Section 48.2)
   ========================================================================== */
#appReportsTabsFilter .tab-btn .tab-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface);
  color: var(--text-tertiary);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

#appReportsTabsFilter .tab-btn.active .tab-count-badge {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

#appReportsTabsFilter .tab-btn:hover .tab-count-badge {
  color: var(--text-primary);
}

/* Single-Line Compact Toolbar Filters (No Excessive Empty Space) */
.app-reports-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.app-report-filter-select {
  width: auto !important;
  max-width: fit-content;
  min-width: 0 !important;
  height: 36px;
  padding: 0 30px 0 12px !important;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748B'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 13px 13px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.app-report-filter-select:hover {
  border-color: var(--text-tertiary);
}

.app-report-filter-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(65, 150, 255, 0.15);
  outline: none;
}

[data-theme="dark"] .app-report-filter-select {
  background-color: #1E2433;
  border-color: #2A3045;
  color: #FFFFFF;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394A3B8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

.report-source-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  width: fit-content;
}

.report-source-pill.source-app {
  background: rgba(14, 165, 233, 0.12);
  color: #0284C7;
  border: 1px solid rgba(14, 165, 233, 0.25);
}

.report-source-pill.source-web {
  background: rgba(139, 92, 246, 0.12);
  color: #7C3AED;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.report-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
}

.report-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}

.report-id-badge {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-xs, 4px);
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 12px;
}

.app-report-row {
  transition: background-color 0.18s ease;
}

.app-report-row:hover {
  background-color: var(--surface-hover, rgba(65, 150, 255, 0.04));
}

/* Dark Mode Overrides for Profile & App Reports */
[data-theme="dark"] .profile-card-role {
  background: rgba(65, 150, 255, 0.16);
  color: #60A5FA;
}

[data-theme="dark"] .report-source-pill.source-app {
  background: rgba(14, 165, 233, 0.2);
  color: #38BDF8;
}

[data-theme="dark"] .report-source-pill.source-web {
  background: rgba(139, 92, 246, 0.2);
  color: #A78BFA;
}

[data-theme="dark"] .app-report-row:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .profile-card {
  background: #1A2234;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .profile-card-cover {
  background: linear-gradient(135deg, #1E40AF 0%, #4338CA 50%, #6D28D9 100%);
}

[data-theme="dark"] .meta-icon-email { background: rgba(37, 99, 235, 0.2); color: #60A5FA; }
[data-theme="dark"] .meta-icon-phone { background: rgba(16, 185, 129, 0.2); color: #34D399; }
[data-theme="dark"] .meta-icon-dept { background: rgba(139, 92, 246, 0.2); color: #A78BFA; }
[data-theme="dark"] .meta-icon-loc { background: rgba(245, 158, 11, 0.2); color: #FBBF24; }
[data-theme="dark"] .meta-icon-joined { background: rgba(148, 163, 184, 0.2); color: #CBD5E1; }

[data-theme="dark"] .btn-copy-meta {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.1);
  color: #94A3B8;
}

[data-theme="dark"] .btn-copy-meta:hover {
  background: rgba(65, 150, 255, 0.15);
  border-color: #60A5FA;
  color: #60A5FA;
}

[data-theme="dark"] .profile-bio-box,
[data-theme="dark"] .profile-security-box,
[data-theme="dark"] .avatar-manager-card,
[data-theme="dark"] .security-rules-strip,
[data-theme="dark"] .privilege-box {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .profile-role-pill-hero {
  background: rgba(245, 158, 11, 0.18);
  color: #FBBF24;
  border-color: rgba(245, 158, 11, 0.35);
}

[data-theme="dark"] .profile-card-footer {
  border-color: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   Print-Only Analytics Header & Document Formatting
   ========================================================================== */
.analytics-print-header,
.activity-print-header {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm 15mm 15mm 15mm;
  }

  /* Reset layout for print */
  *,
  *::before,
  *::after {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body,
  .admin-layout,
  .admin-main,
  .admin-content,
  .view-section {
    background: #FFFFFF !important;
    color: #0F172A !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    visibility: visible !important;
  }

  .view-section.active,
  .view-section.active * {
    visibility: visible !important;
  }

  .view-section:not(.active) {
    display: none !important;
  }

  /* Hide navigation, sidebar, topbar, buttons and action controls */
  .admin-sidebar,
  aside.admin-sidebar,
  #adminSidebar,
  .sidebar,
  .sidebar-edge-toggle,
  .topbar,
  .app-header,
  .page-actions,
  .btn,
  .btn-mask-toggle,
  .gdf-stepper,
  .gdf-smart-popover,
  .gdf-shortcuts-chips,
  .chart-card-actions,
  .table-actions,
  .pagination,
  #toastContainer,
  .modal:not(.active) {
    display: none !important;
  }

  /* Show analytics print header when printing analytics view */
  #view-analytics .analytics-print-header {
    display: block !important;
    margin-bottom: 20px !important;
  }

  .print-brand-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 20px !important;
  }

  .print-brand-title {
    font-size: 20px !important;
    font-weight: 800 !important;
    color: #0F172A !important;
    margin: 0 0 4px !important;
  }

  .print-brand-sub {
    font-size: 12px !important;
    color: #475569 !important;
    margin: 0 0 4px !important;
  }

  .print-brand-meta {
    font-size: 11px !important;
    color: #64748B !important;
  }

  .print-meta-box {
    text-align: right !important;
    font-size: 11.5px !important;
    color: #334155 !important;
    line-height: 1.6 !important;
    border-left: 2px solid #E2E8F0 !important;
    padding-left: 12px !important;
  }

  .print-meta-row strong {
    color: #0F172A !important;
  }

  .print-divider {
    border-top: 1.5px solid #CBD5E1 !important;
    margin: 12px 0 16px !important;
  }

  /* KPI Cards for Print */
  .metrics-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 20px !important;
  }

  .stat-card {
    border: 1px solid #CBD5E1 !important;
    border-radius: 8px !important;
    padding: 10px !important;
    background: #F8FAFC !important;
    page-break-inside: avoid !important;
  }

  .stat-card .stat-value {
    font-size: 18px !important;
    color: #0F172A !important;
  }

  .stat-card .stat-label {
    font-size: 11px !important;
    color: #475569 !important;
  }

  .stat-icon-wrap {
    display: none !important;
  }

  /* Charts and Tables formatting */
  .charts-grid,
  .chart-card,
  .table-card {
    page-break-inside: avoid !important;
    border: 1px solid #E2E8F0 !important;
    margin-bottom: 16px !important;
    background: #FFFFFF !important;
  }

  .data-table {
    border-collapse: collapse !important;
    width: 100% !important;
  }

  .data-table th,
  .data-table td {
    border: 1px solid #E2E8F0 !important;
    padding: 8px 10px !important;
    font-size: 11.5px !important;
    color: #0F172A !important;
  }

  .data-table th {
    background: #F1F5F9 !important;
    font-weight: 700 !important;
  }

  /* Invoice Print Isolation */
  #invoiceModal.active {
    position: static !important;
    background: none !important;
    display: block !important;
    padding: 0 !important;
  }

  #invoiceModal.active .modal-content {
    border: none !important;
    max-width: 100% !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  #invoiceModal.active .modal-header,
  #invoiceModal.active .modal-footer {
    display: none !important;
  }

  .invoice-container {
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* Activity Log Print Styles */
  #view-activity-log .activity-print-header {
    display: block !important;
    margin-bottom: 20px !important;
  }

  /* Hide interactive filter toolbar card when printing activity log */
  #view-activity-log .analytics-toolbar-card,
  #view-activity-log .act-category-tabs-wrap,
  #view-activity-log .act-toolbar-controls {
    display: none !important;
  }

  /* 4 KPI summary cards aligned evenly */
  #view-activity-log .metrics-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 12px !important;
    margin-bottom: 20px !important;
  }

  #view-activity-log .table-card {
    border: 1px solid #CBD5E1 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    background: #FFFFFF !important;
    overflow: visible !important;
  }

  #view-activity-log .table-responsive {
    overflow: visible !important;
  }

  #view-activity-log .data-table {
    width: 100% !important;
    border-collapse: collapse !important;
    page-break-inside: auto !important;
  }

  #view-activity-log .data-table th,
  #view-activity-log .data-table td {
    border: 1px solid #CBD5E1 !important;
    padding: 8px 10px !important;
    font-size: 11px !important;
    color: #0F172A !important;
    background: transparent !important;
  }

  #view-activity-log .data-table th {
    background: #F1F5F9 !important;
    font-weight: 700 !important;
  }

  #view-activity-log .activity-log-row {
    page-break-inside: avoid !important;
  }

  #view-activity-log .act-user-avatar {
    print-color-adjust: exact !important;
    -webkit-print-color-adjust: exact !important;
  }

  #view-activity-log .act-badge {
    border: 1px solid #94A3B8 !important;
    print-color-adjust: exact !important;
    -webkit-print-color-adjust: exact !important;
  }

  #view-activity-log .act-ip-badge {
    background: #F1F5F9 !important;
    border: 1px solid #CBD5E1 !important;
    print-color-adjust: exact !important;
    -webkit-print-color-adjust: exact !important;
  }
}



/* ==========================================================================
   App & Web Issue Reports Module Styles (#view-app-reports)
   docs/design.md Section 48 & docs/rules.md
   ========================================================================== */
.app-reports-filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.app-report-filter-select {
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.app-report-filter-select:focus {
  border-color: var(--primary);
  background: var(--surface);
}

.report-id-badge {
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.report-source-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  width: fit-content;
}

.report-source-pill.source-app {
  background: rgba(59, 130, 246, 0.12);
  color: #2563EB;
}

.report-source-pill.source-web {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

[data-theme="dark"] .report-source-pill.source-app {
  background: rgba(59, 130, 246, 0.22);
  color: #60A5FA;
}

[data-theme="dark"] .report-source-pill.source-web {
  background: rgba(16, 185, 129, 0.22);
  color: #34D399;
}

.report-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}

.report-order-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  margin-top: 3px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.report-order-link:hover {
  color: var(--primary-hover);
}

/* Order Status Portal dropdown menu styling */
.order-status-portal {
  position: fixed;
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  padding: 6px;
  min-width: 170px;
}

[data-theme="dark"] .order-status-portal {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

/* ==========================================================================
   Universal Global Custom Dropdown System (Matching Image 1 UI)
   docs/rules.md Rule 12 & docs/design.md Section 58
   ========================================================================== */

/* Native select element hidden from view while maintaining DOM presence */
.custom-select-native-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Wrapper for Custom Select Trigger */
.custom-select-wrap {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  box-sizing: border-box;
}

.custom-select-wrap.has-form-select {
  display: block;
  width: 100%;
}

.custom-select-wrap.has-report-filter {
  display: inline-block;
  width: auto;
  min-width: 155px;
}

.custom-select-wrap.has-toolbar-select {
  display: inline-block;
  width: auto;
  min-width: 135px;
}

/* Custom Select Trigger Button */
.custom-select-trigger {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: var(--radius-sm, 8px);
  border: 1.2px solid var(--border, #E2E8F0);
  background: var(--surface, #FFFFFF);
  color: var(--text-primary, #0F172A);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-sizing: border-box;
  outline: none;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.custom-select-trigger.form-select-style {
  height: 42px;
  padding: 0 14px;
  border-radius: var(--radius-md, 10px);
  background: #FAFAFA;
  font-size: 14px;
}

.custom-select-trigger.report-filter-style {
  height: 36px;
  padding: 0 12px;
  background: var(--surface, #FFFFFF);
}

.custom-select-trigger.toolbar-select-style {
  height: 34px;
  padding: 0 11px;
  background: var(--surface-secondary, #F8FAFC);
  font-size: 12.5px;
}

.custom-select-trigger.sm-size {
  height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.custom-select-trigger:hover:not(:disabled) {
  background: var(--surface-secondary, #F8FAFC);
  border-color: #CBD5E1;
}

.custom-select-trigger:focus,
.custom-select-trigger.open {
  background: var(--surface, #FFFFFF);
  border-color: var(--primary, #1A73E8);
  box-shadow: 0 0 0 3px rgba(65, 150, 255, 0.15);
}

.custom-select-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--surface-secondary, #F1F5F9);
}

/* Trigger Inner Content */
.custom-select-trigger-content {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
  text-align: left;
}

.custom-select-trigger-icon-wrap {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.custom-select-trigger-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.custom-select-arrow {
  font-size: 10px;
  color: var(--text-tertiary, #94A3B8);
  margin-left: 4px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
  flex-shrink: 0;
}

.custom-select-trigger.open .custom-select-arrow {
  transform: rotate(180deg);
  color: var(--primary, #1A73E8);
}

/* ==========================================================================
   Global Floating Portal for Dropdowns (Zero Clipping & Image 1 Design)
   ========================================================================== */
.global-custom-dropdown-portal {
  position: fixed !important;
  z-index: 100000 !important;
  min-width: 195px;
  max-width: 330px;
  max-height: 330px;
  overflow-y: auto;
  background: var(--surface, #FFFFFF);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 14px;
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.14), 0 3px 8px rgba(15, 23, 42, 0.05);
  padding: 8px;
  box-sizing: border-box;
  animation: dropdownPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.global-custom-dropdown-portal.dropup {
  box-shadow: 0 -14px 38px rgba(15, 23, 42, 0.14), 0 -3px 8px rgba(15, 23, 42, 0.05);
  animation: dropdownPopUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Custom Scrollbar for Portal */
.global-custom-dropdown-portal::-webkit-scrollbar {
  width: 5px;
}
.global-custom-dropdown-portal::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
.global-custom-dropdown-portal::-webkit-scrollbar-track {
  background: transparent;
}

/* Dropdown Header Bar */
.custom-dropdown-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text-tertiary, #64748B);
  padding: 5px 8px 8px 8px;
  margin-bottom: 5px;
  border-bottom: 1px solid var(--border, #F1F5F9);
  display: flex;
  align-items: center;
  gap: 7px;
  user-select: none;
}

.custom-dropdown-header i {
  font-size: 11px;
  color: var(--text-tertiary, #64748B);
}

/* Options List */
.custom-dropdown-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Single Option Item (Matching Image 1) */
.custom-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary, #0F172A);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  user-select: none;
  box-sizing: border-box;
}

.custom-dropdown-item:hover:not(:disabled) {
  background: var(--surface-secondary, #F8FAFC);
}

/* Active / Selected State (Exact Match to Image 1) */
.custom-dropdown-item.active {
  background: rgba(65, 150, 255, 0.08) !important;
  border: 1px solid rgba(65, 150, 255, 0.35) !important;
  color: var(--primary, #1A73E8) !important;
  font-weight: 700 !important;
}

.custom-dropdown-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-dropdown-check {
  font-size: 12px;
  color: var(--primary, #1A73E8);
  font-weight: 900;
  margin-left: auto;
  flex-shrink: 0;
}

/* Circular Icon Wraps with Pastel Badges (Matching Image 1) */
.custom-dropdown-icon-wrap {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.custom-dropdown-item:hover .custom-dropdown-icon-wrap {
  transform: scale(1.06);
}

/* Pastel Color Badges (Light Theme) */
.icon-amber {
  background: #FFFBEB !important;
  color: #B45309 !important;
  border: 1px solid #FDE68A !important;
}

.icon-blue {
  background: #EFF6FF !important;
  color: #1D4ED8 !important;
  border: 1px solid #BFDBFE !important;
}

.icon-green {
  background: #ECFDF5 !important;
  color: #047857 !important;
  border: 1px solid #A7F3D0 !important;
}

.icon-red {
  background: #FEF2F2 !important;
  color: #B91C1C !important;
  border: 1px solid #FECACA !important;
}

.icon-purple {
  background: #F5F3FF !important;
  color: #6D28D9 !important;
  border: 1px solid #DDD6FE !important;
}

.icon-teal {
  background: #ECFEFF !important;
  color: #0E7490 !important;
  border: 1px solid #A5F3FC !important;
}

.icon-orange {
  background: #FFF7ED !important;
  color: #C2410C !important;
  border: 1px solid #FFEDD5 !important;
}

.icon-slate {
  background: #F1F5F9 !important;
  color: #475569 !important;
  border: 1px solid #CBD5E1 !important;
}

/* ==========================================================================
   Dark Theme Adaptations for Global Custom Dropdowns
   ========================================================================== */
[data-theme="dark"] .custom-select-trigger {
  background: #1E293B;
  border-color: #334155;
  color: #F8FAFC;
}

[data-theme="dark"] .custom-select-trigger.form-select-style {
  background: #1E2433;
  border-color: #2A3045;
}

[data-theme="dark"] .custom-select-trigger.toolbar-select-style {
  background: #1E293B;
  border-color: #334155;
}

[data-theme="dark"] .custom-select-trigger:hover:not(:disabled) {
  background: #27354A;
  border-color: #475569;
}

[data-theme="dark"] .custom-select-trigger:focus,
[data-theme="dark"] .custom-select-trigger.open {
  background: #1E293B;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(65, 150, 255, 0.25);
}

[data-theme="dark"] .global-custom-dropdown-portal {
  background: #1E293B;
  border-color: #334155;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.55), 0 3px 10px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .custom-dropdown-header {
  border-bottom-color: #334155;
  color: #94A3B8;
}

[data-theme="dark"] .custom-dropdown-header i {
  color: #94A3B8;
}

[data-theme="dark"] .custom-dropdown-item {
  color: #F1F5F9;
}

[data-theme="dark"] .custom-dropdown-item:hover:not(:disabled) {
  background: #334155;
}

[data-theme="dark"] .custom-dropdown-item.active {
  background: rgba(65, 150, 255, 0.16) !important;
  border-color: rgba(65, 150, 255, 0.45) !important;
  color: #60A5FA !important;
}

[data-theme="dark"] .custom-dropdown-check {
  color: #60A5FA;
}

[data-theme="dark"] .icon-amber {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #FBBF24 !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}

[data-theme="dark"] .icon-blue {
  background: rgba(59, 130, 246, 0.16) !important;
  color: #60A5FA !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
}

[data-theme="dark"] .icon-green {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #34D399 !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}

[data-theme="dark"] .icon-red {
  background: rgba(239, 68, 68, 0.16) !important;
  color: #F87171 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}

[data-theme="dark"] .icon-purple {
  background: rgba(139, 92, 246, 0.16) !important;
  color: #A78BFA !important;
  border-color: rgba(139, 92, 246, 0.35) !important;
}

[data-theme="dark"] .icon-teal {
  background: rgba(20, 184, 166, 0.16) !important;
  color: #2DD4BF !important;
  border-color: rgba(20, 184, 166, 0.35) !important;
}

[data-theme="dark"] .icon-orange {
  background: rgba(249, 115, 22, 0.16) !important;
  color: #FB923C !important;
  border-color: rgba(249, 115, 22, 0.35) !important;
}

[data-theme="dark"] .icon-slate {
  background: rgba(148, 163, 184, 0.16) !important;
  color: #CBD5E1 !important;
  border-color: rgba(148, 163, 184, 0.35) !important;
}

[data-theme="dark"] .global-custom-dropdown-portal::-webkit-scrollbar-thumb {
  background: #475569;
}

/* ==========================================================================
   Product Unit Type / Calculation Basis Selector (কেজি/গ্রাম বনাম কতটি/পিস)
   ========================================================================== */
.unit-type-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .unit-type-selector-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.unit-type-card {
  position: relative;
  display: block;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 11px 13px;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.unit-type-card:hover {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(248, 250, 252, 0.85);
  transform: translateY(-1px);
}

.unit-type-card.active {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
  box-shadow: 0 0 0 1px var(--primary), 0 4px 12px rgba(37, 99, 235, 0.1);
}

.unit-type-card-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.unit-type-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.unit-type-card:hover .unit-type-icon-box {
  transform: scale(1.08);
}

.unit-type-icon-box.weight {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.unit-type-icon-box.piece {
  background: rgba(99, 102, 241, 0.12);
  color: #4F46E5;
}

.unit-type-info {
  flex: 1;
  min-width: 0;
}

.unit-type-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.unit-type-desc {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unit-type-radio-check {
  font-size: 17px;
  color: var(--border);
  transition: color 0.2s;
  flex-shrink: 0;
}

.unit-type-card.active .unit-type-radio-check {
  color: var(--primary);
}

.unit-type-badge-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  transition: all 0.2s;
}

.unit-type-badge-indicator.is-weight {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.unit-type-badge-indicator.is-piece {
  background: rgba(99, 102, 241, 0.12);
  color: #4F46E5;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

/* Quick Suggestion Pills */
.unit-quick-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.unit-suggestion-chip {
  background: var(--surface-secondary, #F1F5F9);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.unit-suggestion-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.unit-suggestion-chip.selected {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* Inventory Table Unit Type Tag */
.prod-unit-type-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1.5px 7px;
  border-radius: 4px;
  line-height: 1.3;
}

.prod-unit-type-tag.is-weight {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.prod-unit-type-tag.is-piece {
  background: rgba(99, 102, 241, 0.12);
  color: #4F46E5;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

/* Single Product Detail View Unit Type Chip */
.pd-chip.is-unit-type.is-weight {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.25);
}

.pd-chip.is-unit-type.is-piece {
  background: rgba(99, 102, 241, 0.1);
  color: #4F46E5;
  border-color: rgba(99, 102, 241, 0.25);
}

/* Dark Mode Harmonization */
[data-theme="dark"] .unit-type-card {
  background: #0F172A;
  border-color: #334155;
}

[data-theme="dark"] .unit-type-card:hover {
  background: #1E293B;
  border-color: rgba(96, 165, 250, 0.4);
}

[data-theme="dark"] .unit-type-card.active {
  background: rgba(59, 130, 246, 0.12);
  border-color: #3B82F6;
  box-shadow: 0 0 0 1px #3B82F6, 0 4px 14px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .unit-type-desc {
  color: #94A3B8;
}

[data-theme="dark"] .unit-suggestion-chip {
  background: #1E293B;
  border-color: #334155;
  color: #CBD5E1;
}

[data-theme="dark"] .unit-suggestion-chip:hover {
  background: rgba(59, 130, 246, 0.18);
  border-color: #3B82F6;
  color: #93C5FD;
}

[data-theme="dark"] .unit-suggestion-chip.selected {
  background: #2563EB;
  color: #FFFFFF;
  border-color: #2563EB;
}

[data-theme="dark"] .prod-unit-type-tag.is-weight,
[data-theme="dark"] .pd-chip.is-unit-type.is-weight {
  background: rgba(16, 185, 129, 0.18);
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.35);
}

[data-theme="dark"] .prod-unit-type-tag.is-piece,
[data-theme="dark"] .pd-chip.is-unit-type.is-piece {
  background: rgba(139, 92, 246, 0.18);
  color: #C4B5FD;
  border-color: rgba(139, 92, 246, 0.35);
}

/* ==========================================================================
   Fractional Weight & Proportional Price Calculation (১ কেজি ২০০৳ ➔ ৫০০ গ্রাম ১০০৳)
   ========================================================================== */
.weight-custom-option-card {
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.weight-custom-option-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
}

.weight-custom-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.weight-custom-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.weight-custom-checkbox-body {
  flex: 1;
  min-width: 0;
}

.weight-custom-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.weight-custom-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-weight-allowed {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.badge-weight-allowed.is-active {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-weight-allowed.is-inactive {
  background: rgba(148, 163, 184, 0.14);
  color: #64748B;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.weight-custom-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin: 4px 0 0 0;
  line-height: 1.45;
}

/* Real-Time Proportional Price Preview Box */
.weight-calc-preview-box {
  background: #FFFFFF;
  border: 1px dashed #CBD5E1;
  border-radius: 9px;
  padding: 10px 12px;
  margin-top: 10px;
  transition: all 0.2s ease;
}

.weight-calc-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.weight-calc-head-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
}

.weight-calc-base-tag {
  font-size: 11px;
  font-weight: 700;
  color: #059669;
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.weight-calc-pills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.weight-calc-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  user-select: none;
  transition: all 0.15s ease;
}

.weight-calc-pill strong {
  color: var(--primary);
  font-weight: 700;
}

.weight-calc-pill.is-primary {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.25);
  color: #1D4ED8;
}

.weight-calc-pill.is-primary strong {
  color: #1D4ED8;
}

/* Inventory Table Custom Weight Tag */
.prod-custom-weight-tag {
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
  font-size: 10px;
  font-weight: 700;
  padding: 1.5px 6px;
  border-radius: 4px;
  background: rgba(14, 165, 233, 0.1);
  color: #0284C7;
  border: 1px solid rgba(14, 165, 233, 0.25);
}

/* Product Detail Chip for Weight Adjustment */
.pd-chip.is-custom-weight {
  background: rgba(14, 165, 233, 0.1);
  color: #0284C7;
  border-color: rgba(14, 165, 233, 0.25);
}

/* Interactive Calculator Card on Single Product Detail Page */
.pd-weight-calc-showcase {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 14px;
}

.pd-weight-calc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.pd-weight-calc-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 7px;
}

.pd-weight-calc-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.pd-weight-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pd-weight-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pd-weight-btn.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.pd-weight-calc-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
}

/* Dark Mode Harmonization */
[data-theme="dark"] .weight-custom-option-card {
  background: #0F172A;
  border-color: #334155;
}

[data-theme="dark"] .weight-calc-preview-box {
  background: #1E293B;
  border-color: #475569;
}

[data-theme="dark"] .weight-calc-pill {
  background: #334155;
  border-color: #475569;
  color: #F1F5F9;
}

[data-theme="dark"] .weight-calc-pill.is-primary {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.35);
  color: #93C5FD;
}

[data-theme="dark"] .weight-calc-pill.is-primary strong {
  color: #93C5FD;
}

/* ==========================================================================
   Multi-Company / Brand Variants & Format Pricing in Admin Modal (Decision 219)
   ========================================================================== */
.brand-variants-card {
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-variants-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
}

.brand-variants-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brand-variant-company-box {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.brand-variant-company-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border, #e2e8f0);
}

.brand-variant-priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary, #2563eb);
}

.brand-variant-priority-input {
  width: 55px;
  padding: 4px 6px;
  font-size: 12px;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 6px;
  text-align: center;
  font-weight: 700;
}

.brand-variant-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
@media (max-width: 900px) {
  .brand-variant-grid {
    grid-template-columns: 1fr;
  }
}

.brand-formats-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: #f8fafc;
}

.brand-formats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.brand-formats-table th {
  background: #f1f5f9;
  padding: 6px 10px;
  text-align: left;
  font-weight: 700;
  color: var(--text-secondary, #64748b);
  border-bottom: 1px solid var(--border, #e2e8f0);
  white-space: nowrap;
}

.brand-formats-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.brand-format-input {
  width: 100%;
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 6px;
  background: #ffffff;
}

.btn-remove-format {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 4px;
  font-size: 13px;
  border-radius: 4px;
}

.btn-remove-format:hover {
  background: rgba(239, 68, 68, 0.1);
}

.btn-add-format {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary, #2563eb);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  margin-top: 6px;
}

.btn-add-format:hover {
  text-decoration: underline;
}

/* Single Product View Multi-Brand Showcase */
.pd-multibrand-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 12px);
  padding: 18px;
  margin-top: 16px;
}

.pd-multibrand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.pd-multibrand-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pd-multibrand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.pd-brand-variant-tile {
  background: var(--surface-secondary, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 12px;
}

.pd-brand-tile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.pd-brand-tile-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pd-brand-priority-tag {
  font-size: 11px;
  font-weight: 700;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary, #2563eb);
  padding: 2px 7px;
  border-radius: 12px;
}

.pd-brand-formats-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pd-brand-format-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding: 3px 0;
}

[data-theme="dark"] .brand-variants-card {
  background: #0F172A;
  border-color: #334155;
}

[data-theme="dark"] .brand-variant-company-box {
  background: #1E293B;
  border-color: #334155;
}

[data-theme="dark"] .brand-formats-table-wrap {
  background: #0F172A;
  border-color: #334155;
}

[data-theme="dark"] .brand-formats-table th {
  background: #1E293B;
  color: #94A3B8;
  border-color: #334155;
}

[data-theme="dark"] .brand-formats-table td {
  border-color: #334155;
}

[data-theme="dark"] .brand-format-input,
[data-theme="dark"] .brand-variant-priority-input {
  background: #1E293B;
  border-color: #475569;
  color: #F8FAFC;
}

[data-theme="dark"] .pd-brand-variant-tile {
  background: #1E293B;
  border-color: #334155;
}

[data-theme="dark"] .prod-custom-weight-tag,
[data-theme="dark"] .pd-chip.is-custom-weight {
  background: rgba(14, 165, 233, 0.18);
  color: #38BDF8;
  border-color: rgba(14, 165, 233, 0.35);
}

[data-theme="dark"] .pd-weight-calc-showcase {
  background: #0F172A;
  border-color: #334155;
}

[data-theme="dark"] .pd-weight-btn {
  background: #1E293B;
  border-color: #334155;
  color: #E2E8F0;
}

[data-theme="dark"] .pd-weight-btn.active {
  background: #2563EB;
  color: #FFFFFF;
  border-color: #2563EB;
}

[data-theme="dark"] .pd-weight-calc-result {
  background: #1E293B;
  border-color: #334155;
}

/* ==========================================================================
   Activity Log & User Profile Audit Trail Styles (Premium SaaS Redesign)
   ========================================================================== */

/* 1. Category Segmented Tabs (Matches Reports View Tab UI - Image 1) */
.act-category-tabs-wrap {
  width: 100%;
  margin-bottom: 0;
}

.act-category-pills-list {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-secondary);
  padding: 6px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.act-category-pills-list::-webkit-scrollbar {
  display: none;
}

.act-category-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  box-shadow: none;
}

.act-category-pill i {
  font-size: 13px;
  opacity: 0.85;
}

.act-category-pill:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.04);
  transform: none;
}

[data-theme="dark"] .act-category-pill:hover {
  background: rgba(255, 255, 255, 0.05);
}

.act-category-pill.active {
  background: var(--surface) !important;
  color: var(--primary) !important;
  font-weight: 700;
  border: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  transform: none;
}

.act-category-pill.active i {
  color: var(--primary);
  opacity: 1;
}

[data-theme="dark"] .act-category-pill.active {
  background: #1E293B !important;
  color: #60A5FA !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .act-category-pill.active i {
  color: #60A5FA;
}

/* 2. Toolbar Row (Search, User Filter, Date, Reset, Count - Perfectly Aligned 38px Standard) */
.act-toolbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* Search Box: Well-proportioned width, exact 38px height */
.act-search-box {
  position: relative;
  width: 290px;
  min-width: 220px;
  max-width: 320px;
  flex: 0 1 290px;
  height: 38px;
}

.act-search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 13px;
  pointer-events: none;
}

.act-search-box .search-input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.act-search-box .search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(65, 150, 255, 0.15);
}

/* User Filter Dropdown: Snug, proportional width, exact 38px height */
.act-user-filter-box {
  position: relative;
  flex: 0 0 auto;
  min-width: 175px;
  max-width: 220px;
  height: 38px;
}

.act-user-select {
  width: 100%;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0 32px 0 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.act-user-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(65, 150, 255, 0.15);
}

.act-user-select-chevron {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Date Filter Mount: Zero bottom margin, exact 38px height, vertically centered */
.act-date-filter-mount.global-date-filter,
.act-toolbar-controls .global-date-filter {
  margin-bottom: 0 !important;
  display: inline-flex;
  align-items: center;
  height: 38px;
  flex: 0 0 auto;
}

.act-toolbar-controls .gdf-smart-wrapper {
  display: inline-flex;
  align-items: center;
  height: 38px;
  width: auto;
}

.act-toolbar-controls .gdf-bar {
  display: inline-flex;
  align-items: center;
  width: auto;
  gap: 0;
  margin: 0;
  padding: 0;
  height: 38px;
}

.act-toolbar-controls .gdf-right-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
}

.act-toolbar-controls .gdf-stepper {
  display: inline-flex;
  align-items: center;
  height: 38px;
  box-sizing: border-box;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 4px;
  margin: 0;
}

.act-toolbar-controls .gdf-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.act-toolbar-controls .gdf-date-trigger {
  height: 28px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
}

.act-toolbar-controls .gdf-days-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 9999px;
  line-height: 1.2;
}

.act-toolbar-controls .gdf-today-chip {
  height: 38px;
  border-radius: var(--radius-sm);
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  box-sizing: border-box;
}

/* Reset Button: 38px height matching toolbar */
.act-btn-reset {
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  box-sizing: border-box;
}

/* Count Badge: 38px height, clean alignment */
.act-count-chip {
  margin-left: auto;
  height: 38px;
  padding: 0 14px;
  background: var(--surface-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-sizing: border-box;
}

/* 3. Activity Table Rows & Cells */
.activity-log-row {
  transition: background 0.15s ease;
}

.activity-log-row:hover {
  background: var(--surface-hover, rgba(37, 99, 235, 0.03)) !important;
}

.act-time-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.act-rel-time {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary, #0F172A);
}

.act-exact-time {
  font-size: 11.5px;
  color: var(--text-secondary, #64748B);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.act-user-cell {
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 10px;
  transition: all 0.2s ease;
  max-width: 100%;
}

.act-user-cell:hover {
  background: rgba(37, 99, 235, 0.08);
  transform: translateX(2px);
}

.act-user-avatar {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 18px !important;
  background: var(--surface-secondary, #F8FAFC) !important;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  line-height: 1 !important;
}

.act-user-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.act-user-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary, #0F172A);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.act-user-role-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.act-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}

.act-role-badge.role-staff {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.act-role-badge.role-cust {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.act-role-badge.role-sys {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
}

.act-phone-tag {
  font-size: 11px;
  color: var(--text-secondary, #64748B);
  font-family: monospace;
}

.act-event-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.act-event-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary, #0F172A);
  line-height: 1.3;
}

.act-cat-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.act-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
}

.act-entity-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-secondary, #F1F5F9);
  color: var(--text-secondary, #475569);
  border: 1px solid var(--border, #E2E8F0);
  font-size: 11px;
  font-weight: 600;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.act-details-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary, #475569);
  word-break: break-word;
}

.act-client-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.act-ip-badge {
  font-family: monospace;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary, #0F172A);
  background: var(--surface-secondary, #F8FAFC);
  border: 1px solid var(--border, #E2E8F0);
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
}

.act-device-text {
  font-size: 11px;
  color: var(--text-secondary, #64748B);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

/* 4. Team Member Profile Modal Redesign */
.team-profile-header-card {
  background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 50%, #3B82F6 100%);
  border-radius: 16px;
  padding: 24px;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.25);
  position: relative;
  overflow: hidden;
}

.team-profile-header-card::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.team-profile-identity {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
}

.team-profile-avatar {
  width: 68px !important;
  height: 68px !important;
  min-width: 68px !important;
  max-width: 68px !important;
  border-radius: 50% !important;
  background: #FFFFFF !important;
  color: #1E3A8A !important;
  font-size: 28px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15) !important;
  flex-shrink: 0 !important;
  border: 3px solid rgba(255, 255, 255, 0.9) !important;
  overflow: hidden;
  line-height: 1 !important;
}

.team-profile-identity h3 {
  color: #FFFFFF !important;
  margin: 0;
}

.team-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.2) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  backdrop-filter: blur(4px);
}

.team-profile-contacts-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.88);
}

.team-profile-contacts-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#btnEditMemberFromProfile {
  background: #FFFFFF !important;
  color: #1D4ED8 !important;
  border: none !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
  transition: all 0.2s ease !important;
}

#btnEditMemberFromProfile:hover {
  background: #F1F5F9 !important;
  transform: translateY(-1px);
}

/* Team KPI Grid */
.team-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.team-kpi-card {
  background: var(--surface, #FFFFFF);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.team-kpi-card .kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #64748B);
}

.team-kpi-card .kpi-val {
  font-size: 22px;
  font-weight: 800;
  margin: 2px 0;
  line-height: 1.2;
}

.team-kpi-card .kpi-sub {
  font-size: 11px;
  color: var(--text-secondary, #94A3B8);
}

/* Team Member Timeline Section */
.team-acts-section {
  background: var(--surface, #FFFFFF);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 14px;
  padding: 20px;
}

.team-acts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, #E2E8F0);
}

.team-acts-list-wrap {
  position: relative;
  padding-left: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.team-acts-list-wrap::before {
  content: '';
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 9px;
  width: 2px;
  background: var(--border, #E2E8F0);
}

.member-act-item {
  position: relative;
  background: var(--surface-secondary, #F8FAFC);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 12px;
  padding: 14px 18px;
  transition: all 0.2s ease;
}

.member-act-item:hover {
  border-color: var(--primary, #2563EB);
  background: var(--surface, #FFFFFF);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.member-act-item::after {
  content: '';
  position: absolute;
  left: -24px;
  top: 18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary, #2563EB);
  border: 2px solid var(--surface, #FFFFFF);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.member-act-time {
  margin-bottom: 6px;
}

.member-act-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border, #E2E8F0);
  font-size: 11.5px;
  color: var(--text-secondary, #64748B);
}

.member-act-footer span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* 5. Customer Profile Tabs & Activity Timeline */
.cust-profile-tabs-strip {
  display: flex;
  gap: 10px;
  border-bottom: 2px solid var(--border, #E2E8F0);
  margin-bottom: 18px;
}

.cust-profile-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary, #64748B);
  cursor: pointer;
  transition: all 0.2s ease;
}

.cust-profile-tab:hover {
  color: var(--primary, #2563EB);
}

.cust-profile-tab.active {
  color: var(--primary, #2563EB);
  border-bottom-color: var(--primary, #2563EB);
}

.cust-profile-tab .tab-count-badge {
  background: var(--surface-secondary, #F1F5F9);
  color: var(--text-secondary, #475569);
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
}

.cust-profile-tab.active .tab-count-badge {
  background: #EFF6FF;
  color: var(--primary, #2563EB);
}

/* Dark Mode Overrides */
[data-theme="dark"] .act-category-pill {
  background: #1E293B;
  border-color: #334155;
  color: #94A3B8;
}

[data-theme="dark"] .act-category-pill:hover {
  background: #334155;
  color: #60A5FA;
  border-color: #60A5FA;
}

[data-theme="dark"] .act-search-box .search-input {
  background: #1E293B;
  border-color: #334155;
  color: #F1F5F9;
}

[data-theme="dark"] .act-user-select {
  background: #1E293B;
  border-color: #334155;
  color: #F1F5F9;
}

[data-theme="dark"] .act-count-chip {
  background: #0F172A;
  border-color: #334155;
  color: #94A3B8;
}

[data-theme="dark"] .act-user-cell:hover {
  background: rgba(96, 165, 250, 0.12);
}

[data-theme="dark"] .act-user-avatar {
  background: #1E293B !important;
}

[data-theme="dark"] .act-rel-time {
  color: #F1F5F9;
}

[data-theme="dark"] .act-user-name {
  color: #F1F5F9;
}

[data-theme="dark"] .act-event-title {
  color: #F1F5F9;
}

[data-theme="dark"] .act-details-text {
  color: #CBD5E1;
}

[data-theme="dark"] .act-ip-badge {
  background: #0F172A;
  border-color: #334155;
  color: #CBD5E1;
}

[data-theme="dark"] .team-kpi-card {
  background: #1E293B;
  border-color: #334155;
}

[data-theme="dark"] .team-acts-section {
  background: #1E293B;
  border-color: #334155;
}

[data-theme="dark"] .team-acts-header {
  border-color: #334155;
}

[data-theme="dark"] .team-acts-list-wrap::before {
  background: #334155;
}

[data-theme="dark"] .member-act-item {
  background: #0F172A;
  border-color: #334155;
}

[data-theme="dark"] .member-act-item:hover {
  border-color: #60A5FA;
  background: #1E293B;
}

[data-theme="dark"] .member-act-item::after {
  border-color: #0F172A;
}

[data-theme="dark"] .member-act-footer {
  border-color: #334155;
}

[data-theme="dark"] .cust-profile-tabs-strip {
  border-color: #334155;
}

[data-theme="dark"] .cust-profile-tab {
  color: #94A3B8;
}

[data-theme="dark"] .cust-profile-tab.active {
  color: #60A5FA;
  border-bottom-color: #60A5FA;
}

[data-theme="dark"] .cust-profile-tab .tab-count-badge {
  background: #0F172A;
  color: #94A3B8;
}

[data-theme="dark"] .cust-profile-tab.active .tab-count-badge {
  background: #1E3A8A;
  color: #93C5FD;
}

@media (max-width: 768px) {
  .team-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .team-profile-header-card {
    flex-direction: column;
    text-align: center;
  }
  .team-profile-identity {
    flex-direction: column;
    text-align: center;
  }
  .team-profile-contacts-row {
    justify-content: center;
  }
}

/* ==========================================================================
   65. CUSTOMER GOOGLE MAP GEOLOCATION & PINNING ARCHITECTURE
   ========================================================================== */
.cust-map-location-card {
  border-radius: 14px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.cust-map-location-card.pinned {
  background: var(--surface, #FFFFFF);
  border: 1px solid rgba(234, 67, 53, 0.22);
  box-shadow: 0 4px 16px rgba(234, 67, 53, 0.05);
}

.cust-map-card-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
}

.cust-map-info-side {
  flex: 1;
  min-width: 0;
}

.cust-map-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.cust-map-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  letter-spacing: 0.2px;
}

.cust-map-status-pill.pinned {
  background: rgba(234, 67, 53, 0.08);
  color: #D93025;
  border: 1px solid rgba(234, 67, 53, 0.25);
}

.cust-coords-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 9999px;
  background: var(--surface-secondary, #F1F5F9);
  color: var(--text-secondary, #475569);
  border: 1px solid var(--border, #E2E8F0);
  cursor: pointer;
  transition: all 0.2s ease;
}

.cust-coords-pill:hover {
  background: #E2E8F0;
  color: var(--text-primary, #0F172A);
  border-color: #CBD5E1;
}

.cust-map-address-text {
  font-size: 13.5px;
  color: var(--text-primary, #0F172A);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.cust-map-landmark-text {
  font-size: 12px;
  color: var(--text-secondary, #64748B);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cust-map-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-map-nav {
  background: #EA4335;
  color: #FFFFFF !important;
  border: none;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(234, 67, 53, 0.25);
}

.btn-map-nav:hover {
  background: #D93025;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(234, 67, 53, 0.35);
}

.cust-perm-locked-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--surface-secondary, #F1F5F9);
  color: var(--text-tertiary, #94A3B8);
  border: 1px dashed var(--border, #CBD5E1);
}

.cust-map-preview-side {
  width: 220px;
  height: 118px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border, #E2E8F0);
  background: var(--surface-secondary, #F8FAFC);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.cust-mini-map-iframe {
  display: block;
}

/* Unpinned State */
.cust-map-location-card.unpinned {
  background: var(--surface, #FFFFFF);
  border: 1px dashed var(--border, #CBD5E1);
  padding: 16px 20px;
}

.cust-map-unpinned-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cust-map-unpinned-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(234, 67, 53, 0.08);
  color: #EA4335;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.cust-map-unpinned-details {
  flex: 1;
  min-width: 220px;
}

/* Mini Map Badges & Row Actions */
.badge-mini-map-pinned {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 9999px;
  background: rgba(234, 67, 53, 0.09);
  color: #D93025;
  border: 1px solid rgba(234, 67, 53, 0.22);
}

.btn-smart-map-nav {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(234, 67, 53, 0.08);
  color: #EA4335;
  border: 1px solid rgba(234, 67, 53, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-smart-map-nav:hover {
  background: #EA4335;
  color: #FFFFFF;
  transform: translateY(-1px);
}

/* Modal Preset Buttons */
.map-presets-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-map-preset {
  background: var(--surface, #FFFFFF);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary, #475569);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-map-preset:hover {
  background: var(--surface-secondary, #F1F5F9);
  border-color: var(--primary, #2563EB);
  color: var(--primary, #2563EB);
}

.btn-map-preset.active {
  background: rgba(37, 99, 235, 0.1);
  border-color: var(--primary, #2563EB);
  color: var(--primary, #2563EB);
  font-weight: 700;
}

/* Dark Mode Overrides */
[data-theme="dark"] .cust-map-location-card.pinned {
  background: #1E293B;
  border-color: rgba(234, 67, 53, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .cust-map-location-card.unpinned {
  background: #1E293B;
  border-color: #334155;
}

[data-theme="dark"] .cust-coords-pill {
  background: #0F172A;
  color: #94A3B8;
  border-color: #334155;
}

[data-theme="dark"] .cust-coords-pill:hover {
  background: #1E293B;
  color: #F8FAFC;
}

[data-theme="dark"] .cust-perm-locked-chip {
  background: #0F172A;
  color: #64748B;
  border-color: #334155;
}

[data-theme="dark"] .cust-map-preview-side {
  background: #0F172A;
  border-color: #334155;
}

[data-theme="dark"] .btn-map-preset {
  background: #0F172A;
  border-color: #334155;
  color: #94A3B8;
}

[data-theme="dark"] .btn-map-preset:hover {
  background: #1E293B;
  color: #60A5FA;
}

@media (max-width: 640px) {
  .cust-map-card-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .cust-map-preview-side {
    width: 100%;
    height: 140px;
  }
}

/* ==========================================================================
   Data Export, Import & Database Backup Hub Styles (#view-data-backup)
   docs/design.md Section 69 & docs/rules.md Rule 23
   ========================================================================== */

/* 1. Segmented Navigation Tabs */
.backup-tabs-wrap {
  width: 100%;
}

.backup-tabs-list {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-secondary);
  padding: 6px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.backup-tabs-list::-webkit-scrollbar {
  display: none;
}

.backup-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.backup-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .backup-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.backup-tab-btn.active {
  background: var(--surface) !important;
  color: #10B981 !important;
  font-weight: 700;
  border: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="dark"] .backup-tab-btn.active {
  background: #1E293B !important;
  color: #34D399 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

/* 2. Step Header */
.backup-step-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.backup-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #10B981;
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}

.backup-step-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.backup-step-sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* 3. Entity Multi-Select Grid */
.backup-entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.backup-entity-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.backup-entity-card:hover {
  border-color: #10B981;
  transform: translateY(-1px);
}

.backup-entity-card.active {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.04);
}

[data-theme="dark"] .backup-entity-card.active {
  background: rgba(16, 185, 129, 0.1);
  border-color: #34D399;
}

.backup-entity-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.backup-entity-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.backup-entity-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.backup-entity-desc {
  font-size: 11.5px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.backup-entity-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  flex-shrink: 0;
  margin-left: 8px;
}

.backup-entity-card.active .backup-entity-badge {
  background: #ECFDF5;
  color: #059669;
  border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .backup-entity-card.active .backup-entity-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border-color: rgba(52, 211, 153, 0.4);
}

.backup-entity-check {
  margin-right: 10px;
  accent-color: #10B981;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* 4. Format Selector Grid */
.backup-format-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.backup-format-card {
  position: relative;
  padding: 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.backup-format-card:hover {
  border-color: #10B981;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.backup-format-card.active {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.03);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.12);
}

[data-theme="dark"] .backup-format-card.active {
  background: rgba(16, 185, 129, 0.08);
  border-color: #34D399;
}

.backup-format-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--surface-secondary);
  color: var(--text-tertiary);
  font-family: monospace;
}

.backup-format-card.active .backup-format-badge {
  background: #10B981;
  color: #FFFFFF;
}

.backup-format-icon {
  font-size: 24px;
  margin-bottom: 12px;
}

.backup-format-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.backup-format-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* 5. Import Dropzone */
.backup-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-card);
  padding: 40px 20px;
  text-align: center;
  background: var(--surface-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.backup-dropzone:hover,
.backup-dropzone.dragover {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.05);
}

.backup-dropzone-icon {
  font-size: 38px;
  color: #10B981;
  margin-bottom: 12px;
}

.backup-dropzone-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.backup-dropzone-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.backup-file-selected-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.backup-file-icon {
  font-size: 26px;
}

.backup-file-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.backup-file-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 6. Progress Bar */
.backup-progress-wrap {
  width: 100%;
}

.backup-progress-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--surface-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.backup-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #059669);
  transition: width 0.15s ease;
}

/* Department <-> Subcategory Interactive Pills & Modal Manager */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.dept-cat-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 380px;
}

.dept-cat-pill,
.dept-cat-add-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.16s ease;
  font-family: inherit;
}

.dept-cat-pill:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.dept-cat-pill-count {
  font-size: 10.5px;
  opacity: 0.78;
}

.dept-cat-add-pill {
  border-style: dashed;
  border-color: rgba(65, 150, 255, 0.5);
  color: var(--primary);
  background: rgba(65, 150, 255, 0.06);
}

.dept-cat-add-pill:hover {
  background: var(--primary);
  color: #FFFFFF;
  border-style: solid;
}

#addDepartmentModal .modal-card {
  max-width: 640px;
}

.dept-home-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.dept-home-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.dept-home-meta-chip i {
  color: var(--primary);
  font-size: 10.5px;
}

.dept-home-settings-grid {
  align-items: start;
  margin-bottom: 10px;
}

.dept-field-hint {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.dept-layout-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-secondary);
}

.dept-layout-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.dept-layout-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.dept-layout-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.dept-layout-option input[type="radio"]:checked + span {
  background: var(--surface);
  color: var(--primary);
  border-color: rgba(65, 150, 255, 0.45);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.dept-layout-option input[type="radio"]:focus-visible + span {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.dept-modal-cat-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 12px;
  background: var(--surface-secondary);
}

.dept-modal-cat-panel legend {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 3px 12px;
}

.dept-modal-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 12px;
}

.dept-modal-cat-hint {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.dept-modal-cat-count {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11.5px;
  flex-shrink: 0;
}

.dept-quick-add-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.dept-quick-add-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 7px;
}

.dept-quick-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dept-quick-add-row .form-input {
  flex: 1;
  min-width: 0;
  height: 38px;
  font-size: 13px;
  margin: 0;
}

.dept-quick-add-row .btn {
  flex-shrink: 0;
  height: 38px;
  padding: 0 14px;
  white-space: nowrap;
}

.dept-modal-cat-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 230px;
  overflow-y: auto;
  padding-right: 4px;
}

.dept-modal-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

@media (max-width: 560px) {
  .dept-layout-segmented {
    grid-template-columns: 1fr;
  }

  .dept-modal-cat-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .dept-quick-add-row {
    flex-direction: column;
    align-items: stretch;
  }

  .dept-quick-add-row .btn {
    width: 100%;
    justify-content: center;
  }
}

.dept-modal-cat-item.is-assigned {
  border-color: rgba(65, 150, 255, 0.45);
  background: rgba(65, 150, 255, 0.05);
}

.dept-modal-cat-check {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.dept-modal-cat-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}

.dept-modal-cat-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.dept-modal-cat-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dept-modal-cat-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dept-modal-cat-meta {
  font-size: 11px;
  color: var(--text-secondary);
}

.dept-modal-cat-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-secondary);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.dept-modal-cat-edit-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}













/* ============================================================================
   Home Layout / Storefront Section Ordering (#view-home-layout)
   ============================================================================ */
.home-layout-subtitle {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: var(--text-tertiary);
}

.home-layout-sync-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.28);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.home-layout-sync-badge.is-updated {
  transform: scale(1.04);
  background: rgba(16, 185, 129, 0.22);
}

.home-layout-summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.home-layout-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.home-layout-stat-card.is-highlight {
  border-color: rgba(65, 150, 255, 0.38);
  background: rgba(65, 150, 255, 0.05);
}

.home-layout-stat-label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 600;
}

.home-layout-stat-val {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.home-layout-board {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
}

.home-layout-fixed-anchor {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-secondary);
  border: 1px dashed var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 14px;
}

.home-layout-fixed-anchor i {
  color: var(--text-tertiary);
}

.home-layout-sortable-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-layout-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.18s ease, background-color 0.18s ease, opacity 0.18s ease;
  cursor: grab;
}

.home-layout-item:hover {
  border-color: rgba(65, 150, 255, 0.45);
}

.home-layout-item.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.home-layout-item.is-drag-over {
  border-color: var(--primary);
  background: rgba(65, 150, 255, 0.06);
}

.home-layout-item.is-hidden-section {
  opacity: 0.62;
  background: var(--surface-secondary);
}

.home-layout-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.home-layout-drag-handle {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: grab;
  padding: 6px 4px;
  font-size: 15px;
  flex-shrink: 0;
}

.home-layout-drag-handle:hover {
  color: var(--primary);
}

.home-layout-rank-badge {
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--surface-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.home-layout-rank-badge.is-top-slot {
  background: rgba(65, 150, 255, 0.14);
  color: var(--primary);
  border-color: rgba(65, 150, 255, 0.35);
}

.home-layout-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.home-layout-icon-box.accent-blue { background: rgba(65, 150, 255, 0.12); color: #2b7fff; }
.home-layout-icon-box.accent-purple { background: rgba(139, 92, 246, 0.12); color: #7c3aed; }
.home-layout-icon-box.accent-amber { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.home-layout-icon-box.accent-teal { background: rgba(20, 184, 166, 0.12); color: #0d9488; }
.home-layout-icon-box.accent-indigo { background: rgba(99, 102, 241, 0.12); color: #4f46e5; }

.home-layout-info {
  min-width: 0;
  flex: 1;
}

.home-layout-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.home-layout-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.home-layout-type-pill,
.home-layout-top-pill,
.home-layout-hidden-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

.home-layout-type-pill {
  background: var(--surface-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.home-layout-top-pill {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.home-layout-hidden-pill {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.24);
}

.home-layout-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.home-layout-item-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.home-layout-vis-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.home-layout-vis-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.home-layout-vis-slider {
  position: relative;
  width: 34px;
  height: 19px;
  border-radius: 999px;
  background: var(--border);
  transition: background-color 0.18s ease;
}

.home-layout-vis-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.18s ease;
}

.home-layout-vis-toggle input:checked + .home-layout-vis-slider {
  background: var(--primary);
}

.home-layout-vis-toggle input:checked + .home-layout-vis-slider::after {
  transform: translateX(15px);
}

.home-layout-move-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.home-layout-move-group .btn-move-order {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-secondary);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.home-layout-move-group .btn-move-order:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(65, 150, 255, 0.08);
}

@media (max-width: 768px) {
  .home-layout-item {
    align-items: stretch;
  }

  .home-layout-item-actions {
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
  }
}

/* ==========================================================================
   Multi-Image Gallery Uploader & Admin Single Product Multi-Image Gallery
   ========================================================================== */
.multi-img-uploader {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md, 12px);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.multi-img-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.multi-img-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.multi-img-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-pill, 999px);
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 700;
}

.multi-img-hint-text {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.multi-img-clear-all {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
  border-radius: var(--radius-sm, 8px);
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}

.multi-img-clear-all:hover {
  background: #DC2626;
  color: #FFFFFF;
}

.multi-img-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 580px) {
  .multi-img-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (max-width: 380px) {
  .multi-img-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.multi-img-card {
  background: var(--surface, #FFFFFF);
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.multi-img-card.is-primary {
  border-color: var(--primary, #4196FF);
  box-shadow: 0 2px 10px rgba(65, 150, 255, 0.16);
}

.multi-img-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--surface-secondary, #F1F5F9);
  overflow: hidden;
}

.multi-img-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.multi-img-primary-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  background: var(--primary, #4196FF);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

.multi-img-index-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  background: rgba(15, 23, 42, 0.72);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.multi-img-btn-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.78);
  color: #FFFFFF;
  font-size: 10.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}

.multi-img-btn-remove:hover {
  background: #EF4444;
  transform: scale(1.08);
}

.multi-img-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 5px;
  background: var(--surface, #FFFFFF);
  border-top: 1px solid var(--border, #E2E8F0);
  gap: 3px;
}

.multi-img-mini-btn {
  flex: 1;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--border, #E2E8F0);
  background: var(--surface-secondary, #F8FAFC);
  color: var(--text-secondary);
  font-size: 10.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.multi-img-mini-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(65, 150, 255, 0.08);
}

.multi-img-mini-btn.is-star:hover:not(:disabled) {
  border-color: #F59E0B;
  color: #D97706;
  background: rgba(245, 158, 11, 0.12);
}

.multi-img-mini-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.multi-img-primary-dot {
  flex: 1;
  height: 24px;
  border-radius: 6px;
  background: rgba(65, 150, 255, 0.1);
  color: var(--primary, #4196FF);
  font-size: 10.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.multi-img-url-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.multi-img-url-row .img-url-input {
  flex: 1;
  min-width: 0;
}

.multi-img-url-add-btn {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0 14px;
  height: auto;
  min-height: 40px;
}

/* Inventory table multi-photo badge */
.prod-thumb-wrap {
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
}

.prod-thumb-count-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--primary, #4196FF);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--surface, #FFFFFF);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
}

/* Admin Single Product Detail Multi-Image Gallery */
.pd-media-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #1A1A2E;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  font-size: 11px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
  transition: transform 0.15s ease, background 0.15s ease;
}

.pd-media-nav.prev {
  left: 8px;
}

.pd-media-nav.next {
  right: 8px;
}

.pd-media-nav:hover {
  background: #FFFFFF;
  transform: translateY(-50%) scale(1.06);
}

.pd-media-counter {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(6px);
  z-index: 3;
}

.pd-media-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.pd-media-thumb-btn {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--surface-secondary);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.pd-media-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pd-media-thumb-btn.active {
  border-color: var(--primary, #4196FF);
  box-shadow: 0 0 0 2px rgba(65, 150, 255, 0.2);
}

.pd-media-manage-btn {
  margin-top: 10px;
  width: 100%;
  height: 36px;
  border-radius: 9px;
  border: 1.5px dashed var(--primary, #4196FF);
  background: rgba(65, 150, 255, 0.06);
  color: var(--primary, #4196FF);
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: background 0.15s ease, border-style 0.15s ease;
}

.pd-media-manage-btn:hover {
  background: rgba(65, 150, 255, 0.14);
  border-style: solid;
}

[data-theme="dark"] .multi-img-uploader {
  background: #181E2C;
  border-color: #2D3748;
}

[data-theme="dark"] .multi-img-count-pill {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(96, 165, 250, 0.3);
  color: #93C5FD;
}

[data-theme="dark"] .multi-img-clear-all {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(248, 113, 113, 0.3);
  color: #FCA5A5;
}

[data-theme="dark"] .multi-img-card,
[data-theme="dark"] .multi-img-card-actions {
  background: #10141E;
  border-color: #2D3748;
}

[data-theme="dark"] .multi-img-mini-btn {
  background: #1E2538;
  border-color: #334155;
  color: #CBD5E1;
}

[data-theme="dark"] .pd-media-nav {
  background: rgba(30, 36, 51, 0.9);
  color: #F8FAFC;
  border-color: rgba(255, 255, 255, 0.14);
}

@media (max-width: 580px) {
  .multi-img-url-row {
    flex-direction: column;
  }
  .multi-img-url-add-btn {
    width: 100%;
  }
}

/* Admin Single Product Detail Description Box */
.pd-description-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
}

.pd-description-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.pd-description-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-line;
  word-break: break-word;
}

[data-theme="dark"] .pd-description-box {
  background: #181E2C;
  border-color: #2D3748;
}

/* ==========================================================================
   Edit / Add Product Dedicated Page View
   ========================================================================== */
.edit-prod-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 14px;
}

.edit-prod-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.edit-prod-title-group .page-title {
  margin: 0;
  display: flex;
  align-items: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.edit-prod-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.edit-product-form-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding-bottom: 60px;
}

.edit-product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  width: 100%;
  box-sizing: border-box;
}

.edit-product-form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
  .edit-prod-page-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
  }
  .edit-prod-heading {
    flex-wrap: wrap;
  }
  .edit-prod-page-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .edit-prod-page-actions .btn {
    width: 100% !important;
    justify-content: center !important;
  }
  .edit-product-card {
    padding: 16px 14px;
  }
  .edit-product-form-footer {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .edit-product-form-footer .btn {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* ==========================================================================
   Final Mobile Multi-Option & Toolbar Cascade Overrides (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
  #view-reports .reports-type-tabs,
  .reports-type-tabs,
  .tabs-filter,
  #view-orders .tabs-filter,
  #orderTabsFilter,
  #view-orders #orderTabsFilter,
  .backup-tabs-list {
    display: flex !important;
    flex-wrap: wrap !important;
    overflow-x: visible !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 4px !important;
  }

  .backup-entity-grid,
  .backup-cards-grid {
    grid-template-columns: 1fr !important;
  }

  #view-reports .reports-type-btn,
  .reports-type-btn,
  .backup-tab-btn,
  .tabs-filter .tab-btn,
  #orderTabsFilter .tab-btn {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
    justify-content: center !important;
  }

  .tabs-filter .tab-indicator {
    display: none !important;
  }

  .tabs-filter .tab-btn.active,
  #orderTabsFilter .tab-btn.active {
    background: var(--primary-light, #EBF5FF) !important;
    color: var(--primary) !important;
    border-radius: var(--radius-pill, 9999px) !important;
  }
}

/* ==========================================================================
   Clean & Minimal Customer Profile Modal UI (PC + Mobile)
   ========================================================================== */
.cust-profile-header-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.cust-profile-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.cust-profile-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cust-profile-name-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.cust-profile-name-row h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.25;
}

.cust-profile-tier {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.cust-profile-address {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.cust-profile-contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.cust-simple-phone {
  font-family: monospace;
  font-size: 12.5px;
  font-weight: 700;
  color: #059669;
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 9px;
  border-radius: 9999px;
}

.cust-simple-email {
  font-size: 12px;
  color: var(--text-secondary);
}

.cust-simple-add-email {
  background: transparent;
  border: none;
  padding: 2px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}

.cust-simple-add-email:hover {
  text-decoration: underline;
}

.cust-profile-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cust-location-simple-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.cust-location-simple-text {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 600;
}

.cust-location-simple-card {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.cust-location-simple-title {
  font-size: 12.5px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cust-location-simple-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.cust-location-simple-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.cust-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.cust-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.cust-kpi-label {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.cust-kpi-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
}

.cust-kpi-value.primary { color: var(--primary); }
.cust-kpi-value.danger { color: var(--danger); }

.cust-kpi-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 3px;
}

@media (max-width: 768px) {
  .cust-profile-header-card {
    padding: 12px;
    gap: 10px;
  }
  .cust-profile-identity {
    gap: 10px;
  }
  .cust-smart-avatar {
    width: 44px !important;
    height: 44px !important;
    font-size: 16px !important;
  }
  .cust-profile-name-row h3 {
    font-size: 16px;
  }
  .cust-profile-header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .cust-profile-header-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .cust-location-simple-card {
    grid-template-columns: 1fr;
  }
  .cust-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }
  .cust-kpi-card {
    padding: 10px 12px;
  }
  .cust-kpi-value {
    font-size: 16px;
  }
  .profile-orders-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .profile-orders-table thead {
    display: none !important;
  }
  .profile-orders-table tbody {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 8px !important;
    gap: 8px !important;
    box-sizing: border-box !important;
  }
  .profile-orders-table tbody tr {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas:
      "header total"
      "items items"
      "payment payment"
      "status actions" !important;
    gap: 6px 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 10px 12px !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    background: var(--surface) !important;
  }
  .profile-orders-table tbody tr td { min-width: 0 !important; }
  .profile-orders-table tbody tr td:nth-child(1) { grid-area: header !important; padding: 0 !important; border: none !important; }
  .profile-orders-table tbody tr td:nth-child(2) { grid-area: items !important; padding: 0 !important; border: none !important; font-size: 12.5px !important; }
  .profile-orders-table tbody tr td:nth-child(3) { grid-area: total !important; padding: 0 !important; border: none !important; font-weight: 800 !important; color: var(--primary) !important; text-align: right !important; white-space: nowrap !important; }
  .profile-orders-table tbody tr td:nth-child(4) { grid-area: payment !important; padding: 4px 0 !important; border: none !important; display: flex !important; flex-wrap: wrap !important; gap: 4px !important; align-items: center !important; }
  .profile-orders-table tbody tr td:nth-child(5) { grid-area: status !important; padding: 2px 0 !important; border: none !important; justify-self: start !important; }
  .profile-orders-table tbody tr td:nth-child(6) { grid-area: actions !important; padding: 0 !important; border: none !important; justify-self: end !important; }
}

/* ==========================================================================
   Admin Login Screen & Auth Guard
   ========================================================================== */
html.auth-locked body > .admin-layout {
  visibility: hidden;
  pointer-events: none;
}

.admin-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at top, rgba(65, 150, 255, 0.08), transparent 55%), var(--bg, #FFFBF5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-login-card {
  width: 100%;
  max-width: 410px;
  background: var(--surface, #FFFFFF);
  border: 1px solid var(--border, #EAE3D5);
  border-radius: 18px;
  padding: 30px 28px;
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.08);
  box-sizing: border-box;
}

.admin-login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border, #EAE3D5);
}

.admin-login-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4196FF 0%, #2563EB 100%);
  color: #FFFFFF;
  font-size: 21px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(65, 150, 255, 0.28);
}

.admin-login-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.admin-login-sub {
  margin: 3px 0 0 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.admin-login-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #DC2626;
  font-size: 12.5px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 14px;
}

.admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.admin-login-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.admin-login-input {
  width: 100%;
  height: 44px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border, #EAE3D5);
  background: var(--bg, #FFFBF5);
  color: var(--text-primary, #1E232E);
  font-family: inherit;
  font-size: 13.5px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  outline: none;
}

.admin-login-input:focus {
  border-color: var(--primary, #4196FF);
  background: var(--surface, #FFFFFF);
  box-shadow: 0 0 0 3px rgba(65, 150, 255, 0.16);
}

.admin-login-input::placeholder {
  color: var(--text-tertiary, #94A3B8);
}

.admin-login-pw-wrap {
  position: relative;
  width: 100%;
}

.admin-login-pw-wrap .admin-login-input {
  padding-right: 42px;
}

.admin-login-pw-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.admin-login-pw-toggle:hover {
  background: var(--surface-secondary);
  color: var(--text-primary);
}

.admin-login-remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-login-remember-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
}

.admin-login-remember-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary, #4196FF);
  cursor: pointer;
}

.admin-login-btn {
  width: 100%;
  height: 44px;
  justify-content: center;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  margin-top: 2px;
  box-shadow: 0 4px 14px rgba(65, 150, 255, 0.26);
}

.topbar-logout-btn {
  color: #DC2626 !important;
}

.topbar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.1) !important;
}

/* ==========================================================================
   Clean Admin Notice Board Form & Minimal Banner Preview
   ========================================================================== */
.notice-target-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
}

.notice-target-tab {
  padding: 8px 18px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.notice-target-tab.active {
  background: var(--primary);
  color: #FFFFFF;
}

.notice-field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.notice-form-input,
.notice-form-textarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13.5px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.notice-form-input {
  height: 42px;
}

.notice-form-textarea {
  resize: vertical;
  min-height: 86px;
  line-height: 1.5;
}

.notice-form-input:focus,
.notice-form-textarea:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(65, 150, 255, 0.15);
}

.notice-clean-title {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.user-notice-banner .btn-notice-action {
  background: var(--notice-chip-bg);
  color: var(--notice-chip-color) !important;
  border: 1px solid var(--notice-chip-border);
  box-shadow: none;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
}

.user-notice-banner .btn-notice-action:hover {
  background: var(--notice-btn-bg);
  color: #FFFFFF !important;
  border-color: var(--notice-btn-bg);
}
