/* --------------------------------------------------------------------------
 * BoostedPlug SMM Panel - Premium Orange Light Design System
 * Clean, High-Contrast, Crisp Warm Slate & Boosted Orange, Mobile-First
 * -------------------------------------------------------------------------- */

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

:root {
  /* Color Palette - Premium Crisp Warm Canvas & Boosted Orange */
  --bg-page: #f8fafc;           /* Ultra-clean slate 50 canvas */
  --bg-surface: #ffffff;        /* Pure crisp card & modal white */
  --bg-surface-elevated: #f1f5f9;/* Slate 100 hover / active pills */
  --bg-input: #ffffff;          /* Clean white input background */
  --bg-card: #ffffff;           /* Card background */
  --bg-topbar: rgba(255, 255, 255, 0.92);
  --bg-landing-nav: rgba(255, 255, 255, 0.94);
  --bg-bottom-nav: rgba(255, 255, 255, 0.95);
  --glass-blur: blur(16px);
  
  --border-subtle: #f1f5f9;     /* Slate 100 */
  --border-default: #e2e8f0;    /* Slate 200 - crisp, clean boundaries */
  --border-strong: #cbd5e1;     /* Slate 300 - input borders */
  --border-focus: var(--primary); /* Focus ring follows theme primary */

  /* Text & Contrast (WCAG 2.1 AAA/AA Compliant) */
  --text-primary: #0f172a;      /* Slate 900 - Contrast > 16:1 against #fff */
  --text-secondary: #475569;    /* Slate 600 - Contrast > 5.5:1 */
  --text-tertiary: #64748b;     /* Slate 500 */
  --text-muted: #94a3b8;        /* Slate 400 */
  --text-main: #0f172a;

  /* Brand Theme Colors */
  --primary: #ff6b00;           /* Vibrant Boosted Orange (Default) */
  --primary-hover: #e05e00;     /* Deep Orange */
  --primary-light: #c2410c;     /* Deep high-contrast orange for text on light backgrounds */
  --primary-accent: #ff8533;    /* Radiant Orange */
  --primary-subtle: #fff7ed;    /* Warm Orange 50 tint */
  --primary-border: #fed7aa;    /* Warm Orange 200 border */
  --primary-text: #ffffff;      /* High contrast text on primary buttons */
  --primary-glow: 0 4px 14px 0 rgba(255, 107, 0, 0.28);
  --brand-gradient: linear-gradient(135deg, var(--primary-accent) 0%, var(--primary) 100%);
  --brand-gradient-hover: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);

  /* Functional Status Colors (Tuned for Crisp Light Mode) */
  --success: #059669;           /* Emerald 600 */
  --success-text: #065f46;      /* Emerald 800 - High contrast on light chip */
  --success-bg: #ecfdf5;        /* Emerald 50 */
  --success-border: #a7f3d0;    /* Emerald 200 */

  --warning: #d97706;           /* Amber 600 */
  --warning-text: #92400e;      /* Amber 800 */
  --warning-bg: #fffbeb;        /* Amber 50 */
  --warning-border: #fde68a;    /* Amber 200 */

  --danger: #dc2626;            /* Red 600 */
  --danger-text: #991b1b;       /* Red 800 */
  --danger-bg: #fef2f2;         /* Red 50 */
  --danger-border: #fecaca;     /* Red 200 */

  --info: #0284c7;              /* Sky 600 */
  --info-text: #075985;         /* Sky 800 */
  --info-bg: #f0f9ff;           /* Sky 50 */
  --info-border: #bae6fd;       /* Sky 200 */

  /* Typography Scale */
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 20px;
  --text-xl: 24px;
  --text-2xl: 32px;
  --text-3xl: 48px;

  /* Spacing Scale */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;

  /* Geometry & Shadows */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
  --shadow-card: 0 1px 3px 0 rgba(15, 23, 42, 0.04), 0 1px 2px 0 rgba(15, 23, 42, 0.02);

  /* Transitions */
  --transition: all 180ms ease-in-out;
}

/* --------------------------------------------------------------------------
 * Dark Theme Custom Tokens & Surface Definitions (WCAG 2.1 AA/AAA)
 * -------------------------------------------------------------------------- */
[data-theme="dark"], html[data-theme="dark"], body.mode-dark {
  --bg-page: #0b0f19;
  --bg-surface: #111827;
  --bg-surface-elevated: #1e293b;
  --bg-input: #111827;
  --bg-card: #111827;
  --bg-topbar: rgba(17, 24, 39, 0.88);
  --bg-landing-nav: rgba(17, 24, 39, 0.92);
  --bg-bottom-nav: rgba(17, 24, 39, 0.92);
  
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-default: #1e293b;
  --border-strong: #334155;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-muted: #64748b;
  --text-main: #f8fafc;

  --success-bg: rgba(5, 150, 105, 0.15);
  --success-text: #34d399;
  --success-border: rgba(5, 150, 105, 0.35);

  --warning-bg: rgba(217, 119, 6, 0.15);
  --warning-text: #fbbf24;
  --warning-border: rgba(217, 119, 6, 0.35);

  --danger-bg: rgba(220, 38, 38, 0.15);
  --danger-text: #f87171;
  --danger-border: rgba(220, 38, 38, 0.35);

  --info-bg: rgba(2, 132, 199, 0.15);
  --info-text: #38bdf8;
  --info-border: rgba(2, 132, 199, 0.35);

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 14px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 28px -3px rgba(0, 0, 0, 0.6);
  --shadow-card: 0 2px 8px 0 rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .card,
.mode-dark .card {
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.45);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .table th,
.mode-dark .table th {
  background-color: #1e293b;
  border-bottom-color: #334155;
  color: #94a3b8;
}

[data-theme="dark"] .table td,
.mode-dark .table td {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .auth-card,
.mode-dark .auth-card {
  background-color: #111827;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .auth-wrapper,
.mode-dark .auth-wrapper {
  background: radial-gradient(circle at 50% 10%, rgba(234, 88, 12, 0.15) 0%, rgba(11, 15, 25, 0) 70%);
}

/* --------------------------------------------------------------------------
 * Reset & Base Standards
 * -------------------------------------------------------------------------- */
/* Guard: Ensure head, style and script tags never display on the page */
head, style, script, link, meta, title {
  display: none !important;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100vw;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100vw;
  width: 100%;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.65rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.35rem); }
h4 { font-size: var(--text-base); }

p {
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85em;
  background-color: var(--primary-subtle);
  color: var(--primary-light);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--primary-border);
}

pre {
  background-color: #0f172a;
  color: #f8fafc;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

pre code {
  background: transparent;
  color: inherit;
  border: none;
  padding: 0;
}

/* Focus Visible for Accessibility */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
 * SVG Icons Integration
 * -------------------------------------------------------------------------- */
.icon-svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
 * Mobile-First Layout Architecture (Rule 5)
 * -------------------------------------------------------------------------- */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Mobile Sidebar Drawer */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(280px, 84vw);
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 240ms ease;
  box-shadow: none;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.sidebar.open {
  transform: translateX(0);
  box-shadow: 8px 0 32px rgba(15, 23, 42, 0.2);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  transition: opacity 200ms ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

.sidebar-header {
  height: 64px;
  min-height: 64px;
  padding: 0 var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  border-bottom: 1px solid var(--border-default);
}

.sidebar-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-close-btn:hover {
  background-color: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

@media (min-width: 1024px) {
  .sidebar-close-btn {
    display: none !important;
  }
}

.brand-badge {
  width: 32px;
  height: 32px;
  background: var(--brand-gradient);
  color: var(--primary-text, #ffffff);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-base);
  box-shadow: var(--primary-glow);
}

.brand-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.sidebar-menu {
  flex: 1;
  padding: var(--space-2) var(--space-1);
  overflow-y: auto;
  list-style: none;
}

.menu-category {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: var(--space-3) var(--space-2) var(--space-1);
}

.menu-item a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px var(--space-2);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  min-height: 44px; /* Touch target (Rule 5) */
  transition: var(--transition);
}

.menu-item a:hover {
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.menu-item.active a {
  background-color: var(--primary-subtle);
  color: var(--primary);
  font-weight: 600;
  border-left: 3px solid var(--primary);
}

/* Sidebar Dropdown Accordion Menu */
.menu-dropdown-group {
  margin-bottom: 2px;
}

.menu-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
  cursor: pointer;
  transition: all 180ms ease;
  user-select: none;
}

.menu-dropdown-toggle:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-elevated);
}

.menu-dropdown-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.menu-dropdown-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-dropdown-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.dropdown-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-dropdown-group.is-open .dropdown-chevron {
  transform: rotate(0deg);
}

.menu-dropdown-group.is-collapsed .dropdown-chevron {
  transform: rotate(-90deg);
}

.menu-dropdown-items {
  transition: opacity 180ms ease;
}

.menu-dropdown-group.is-collapsed .menu-dropdown-items {
  display: none;
}

.menu-dropdown-group.is-open .menu-dropdown-items {
  display: block;
}

/* User Profile Topbar Dropdown */
.user-profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px 0;
  z-index: 1000;
  animation: modalSlideIn 150ms ease;
}

.user-profile-dropdown a,
.user-profile-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.user-profile-dropdown a:hover,
.user-profile-dropdown button:hover {
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.user-profile-dropdown-divider {
  height: 1px;
  background-color: var(--border-default);
  margin: 6px 0;
}

.sidebar-footer {
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--border-default);
}

/* Main Content Surface */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top Navigation Bar */
.topbar {
  min-height: 58px;
  height: auto;
  background: var(--bg-topbar);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px var(--space-3);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: var(--space-2);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.5vw, 12px);
  min-width: 0;
}

.mobile-toggle {
  background: none;
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.mobile-toggle:hover {
  background-color: var(--bg-surface-elevated);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.5vw, 12px);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.balance-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  padding: 6px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}

.balance-chip:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-sm);
}

.balance-chip strong {
  color: var(--success-text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.balance-add-btn {
  background: var(--brand-gradient);
  color: var(--primary-text, #ffffff);
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  margin-left: 2px;
  text-decoration: none;
  box-shadow: var(--primary-glow);
  transition: var(--transition);
}

.balance-add-btn:hover {
  background: var(--brand-gradient-hover);
  color: var(--primary-text, #ffffff);
  transform: scale(1.08);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background-color: var(--primary-subtle);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-xs);
}

/* --------------------------------------------------------------------------
 * Mobile Bottom Quick Navigation Bar (<768px)
 * -------------------------------------------------------------------------- */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(58px + env(safe-area-inset-bottom, 0px));
  padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px)) 6px;
  background: var(--bg-bottom-nav);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--border-default);
  z-index: 950;
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.08);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-tertiary);
  text-decoration: none;
  flex: 1;
  height: 100%;
  font-size: 11px;
  font-weight: 600;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
  border-radius: var(--radius-sm);
  padding: 4px 2px;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
  color: var(--primary);
}

.mobile-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 24px;
  transition: var(--transition);
}

.mobile-nav-icon svg {
  width: 20px;
  height: 20px;
}

.mobile-nav-item.active .mobile-nav-icon {
  color: var(--primary);
  transform: translateY(-1px);
}

.mobile-nav-label {
  font-size: 10px;
  letter-spacing: -0.01em;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
 * Main Body Padding & Wrappers
 * -------------------------------------------------------------------------- */
.content-wrapper {
  padding: var(--space-3) var(--space-2);
  flex: 1;
}

.page-header {
  margin-bottom: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.page-title {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
 * Cards & Containers (Subtle Borders, No Glassmorphism - Rule 3)
 * -------------------------------------------------------------------------- */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: var(--space-3);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-default);
  padding-bottom: var(--space-2);
}

.card-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
}

/* Asymmetrical & Standard Grids (Rule 3) */
.grid-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.grid-cols-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.grid-cols-4 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

/* Stat Widget Cards */
.stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: clamp(12px, 2vw, 20px);
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.5vw, 16px);
  min-width: 0;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.stat-icon, .stat-icon-wrapper {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: var(--radius-sm);
  background-color: var(--primary-subtle);
  border: 1px solid var(--primary-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.stat-icon.success { color: var(--success); border-color: var(--success-border); background-color: var(--success-bg); }
.stat-icon.warning { color: var(--warning); border-color: var(--warning-border); background-color: var(--warning-bg); }
.stat-icon.danger  { color: var(--danger);  border-color: var(--danger-border);  background-color: var(--danger-bg); }
.stat-icon.primary { color: var(--primary); border-color: var(--primary-border); background-color: var(--primary-subtle); }
.stat-icon.info    { color: var(--info); border-color: var(--info-border); background-color: var(--info-bg); }

.stat-content, .stat-details {
  min-width: 0;
  flex: 1;
}

.stat-content h4, .stat-details h2 {
  font-size: var(--text-xs);
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-content .stat-number, .stat-details .stat-value {
  font-size: clamp(1.2rem, 3.5vw, 1.5rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
 * Skeletons & Loading States (Rule 6)
 * -------------------------------------------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface-elevated) 25%, var(--border-subtle) 50%, var(--bg-surface-elevated) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite linear;
  border-radius: var(--radius-xs);
  display: inline-block;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 14px;
  width: 100%;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: 12px;
}

.skeleton-card {
  min-height: 120px;
  width: 100%;
  border-radius: var(--radius-md);
}

/* --------------------------------------------------------------------------
 * Empty States (Rule 6)
 * -------------------------------------------------------------------------- */
.empty-state {
  padding: clamp(2rem, 5vw, 4rem) 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  max-width: 480px;
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background-color: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-2);
}

.empty-state-icon svg {
  width: 24px;
  height: 24px;
}

.empty-state-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.empty-state-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

.empty-state-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: center;
}

/* --------------------------------------------------------------------------
 * Form Controls & Accessibility (Rule 7)
 * -------------------------------------------------------------------------- */
.form-group {
  margin-bottom: var(--space-3);
}

.form-row-2col {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
}

@media (min-width: 540px) {
  .form-row-2col {
    grid-template-columns: 1fr 1fr;
  }
}

.form-row-3col {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
}

@media (min-width: 640px) {
  .form-row-3col {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 900px) {
  .form-row-3col {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.form-control, .form-select {
  width: 100%;
  min-height: 44px; /* Accessible touch target */
  padding: 10px 14px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px; /* Prevents auto-zoom on mobile iOS devices */
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}

@media (min-width: 768px) {
  .form-control, .form-select {
    font-size: var(--text-sm);
    padding: var(--space-1) var(--space-2);
  }
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
 * Buttons & Hierarchy (Rule 3)
 * -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: 44px; /* Accessible touch target */
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--text-sm);
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--brand-gradient);
  color: var(--primary-text, #ffffff);
  border-color: var(--primary);
  box-shadow: var(--primary-glow);
}

.btn-primary:hover {
  background: var(--brand-gradient-hover);
  border-color: var(--primary-hover);
  box-shadow: var(--primary-glow);
  color: var(--primary-text, #ffffff);
}

.btn-primary:focus,
.btn-primary:active {
  color: var(--primary-text, #ffffff);
}

.btn-primary svg {
  color: inherit;
  fill: currentColor;
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background-color: var(--bg-surface-elevated);
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.btn-success {
  background-color: var(--success);
  color: #ffffff;
}

.btn-success:hover {
  background-color: #047857;
  color: #ffffff;
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #b91c1c;
  color: #ffffff;
}

.btn-sm {
  min-height: 32px;
  padding: 0 var(--space-2);
  font-size: var(--text-xs);
}

@media (pointer: coarse), (max-width: 640px) {
  .btn-sm {
    min-height: 44px; /* Accessible 44px touch target on mobile */
    padding: 0 var(--space-2);
  }
}

.btn-block {
  width: 100%;
}

.btn-warning {
  background-color: var(--warning);
  color: #ffffff;
}

.btn-warning:hover {
  background-color: #b45309;
  color: #ffffff;
}

.btn-info {
  background-color: var(--info);
  color: #ffffff;
}

.btn-info:hover {
  background-color: #0369a1;
  color: #ffffff;
}

.btn-xs {
  min-height: 28px;
  padding: 0 10px;
  font-size: var(--text-xs);
}

@media (pointer: coarse), (max-width: 640px) {
  .btn-xs {
    min-height: 44px;
    padding: 0 12px;
  }
}

.btn-outline-success {
  background-color: transparent;
  border: 1px solid var(--success);
  color: var(--success-text);
}

.btn-outline-success:hover {
  background-color: var(--success-bg);
  color: var(--success-text);
}

.btn-outline-warning {
  background-color: transparent;
  border: 1px solid var(--warning);
  color: var(--warning-text);
}

.btn-outline-warning:hover {
  background-color: var(--warning-bg);
  color: var(--warning-text);
}

.btn-ghost {
  background-color: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: var(--border-default);
}

/* --------------------------------------------------------------------------
 * Badges & Labels (Subtle, High Contrast, No Emojis - Rule 3)
 * -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-1);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  border: 1px solid transparent;
}

.badge-success {
  background-color: var(--success-bg);
  color: var(--success-text);
  border-color: var(--success-border);
}

.badge-primary {
  background-color: var(--primary-subtle);
  color: var(--primary-light);
  border-color: var(--primary-border);
}

.badge-warning {
  background-color: var(--warning-bg);
  color: var(--warning-text);
  border-color: var(--warning-border);
}

.badge-danger {
  background-color: var(--danger-bg);
  color: var(--danger-text);
  border-color: var(--danger-border);
}

.badge-secondary {
  background-color: var(--bg-surface-elevated);
  color: var(--text-secondary);
  border-color: var(--border-default);
}

/* Metallic VIP & Loyalty Tier Badges */
.badge-bronze {
  background: linear-gradient(135deg, #b45309 0%, #d97706 100%) !important;
  color: #ffffff !important;
  border: 1px solid #92400e !important;
  box-shadow: 0 2px 6px rgba(180, 83, 9, 0.28);
  font-weight: 700 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.badge-silver {
  background: linear-gradient(135deg, #475569 0%, #94a3b8 100%) !important;
  color: #ffffff !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 2px 6px rgba(71, 85, 105, 0.25);
  font-weight: 700 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.badge-gold {
  background: linear-gradient(135deg, #a16207 0%, #eab308 100%) !important;
  color: #ffffff !important;
  border: 1px solid #854d0e !important;
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.35);
  font-weight: 700 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.badge-platinum {
  background: linear-gradient(135deg, #4338ca 0%, #6366f1 50%, #06b6d4 100%) !important;
  color: #ffffff !important;
  border: 1px solid #3730a3 !important;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
  font-weight: 700 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* --------------------------------------------------------------------------
 * Loyalty Membership & VIP Tier Card Suites
 * -------------------------------------------------------------------------- */
.loyalty-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg, 16px);
  padding: 1.35rem 1.6rem;
  margin-bottom: var(--space-4, 1.5rem);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.loyalty-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 320px;
  height: 100%;
  background: radial-gradient(circle at 100% 0%, var(--tier-glow, rgba(217, 119, 6, 0.16)), transparent 70%);
  pointer-events: none;
}

/* === BRONZE TIER === */
.loyalty-card-bronze {
  --tier-base: #d97706;
  --tier-base-dark: #92400e;
  --tier-glow: rgba(217, 119, 6, 0.2);
  background: linear-gradient(135deg, #fffdf9 0%, #fff7ed 40%, #ffedd5 100%);
  border: 1px solid rgba(217, 119, 6, 0.3);
  box-shadow: 0 8px 24px -4px rgba(217, 119, 6, 0.1), 0 2px 6px -1px rgba(180, 83, 9, 0.05);
}
.loyalty-card-bronze .loyalty-title { color: #9a3412; }
.loyalty-card-bronze .loyalty-heading { color: #431407; }
.loyalty-card-bronze .loyalty-subtext { color: #7c2d12; }
.loyalty-card-bronze .loyalty-muted { color: #9a3412; opacity: 0.9; }
.loyalty-card-bronze .loyalty-icon-box {
  background: linear-gradient(135deg, #fed7aa 0%, #ffedd5 100%);
  color: #b45309;
  border: 1px solid rgba(217, 119, 6, 0.38);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.18);
}
.loyalty-card-bronze .loyalty-rate-pill {
  background: rgba(255, 237, 213, 0.9);
  color: #9a3412;
  border: 1px solid rgba(217, 119, 6, 0.35);
}
.loyalty-card-bronze .loyalty-progress-track {
  background: rgba(217, 119, 6, 0.14);
}
.loyalty-card-bronze .loyalty-progress-fill {
  background: linear-gradient(90deg, #b45309 0%, #d97706 50%, #f59e0b 100%);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.45);
}

[data-theme="dark"] .loyalty-card-bronze,
.mode-dark .loyalty-card-bronze {
  background: linear-gradient(135deg, rgba(42, 26, 17, 0.95) 0%, rgba(28, 19, 13, 0.96) 50%, rgba(15, 20, 32, 0.98) 100%);
  border: 1px solid rgba(217, 119, 6, 0.32);
  box-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.5), 0 0 20px rgba(217, 119, 6, 0.12);
}
[data-theme="dark"] .loyalty-card-bronze .loyalty-title,
.mode-dark .loyalty-card-bronze .loyalty-title { color: #fdba74; }
[data-theme="dark"] .loyalty-card-bronze .loyalty-heading,
.mode-dark .loyalty-card-bronze .loyalty-heading { color: #fff7ed; }
[data-theme="dark"] .loyalty-card-bronze .loyalty-subtext,
.mode-dark .loyalty-card-bronze .loyalty-subtext { color: #fed7aa; }
[data-theme="dark"] .loyalty-card-bronze .loyalty-muted,
.mode-dark .loyalty-card-bronze .loyalty-muted { color: #d6d3d1; }
[data-theme="dark"] .loyalty-card-bronze .loyalty-icon-box,
.mode-dark .loyalty-card-bronze .loyalty-icon-box {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.28) 0%, rgba(180, 83, 9, 0.14) 100%);
  color: #fbbf24;
  border: 1px solid rgba(217, 119, 6, 0.45);
  box-shadow: 0 0 16px rgba(217, 119, 6, 0.22);
}
[data-theme="dark"] .loyalty-card-bronze .loyalty-rate-pill,
.mode-dark .loyalty-card-bronze .loyalty-rate-pill {
  background: rgba(217, 119, 6, 0.18);
  color: #fde68a;
  border: 1px solid rgba(217, 119, 6, 0.36);
}
[data-theme="dark"] .loyalty-card-bronze .loyalty-progress-track,
.mode-dark .loyalty-card-bronze .loyalty-progress-track {
  background: rgba(255, 255, 255, 0.08);
}

/* === SILVER TIER === */
.loyalty-card-silver {
  --tier-base: #64748b;
  --tier-base-dark: #334155;
  --tier-glow: rgba(148, 163, 184, 0.2);
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
  border: 1px solid rgba(148, 163, 184, 0.38);
  box-shadow: 0 8px 24px -4px rgba(100, 116, 139, 0.08);
}
.loyalty-card-silver .loyalty-title { color: #475569; }
.loyalty-card-silver .loyalty-heading { color: #0f172a; }
.loyalty-card-silver .loyalty-subtext { color: #334155; }
.loyalty-card-silver .loyalty-muted { color: #64748b; }
.loyalty-card-silver .loyalty-icon-box {
  background: linear-gradient(135deg, #e2e8f0 0%, #f8fafc 100%);
  color: #475569;
  border: 1px solid #cbd5e1;
  box-shadow: 0 4px 12px rgba(148, 163, 184, 0.18);
}
.loyalty-card-silver .loyalty-rate-pill {
  background: rgba(226, 232, 240, 0.85);
  color: #334155;
  border: 1px solid rgba(148, 163, 184, 0.45);
}
.loyalty-card-silver .loyalty-progress-track { background: rgba(148, 163, 184, 0.2); }
.loyalty-card-silver .loyalty-progress-fill {
  background: linear-gradient(90deg, #64748b 0%, #94a3b8 60%, #cbd5e1 100%);
  box-shadow: 0 0 10px rgba(148, 163, 184, 0.4);
}

[data-theme="dark"] .loyalty-card-silver,
.mode-dark .loyalty-card-silver {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.88) 0%, rgba(20, 27, 45, 0.94) 50%, rgba(15, 23, 42, 0.98) 100%);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .loyalty-card-silver .loyalty-title,
.mode-dark .loyalty-card-silver .loyalty-title { color: #cbd5e1; }
[data-theme="dark"] .loyalty-card-silver .loyalty-heading,
.mode-dark .loyalty-card-silver .loyalty-heading { color: #f8fafc; }
[data-theme="dark"] .loyalty-card-silver .loyalty-subtext,
.mode-dark .loyalty-card-silver .loyalty-subtext { color: #e2e8f0; }
[data-theme="dark"] .loyalty-card-silver .loyalty-muted,
.mode-dark .loyalty-card-silver .loyalty-muted { color: #94a3b8; }
[data-theme="dark"] .loyalty-card-silver .loyalty-icon-box,
.mode-dark .loyalty-card-silver .loyalty-icon-box {
  background: rgba(148, 163, 184, 0.16);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.38);
}
[data-theme="dark"] .loyalty-card-silver .loyalty-rate-pill,
.mode-dark .loyalty-card-silver .loyalty-rate-pill {
  background: rgba(148, 163, 184, 0.16);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.35);
}
[data-theme="dark"] .loyalty-card-silver .loyalty-progress-track,
.mode-dark .loyalty-card-silver .loyalty-progress-track {
  background: rgba(255, 255, 255, 0.08);
}

/* === GOLD TIER === */
.loyalty-card-gold {
  --tier-base: #eab308;
  --tier-base-dark: #a16207;
  --tier-glow: rgba(234, 179, 8, 0.22);
  background: linear-gradient(135deg, #fffef2 0%, #fefce8 45%, #fef08a 100%);
  border: 1px solid rgba(234, 179, 8, 0.38);
  box-shadow: 0 8px 24px -4px rgba(234, 179, 8, 0.14);
}
.loyalty-card-gold .loyalty-title { color: #854d0e; }
.loyalty-card-gold .loyalty-heading { color: #422006; }
.loyalty-card-gold .loyalty-subtext { color: #713f12; }
.loyalty-card-gold .loyalty-muted { color: #854d0e; opacity: 0.9; }
.loyalty-card-gold .loyalty-icon-box {
  background: linear-gradient(135deg, #fef08a 0%, #fefce8 100%);
  color: #a16207;
  border: 1px solid rgba(234, 179, 8, 0.45);
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.22);
}
.loyalty-card-gold .loyalty-rate-pill {
  background: rgba(254, 240, 138, 0.9);
  color: #854d0e;
  border: 1px solid rgba(234, 179, 8, 0.38);
}
.loyalty-card-gold .loyalty-progress-track { background: rgba(234, 179, 8, 0.18); }
.loyalty-card-gold .loyalty-progress-fill {
  background: linear-gradient(90deg, #ca8a04 0%, #eab308 60%, #fef08a 100%);
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.48);
}

[data-theme="dark"] .loyalty-card-gold,
.mode-dark .loyalty-card-gold {
  background: linear-gradient(135deg, rgba(48, 36, 12, 0.95) 0%, rgba(32, 24, 8, 0.96) 50%, rgba(15, 23, 42, 0.98) 100%);
  border: 1px solid rgba(234, 179, 8, 0.38);
  box-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.5), 0 0 20px rgba(234, 179, 8, 0.14);
}
[data-theme="dark"] .loyalty-card-gold .loyalty-title,
.mode-dark .loyalty-card-gold .loyalty-title { color: #fde047; }
[data-theme="dark"] .loyalty-card-gold .loyalty-heading,
.mode-dark .loyalty-card-gold .loyalty-heading { color: #fefce8; }
[data-theme="dark"] .loyalty-card-gold .loyalty-subtext,
.mode-dark .loyalty-card-gold .loyalty-subtext { color: #fef08a; }
[data-theme="dark"] .loyalty-card-gold .loyalty-muted,
.mode-dark .loyalty-card-gold .loyalty-muted { color: #e2e8f0; }
[data-theme="dark"] .loyalty-card-gold .loyalty-icon-box,
.mode-dark .loyalty-card-gold .loyalty-icon-box {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.48);
}
[data-theme="dark"] .loyalty-card-gold .loyalty-rate-pill,
.mode-dark .loyalty-card-gold .loyalty-rate-pill {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.38);
}
[data-theme="dark"] .loyalty-card-gold .loyalty-progress-track,
.mode-dark .loyalty-card-gold .loyalty-progress-track {
  background: rgba(255, 255, 255, 0.08);
}

/* === PLATINUM / DIAMOND TIER === */
.loyalty-card-platinum {
  --tier-base: #6366f1;
  --tier-base-dark: #4338ca;
  --tier-glow: rgba(99, 102, 241, 0.22);
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #e0e7ff 100%);
  border: 1px solid rgba(99, 102, 241, 0.34);
  box-shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.12);
}
.loyalty-card-platinum .loyalty-title { color: #4338ca; }
.loyalty-card-platinum .loyalty-heading { color: #1e1b4b; }
.loyalty-card-platinum .loyalty-subtext { color: #3730a3; }
.loyalty-card-platinum .loyalty-muted { color: #6366f1; opacity: 0.9; }
.loyalty-card-platinum .loyalty-icon-box {
  background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%);
  color: #4f46e5;
  border: 1px solid rgba(99, 102, 241, 0.38);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.22);
}
.loyalty-card-platinum .loyalty-rate-pill {
  background: rgba(224, 231, 255, 0.9);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.35);
}
.loyalty-card-platinum .loyalty-progress-track { background: rgba(99, 102, 241, 0.18); }
.loyalty-card-platinum .loyalty-progress-fill {
  background: linear-gradient(90deg, #4f46e5 0%, #6366f1 60%, #06b6d4 100%);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.48);
}

[data-theme="dark"] .loyalty-card-platinum,
.mode-dark .loyalty-card-platinum {
  background: linear-gradient(135deg, rgba(30, 26, 68, 0.95) 0%, rgba(20, 22, 52, 0.96) 50%, rgba(15, 23, 42, 0.98) 100%);
  border: 1px solid rgba(99, 102, 241, 0.38);
  box-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.16);
}
[data-theme="dark"] .loyalty-card-platinum .loyalty-title,
.mode-dark .loyalty-card-platinum .loyalty-title { color: #a5b4fc; }
[data-theme="dark"] .loyalty-card-platinum .loyalty-heading,
.mode-dark .loyalty-card-platinum .loyalty-heading { color: #f5f3ff; }
[data-theme="dark"] .loyalty-card-platinum .loyalty-subtext,
.mode-dark .loyalty-card-platinum .loyalty-subtext { color: #c7d2fe; }
[data-theme="dark"] .loyalty-card-platinum .loyalty-muted,
.mode-dark .loyalty-card-platinum .loyalty-muted { color: #cbd5e1; }
[data-theme="dark"] .loyalty-card-platinum .loyalty-icon-box,
.mode-dark .loyalty-card-platinum .loyalty-icon-box {
  background: rgba(99, 102, 241, 0.22);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.48);
}
[data-theme="dark"] .loyalty-card-platinum .loyalty-rate-pill,
.mode-dark .loyalty-card-platinum .loyalty-rate-pill {
  background: rgba(99, 102, 241, 0.22);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.38);
}
[data-theme="dark"] .loyalty-card-platinum .loyalty-progress-track,
.mode-dark .loyalty-card-platinum .loyalty-progress-track {
  background: rgba(255, 255, 255, 0.08);
}

/* --------------------------------------------------------------------------
 * Accessible Tables & Responsive Data Grids
 * -------------------------------------------------------------------------- */
.table-responsive, .table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-default) transparent;
  position: relative;
  background:
    linear-gradient(to right, var(--bg-surface) 30%, rgba(255,255,255,0)),
    linear-gradient(to right, rgba(255,255,255,0), var(--bg-surface) 70%) 0 100%,
    radial-gradient(farthest-side at 0% 50%, rgba(0,0,0,0.1), rgba(0,0,0,0)),
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,0.1), rgba(0,0,0,0)) 0 100%;
  background-repeat: no-repeat;
  background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
  background-position: 0 0, 100% 0, 0 0, 100% 0;
  background-attachment: local, local, scroll, scroll;
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
  background: var(--bg-surface-elevated);
  border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

.table-responsive.has-scroll::after {
  content: 'Swipe horizontally for more details ↔';
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-align: right;
  padding: 6px 12px;
  color: var(--text-tertiary);
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-default);
  letter-spacing: 0.02em;
}

@media (min-width: 1024px) {
  .table-responsive.has-scroll::after {
    display: none !important;
  }
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: var(--text-sm);
  min-width: 600px;
}

@media (min-width: 1024px) {
  .table {
    min-width: 100%;
  }
}

.table th {
  background-color: var(--bg-surface-elevated);
  padding: 12px var(--space-2);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}

.table td {
  padding: 12px var(--space-2);
  border-bottom: 1px solid var(--border-default);
  color: var(--text-primary);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}

.table tbody tr {
  transition: background-color 150ms ease;
}

.table tbody tr:hover {
  background-color: var(--bg-surface-elevated);
}

/* --------------------------------------------------------------------------
 * System Alerts
 * -------------------------------------------------------------------------- */
.alert {
  padding: 12px var(--space-3);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--text-sm);
  border: 1px solid transparent;
  box-shadow: var(--shadow-xs);
}

.alert-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: inherit;
  opacity: 0.65;
  cursor: pointer;
  padding: 0 4px;
  margin-left: auto;
  transition: opacity 150ms ease;
}

.alert-close:hover {
  opacity: 1;
}

.alert-success {
  background-color: var(--success-bg);
  color: var(--success-text);
  border-color: var(--success-border);
}

.alert-danger {
  background-color: var(--danger-bg);
  color: var(--danger-text);
  border-color: var(--danger-border);
}

.alert-warning {
  background-color: var(--warning-bg);
  color: var(--warning-text);
  border-color: var(--warning-border);
}

.alert-info {
  background-color: var(--info-bg);
  color: var(--info-text);
  border-color: var(--info-border);
}

/* --------------------------------------------------------------------------
 * Global Accessible & Responsive Modals
 * -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: var(--space-2);
  overflow-y: auto;
  box-sizing: border-box;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: min(94vw, 580px);
  max-height: 90vh;
  margin: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  animation: modalSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-default);
  gap: var(--space-2);
  flex-shrink: 0;
}

.modal-header h3 {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: var(--transition);
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-4);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-default);
  background: var(--bg-surface-elevated);
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
 * Pagination
 * -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: var(--space-3);
}

.page-link {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}

.page-link:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-elevated);
  border-color: var(--border-strong);
}

.page-link.active {
  background: var(--brand-gradient);
  border-color: var(--primary);
  color: var(--primary-text, #ffffff);
  box-shadow: var(--primary-glow);
}

/* --------------------------------------------------------------------------
 * Landing Page Layout (Responsive, High-Performance)
 * -------------------------------------------------------------------------- */
.landing-nav {
  min-height: 64px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px var(--space-3);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  box-shadow: var(--shadow-xs);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: var(--space-2);
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.landing-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.landing-mobile-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.landing-mobile-toggle:hover {
  background-color: var(--bg-surface-elevated);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav-link {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  text-decoration: none;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background-color: var(--primary-subtle);
}

.hero-section {
  padding: var(--space-6) var(--space-3);
  max-width: 1200px;
  margin: 0 auto;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px var(--space-2);
  border-radius: var(--radius-full);
  background-color: var(--primary-subtle);
  border: 1px solid var(--primary-border);
  color: var(--primary-light);
  font-size: var(--text-xs);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.hero-title {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2.5vw, 1.125rem);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.hero-trust-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 640px) {
  .hero-trust-metrics {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
  }
}

/* Auth Cards */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  background: radial-gradient(circle at 50% 10%, rgba(254, 215, 170, 0.25) 0%, rgba(248, 250, 252, 0) 70%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: clamp(1.25rem, 4vw, 2rem);
  box-shadow: var(--shadow-lg);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-4);
}

.auth-title {
  font-size: var(--text-xl);
  margin-top: var(--space-2);
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
 * Responsive Breakpoints & Adaptive Layouts
 * Mobile (<480px), Phablet (480-640px), Tablet (641-768px), Laptop (769-1024px), Desktop (>1024px)
 * -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .topbar {
    padding: 6px 10px;
    gap: 6px;
  }

  .mobile-toggle {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }

  .user-id-label {
    display: none !important;
  }

  .balance-chip {
    padding: 3px 8px;
    font-size: 11.5px;
    gap: 4px;
  }

  .balance-add-btn {
    width: 20px;
    height: 20px;
    min-width: 20px;
    font-size: 12px;
  }

  .topbar-currency-badge .base-currency-label {
    display: none !important;
  }

  .topbar-hide-xs {
    display: none !important;
  }

  .topbar-currency-switcher select,
  .landing-currency-switcher select {
    padding: 3px 6px;
    font-size: 11px;
    max-width: 78px;
  }

  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .stat-card {
    padding: 10px 10px;
    gap: 8px;
    flex-direction: column;
    align-items: flex-start;
  }

  .stat-icon, .stat-icon-wrapper {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }

  .stat-icon svg, .stat-icon-wrapper svg {
    width: 16px;
    height: 16px;
  }

  .stat-content h4, .stat-details h2 {
    font-size: 10px;
  }

  .stat-content .stat-number, .stat-details .stat-value {
    font-size: 1.15rem;
  }

  .card {
    padding: 14px 12px;
    margin-bottom: 12px;
  }

  .card-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
  }

  .hero-section {
    padding: 24px 12px;
  }

  .hero-title {
    font-size: 1.65rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .auth-card {
    padding: 20px 14px;
    margin: 0 4px;
  }

  /* Stack two-column inputs in forms on mobile */
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr 1fr"],
  div[style*="grid-template-columns: repeat(3, 1fr)"],
  div[style*="grid-template-columns: repeat(4, 1fr)"],
  div[style*="grid-template-columns: 140px 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Table padding on small devices */
  .table th, .table td {
    padding: 8px 6px;
    font-size: 12px;
  }

  .btn {
    padding: 0 var(--space-2);
  }
}

@media (max-width: 640px) {
  .balance-label {
    display: none !important;
  }

  .topbar-hide-sm {
    display: none !important;
  }

  .topbar-currency-switcher select,
  .landing-currency-switcher select {
    padding: 4px 6px;
    font-size: 11px;
    max-width: 85px;
  }

  .landing-actions .nav-btn-signin {
    display: none;
  }

  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }

  .grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  /* Responsive filter bars and bulk import forms */
  .admin-filter-bar,
  form[style*="repeat(auto-fit, minmax(180px, 1fr)) auto"],
  form[style*="repeat(auto-fit, minmax(200px, 1fr)) auto"],
  form[style*="repeat(auto-fit, minmax(220px, 1fr)) auto"],
  form[style*="repeat(auto-fit, minmax(260px, 1fr))"] {
    grid-template-columns: 1fr !important;
  }

  .admin-filter-bar button,
  form[style*="repeat(auto-fit, minmax(180px, 1fr)) auto"] button,
  form[style*="repeat(auto-fit, minmax(200px, 1fr)) auto"] button,
  form[style*="repeat(auto-fit, minmax(220px, 1fr)) auto"] button {
    width: 100% !important;
  }

  /* Stack admin grids with fixed min widths */
  div[style*="minmax(420px, 1fr)"],
  div[style*="minmax(350px, 1fr)"],
  div[style*="minmax(340px, 1fr)"],
  div[style*="minmax(320px, 1fr)"],
  div[style*="minmax(300px, 1fr)"],
  div[style*="minmax(280px, 1fr)"],
  div[style*="minmax(260px, 1fr)"],
  div[style*="2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  .dashboard-vip-progress {
    text-align: left !important;
    width: 100% !important;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px;
  }

  .page-header > div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .page-header > div:last-child .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 767px) {
  .mobile-bottom-nav {
    display: flex;
  }

  .content-wrapper {
    padding: var(--space-3) var(--space-2) calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (min-width: 768px) {
  .mobile-bottom-nav {
    display: none !important;
  }

  .content-wrapper {
    padding: var(--space-4);
  }

  .page-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .hero-section {
    padding: var(--space-8) var(--space-4);
  }

  .hero-actions {
    flex-direction: row;
  }

  .grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .landing-mobile-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-landing-nav);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-default);
    border-top: none;
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    padding: var(--space-3);
    gap: var(--space-1);
    z-index: 99;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
  }

  .nav-links.open {
    display: flex;
    animation: fadeInDown 200ms ease-out forwards;
  }

  .nav-link {
    width: 100%;
    padding: 10px var(--space-2);
    font-size: var(--text-base);
    border-radius: var(--radius-sm);
  }
}

@media (min-width: 1024px) {
  .sidebar {
    transform: translateX(0); /* Static pinned on desktop */
    width: 260px;
  }

  .sidebar-close-btn {
    display: none !important;
  }

  .mobile-bottom-nav {
    display: none !important;
  }

  .main-content {
    margin-left: 260px;
    width: calc(100% - 260px);
  }

  .mobile-toggle {
    display: none !important;
  }

  .desktop-user-email {
    display: inline-block !important;
  }

  .hero-grid {
    grid-template-columns: 1.2fr 1fr;
  }

  .grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
  }

  .landing-nav {
    padding: 0 var(--space-6);
  }
}

@media (min-width: 1280px) {
  .content-wrapper {
    padding: var(--space-5);
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
 * Marketplace Product & Mobile Checkout System (Rule 5 & Rule 3)
 * -------------------------------------------------------------------------- */
.marketplace-product-container {
  max-width: 1200px;
  margin: var(--space-4) auto var(--space-8);
  padding: 0 var(--space-3);
  width: 100%;
  box-sizing: border-box;
}

.marketplace-order-card {
  padding: var(--space-4);
  max-width: 800px;
  margin: 0 auto var(--space-6);
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .marketplace-order-card {
    padding: var(--space-6);
  }
}

@media (min-width: 768px) {
  .marketplace-product-container {
    padding: 0 var(--space-4);
  }
}

.marketplace-breadcrumb {
  margin-bottom: var(--space-3);
}

.marketplace-breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 500;
  text-decoration: none;
  transition: color 150ms ease;
  min-height: 36px;
}

.marketplace-breadcrumb a:hover {
  color: var(--primary);
}

.marketplace-product-grid {
  display: grid;
  grid-template-columns: 100%;
  gap: var(--space-4);
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 992px) {
  .marketplace-product-grid {
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: var(--space-6);
  }
}

.marketplace-product-card {
  padding: var(--space-4);
}

@media (min-width: 640px) {
  .marketplace-product-card {
    padding: var(--space-6);
  }
}

.marketplace-badges-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}

.marketplace-product-title {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 var(--space-3);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

@media (min-width: 640px) {
  .marketplace-product-title {
    font-size: 1.625rem;
  }
}

.marketplace-price-stock-box {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border-bottom: 1px solid var(--border-default);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-4);
}

@media (min-width: 480px) {
  .marketplace-price-stock-box {
    flex-direction: row;
    align-items: center;
    gap: var(--space-5);
  }
}

.marketplace-price-item {
  flex: 1 1 auto;
}

.marketplace-price-label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 2px;
}

.marketplace-price-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.marketplace-stock-item {
  flex: 1 1 auto;
}

@media (min-width: 480px) {
  .marketplace-stock-item {
    border-left: 1px solid var(--border-default);
    padding-left: var(--space-5);
  }
}

.marketplace-stock-label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 2px;
}

.marketplace-stock-value {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
}

.marketplace-section-heading {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.marketplace-description-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.65;
  white-space: pre-line;
  word-break: break-word;
}

.marketplace-guarantee-box {
  background: var(--bg-hover);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-4);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--border-default);
}

.marketplace-guarantee-icon {
  color: var(--primary);
  margin-top: 2px;
  flex-shrink: 0;
}

.marketplace-guarantee-text {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.55;
}

.marketplace-guarantee-title {
  color: var(--text-primary);
  display: block;
  font-weight: 700;
  margin-bottom: 2px;
}

/* Right Column Checkout Card */
.marketplace-checkout-card {
  padding: var(--space-4);
  border: 1px solid var(--border-default);
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  position: static;
  width: 100%;
  box-sizing: border-box;
  transition: box-shadow 250ms ease, border-color 250ms ease;
}

.marketplace-checkout-card.pulse-highlight {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px var(--primary-glow) !important;
}

@media (min-width: 992px) {
  .marketplace-checkout-card {
    padding: var(--space-5);
    position: sticky;
    top: 1.5rem;
  }
}

.marketplace-checkout-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 var(--space-3);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.marketplace-wallet-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}

.marketplace-wallet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.marketplace-wallet-label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: 600;
}

.marketplace-wallet-topup {
  font-size: var(--text-xs);
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

.marketplace-wallet-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 4px;
}

/* Quantity Stepper */
.qty-stepper-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.qty-stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-elevated);
  overflow: hidden;
  height: 44px;
  width: 100%;
  max-width: 180px;
}

.qty-stepper-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.qty-stepper-btn:hover:not(:disabled) {
  background-color: var(--bg-hover);
  color: var(--primary);
}

.qty-stepper-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.qty-stepper-input {
  flex: 1;
  height: 44px;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  padding: 0 4px;
  -moz-appearance: textfield;
}

.qty-stepper-input::-webkit-outer-spin-button,
.qty-stepper-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Ledger Box */
.marketplace-ledger {
  border-top: 1px dashed var(--border-default);
  border-bottom: 1px dashed var(--border-default);
  padding: var(--space-3) 0;
  margin-bottom: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.marketplace-ledger-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.marketplace-ledger-row.total {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}

.marketplace-ledger-val {
  font-weight: 600;
  color: var(--text-primary);
}

.marketplace-ledger-total {
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

/* Submit Button */
.marketplace-btn-buy {
  width: 100%;
  min-height: 48px;
  height: 48px;
  font-weight: 700;
  font-size: var(--text-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-md);
}

/* Floating Mobile Quick Purchase Bar (below 992px) */
.marketplace-mobile-quickbar {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-default);
  padding: 10px var(--space-3) calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 940;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.1);
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 250ms ease, opacity 250ms ease;
}

@media (max-width: 767px) {
  .marketplace-mobile-quickbar.in-user-layout {
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 992px) {
  .marketplace-mobile-quickbar {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
 * Add Funds & Payment Gateway Layout (Mobile-First)
 * -------------------------------------------------------------------------- */
.add-funds-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  align-items: start;
}

@media (min-width: 1024px) {
  .add-funds-layout {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.payment-method-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: var(--space-4);
}

.payment-method-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 52px;
}

.payment-method-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface-elevated);
}

.payment-method-card.is-selected {
  border-color: var(--primary);
  background: var(--primary-subtle);
  box-shadow: 0 0 0 1px var(--primary);
}

.payment-method-radio {
  margin-top: 4px;
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}

.payment-method-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  transition: var(--transition);
}

.payment-method-card.is-selected .payment-method-icon {
  background: var(--primary-subtle);
  color: var(--primary);
}

.payment-method-body {
  flex: 1;
  min-width: 0;
}

.payment-method-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.payment-method-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.35;
}

.payment-method-desc {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 6px;
}

.payment-method-limits {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-light);
  background: var(--primary-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
}

/* Quick deposit presets chips */
.quick-amount-section {
  margin-top: 10px;
  margin-bottom: 16px;
}

.quick-amount-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  display: block;
}

.quick-amount-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-chip {
  appearance: none;
  flex: 1 1 calc(33.333% - 8px);
  min-height: 40px;
  padding: 8px 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  white-space: nowrap;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 480px) {
  .quick-chip {
    flex: 1 1 calc(16.666% - 8px);
  }
}

.quick-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-subtle);
}

.quick-chip.is-active {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
}

/* Input Prefix Wrapper */
.input-prefix-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-weight: 700;
  font-size: var(--text-base);
  pointer-events: none;
  z-index: 2;
}

.input-prefix-wrapper .form-control {
  padding-left: 36px !important;
  height: 48px;
  font-size: 16px;
  border-radius: var(--radius-md);
}

/* Bank Account Card */
.bank-transfer-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}

.bank-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-default);
}

.bank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
}

.bank-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.bank-row-label {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 500;
}

.bank-row-val {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
}

.bank-account-num-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bank-account-num {
  font-family: monospace;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-light);
  letter-spacing: 0.05em;
}

.bank-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-subtle);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 38px;
  transition: var(--transition);
}

.bank-copy-btn:hover {
  background: var(--primary);
  color: #ffffff;
}

/* Transactions Responsive Dual-View */
.desktop-tx-table {
  display: block;
}

.mobile-tx-list {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: var(--space-2);
}

.mobile-tx-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--transition);
}

.mobile-tx-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}

.mobile-tx-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mobile-tx-id {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

.mobile-tx-amount-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.mobile-tx-amount {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--text-primary);
}

.mobile-tx-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-tertiary);
}

.mobile-tx-ref {
  font-family: monospace;
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-surface-elevated);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-tx-verify-btn {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 639px) {
  .desktop-tx-table {
    display: none !important;
  }
  .mobile-tx-list {
    display: flex !important;
  }
}

/* Toast container responsiveness */
#toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  max-width: calc(100vw - 32px);
  width: 380px;
  z-index: 99999;
  pointer-events: none;
}

@media (max-width: 480px) {
  #toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: 100%;
  }
}

.toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlideIn 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-12px) scale(0.96); }
}

/* --------------------------------------------------------------------------
 * Landing Page Mobile Responsiveness Refinements
 * -------------------------------------------------------------------------- */
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.landing-brand {
  min-width: 0;
  flex-shrink: 1;
}

.brand-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
  font-size: 1.125rem;
}

@media (max-width: 480px) {
  .landing-nav {
    padding: 8px 12px !important;
    min-height: 56px !important;
  }
  .brand-title {
    max-width: 130px;
    font-size: 0.95rem;
  }
  .landing-actions {
    gap: 6px;
  }
  .landing-actions .nav-btn-signup,
  .landing-actions .nav-btn-signin {
    display: none !important;
  }
  .landing-currency-switcher form {
    margin: 0 !important;
  }
  .landing-currency-switcher select {
    max-width: 86px !important;
    font-size: 11px !important;
    padding: 5px 20px 5px 8px !important;
    min-height: 36px !important;
    line-height: 1.2 !important;
  }
  .landing-currency-switcher div:last-child {
    right: 5px !important;
  }
  .landing-mobile-toggle {
    width: 36px !important;
    height: 36px !important;
    flex-shrink: 0;
  }
}

@media (max-width: 360px) {
  .brand-title {
    max-width: 105px !important;
    font-size: 0.875rem !important;
  }
  .landing-currency-switcher select {
    max-width: 76px !important;
    padding: 4px 18px 4px 6px !important;
    font-size: 10.5px !important;
  }
}

@media (max-width: 400px) {
  .user-id-label,
  .base-currency-label {
    display: none !important;
  }

  .balance-chip {
    padding: 4px 8px !important;
    font-size: 11px !important;
  }

  .balance-add-btn {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    font-size: 12px !important;
  }

  .topbar {
    padding: 6px 8px !important;
  }

  .topbar-currency-switcher select {
    max-width: 78px !important;
    font-size: 10px !important;
    padding: 3px 5px !important;
  }
}

@media (max-width: 640px) {
  .landing-actions .nav-btn-signin {
    display: none !important;
  }
}

.mobile-nav-auth {
  display: none;
}

@media (max-width: 900px) {
  .mobile-nav-auth {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 14px;
    margin-top: 10px;
    border-top: 1px solid var(--border-default);
  }
  .mobile-nav-auth .btn {
    width: 100%;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .nav-links {
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Hero Section Responsiveness */
.hero-section {
  width: 100%;
  overflow-x: hidden;
}

.hero-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

@media (max-width: 639px) {
  .hero-section {
    padding: var(--space-5) var(--space-2) !important;
  }
  .hero-title {
    font-size: clamp(1.5rem, 6.5vw, 2.1rem) !important;
    line-height: 1.2 !important;
    word-break: break-word;
  }
  .hero-subtitle {
    font-size: var(--text-sm) !important;
    margin-bottom: var(--space-3) !important;
  }
  .hero-actions {
    flex-direction: column !important;
    width: 100% !important;
    gap: 10px !important;
  }
  .hero-actions .btn {
    width: 100% !important;
    min-height: 48px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: var(--text-sm) !important;
  }
  .hero-trust-metrics {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-top: var(--space-4) !important;
    padding-top: var(--space-3) !important;
  }
}

/* Trust metric cards */
.metric-pill {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.metric-number {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.metric-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 3px;
  line-height: 1.25;
}

/* Hero inspector sample items on mobile */
.hero-grid > div {
  min-width: 0 !important;
  max-width: 100% !important;
}

.sample-market-item,
.sample-service-item {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-width: 0 !important;
  max-width: 100% !important;
  transition: var(--transition);
}

.sample-market-item:hover,
.sample-service-item:hover {
  border-color: var(--border-strong);
}

.sample-market-item > div:first-child,
.sample-service-item > div:first-child {
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

@media (max-width: 480px) {
  .sample-market-item,
  .sample-service-item {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 10px 12px !important;
  }
  .sample-market-item > div:first-child,
  .sample-service-item > div:first-child {
    width: 100% !important;
    min-width: 0 !important;
  }
  .sample-market-item > div:last-child,
  .sample-service-item > div:last-child {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-top: 1px dashed var(--border-default) !important;
    padding-top: 8px !important;
    margin-top: 2px !important;
    width: 100% !important;
  }
  .sample-market-item .btn,
  .sample-service-item .btn {
    min-height: 34px !important;
    padding: 4px 12px !important;
    font-size: 0.75rem !important;
    margin-top: 0 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
}

/* Technical Architecture / Features Grid */
.landing-features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  width: 100%;
}

@media (min-width: 640px) {
  .landing-features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }
}

@media (min-width: 1024px) {
  .landing-features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Featured Products Grid */
.landing-products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  width: 100%;
}

@media (min-width: 500px) {
  .landing-products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .landing-products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .landing-products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.landing-product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.landing-product-card:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
 * Floating Support Widgets & Admin Copilot System (Universal Responsive)
 * -------------------------------------------------------------------------- */
.floating-support-widget {
  position: fixed;
  bottom: 24px;
  z-index: 9998;
  display: flex;
  align-items: center;
  transition: bottom 220ms ease, right 220ms ease, transform 180ms ease;
}

.floating-wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: #25D366;
  color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.45);
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 180ms ease;
  text-decoration: none;
}

.floating-wa-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.6);
}

.floating-ai-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--brand-gradient);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 180ms ease;
}

.floating-ai-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
}

.floating-chat-window {
  display: none;
  position: absolute;
  bottom: 68px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 100px);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  flex-direction: column;
  overflow: hidden;
  z-index: 10000;
  animation: modalSlideIn 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Admin Copilot Widget */
.admin-copilot-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9995;
  transition: bottom 220ms ease, right 220ms ease;
}

.admin-copilot-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  background: var(--brand-gradient);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 180ms ease;
}

.admin-copilot-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.36);
}

.admin-copilot-drawer {
  display: none;
  position: absolute;
  bottom: 58px;
  right: 0;
  width: 440px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 90px);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideIn 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Responsive Adaptive Mobile Behavior (<768px with .mobile-bottom-nav) */
@media (max-width: 767px) {
  body:has(.mobile-bottom-nav) .floating-support-widget,
  body:has(.mobile-bottom-nav) #wa_floating_widget,
  body:has(.mobile-bottom-nav) #ai_support_widget_container,
  .app-container ~ #wa_floating_widget,
  .app-container ~ #ai_support_widget_container {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .floating-wa-btn,
  #wa_floating_widget a {
    width: 48px !important;
    height: 48px !important;
  }
  .floating-wa-btn svg,
  #wa_floating_widget a svg {
    width: 26px !important;
    height: 26px !important;
  }

  .floating-ai-btn,
  #ai_support_launch_btn {
    width: 48px !important;
    height: 48px !important;
  }
  .floating-ai-btn svg,
  #ai_support_launch_btn svg {
    width: 24px !important;
    height: 24px !important;
  }

  #wa_floating_widget,
  .floating-support-wa {
    right: 14px !important;
  }

  #ai_support_widget_container,
  .floating-support-ai {
    right: 14px !important;
  }

  body:has(#wa_floating_widget) #ai_support_widget_container,
  body:has(.floating-support-wa) .floating-support-ai {
    right: 70px !important;
  }

  .floating-chat-window,
  #ai_support_window {
    position: fixed !important;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: calc(100vw - 20px) !important;
    height: min(480px, calc(100vh - 150px)) !important;
    border-radius: var(--radius-lg) !important;
    z-index: 10001 !important;
  }

  .admin-copilot-container,
  #admin_copilot_container {
    bottom: 16px !important;
    right: 14px !important;
  }

  .admin-copilot-btn,
  #copilot_launch_btn {
    padding: 8px 14px !important;
    font-size: 0.8125rem !important;
  }

  .admin-copilot-drawer,
  #copilot_drawer {
    position: fixed !important;
    bottom: 70px !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: calc(100vw - 20px) !important;
    height: min(520px, calc(100vh - 100px)) !important;
    border-radius: var(--radius-lg) !important;
    z-index: 10001 !important;
  }

  /* Backward compatibility fallback */
  .bp-fab {
    width: 44px !important;
    height: 44px !important;
    right: 14px !important;
  }
  #bp-wa { bottom: 74px !important; }
  #bp-ai { bottom: 126px !important; }
}

/* Why Choose Us Grid */
.why-choose-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  width: 100%;
}

@media (min-width: 600px) {
  .why-choose-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }
}

@media (min-width: 1024px) {
  .why-choose-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
  }
}

.why-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: clamp(16px, 3vw, 24px);
  display: flex;
  flex-direction: column;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.why-card:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.why-icon-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--primary-subtle);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-2);
  flex-shrink: 0;
}

/* 3-Step Flow Grid */
.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  width: 100%;
}

@media (min-width: 720px) {
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
  }
}

.step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: clamp(18px, 3vw, 24px);
  position: relative;
  display: flex;
  flex-direction: column;
  transition: border-color 180ms ease;
}

.step-card:hover {
  border-color: var(--primary-border);
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
}

/* FAQ Interactive Accordion */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.faq-item.active {
  border-color: var(--primary-border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.faq-trigger {
  width: 100%;
  padding: 16px 18px;
  background: none;
  border: none;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  min-height: 48px;
  transition: color 150ms ease;
}

.faq-trigger:hover {
  color: var(--primary);
}

.faq-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-tertiary);
  transition: transform 200ms ease;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-content {
  display: none;
  padding: 0 18px 18px;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.65;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.faq-item.active .faq-content {
  display: block;
  animation: fadeInDown 200ms ease-out;
}

/* Call to Action Banner */
.landing-cta-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 5vw, 48px) clamp(16px, 4vw, 36px);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.landing-cta-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-hover));
}

/* Accessible Footer Grid */
.landing-footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  width: 100%;
}

@media (min-width: 540px) {
  .landing-footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .landing-footer-grid {
    grid-template-columns: 1.6fr 1fr 1fr 1.4fr;
  }
}

.newsletter-form {
  display: flex;
  gap: 8px;
  width: 100%;
}

@media (max-width: 400px) {
  .newsletter-form {
    flex-direction: column;
  }
  .newsletter-form .btn {
    width: 100%;
    min-height: 44px;
  }
}

/* =============================================================================
   ADMIN & PLATFORM RESPONSIVE COMPONENT SYSTEM
   ============================================================================= */

/* Responsive Administrative & User Filter Bars */
.admin-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) auto;
  gap: 1rem;
  align-items: end;
}

/* Digital Marketplace Product Responsive Grid */
.marketplace-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  width: 100%;
}

@media (max-width: 1200px) {
  .marketplace-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .marketplace-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }
}

@media (max-width: 560px) {
  .marketplace-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
}

/* Integrations & Service Providers Grid */
.integrations-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
  width: 100%;
}

@media (max-width: 768px) {
  .integrations-cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Two-column administrative layout: table on left, form on right.
   Stacks to 1 column on screens below 1100px so tables and forms never get squished */
.admin-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 1100px) {
  .admin-two-col {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.admin-two-col-equal {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 1100px) {
  .admin-two-col-equal {
    grid-template-columns: 1fr 1fr;
  }
}

/* Responsive Table Card */
.admin-table-card {
  padding: 0 !important;
  overflow: hidden;
}

.admin-table-card .table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table-card table {
  min-width: 520px;
}

@media (max-width: 768px) {
  .admin-table-card .card-header {
    padding: 1rem 1.25rem 0.75rem !important;
  }
}

/* Horizontal Scrolling Sub-Navigation for Admin (e.g. Settings nav tabs) */
.admin-subnav-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  margin-bottom: 1.5rem;
  scrollbar-width: thin;
}

.admin-subnav-scroll::-webkit-scrollbar {
  height: 4px;
}

.admin-subnav-scroll::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 4px;
}

/* Responsive Setting Grids */
.settings-grid-2col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .settings-grid-2col {
    grid-template-columns: 1fr 1fr;
  }
}

.settings-grid-3col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .settings-grid-3col {
    grid-template-columns: 140px 1fr 1fr;
  }
}

.settings-grid-4col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 540px) {
  .settings-grid-4col {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 860px) {
  .settings-grid-4col {
    grid-template-columns: 180px 180px 1fr 1fr;
  }
}

.settings-terms-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 820px) {
  .settings-terms-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* --------------------------------------------------------------------------
 * Admin Settings page responsive hardening (/admin/settings)
 * -------------------------------------------------------------------------- */
.admin-subnav-scroll .btn {
  flex-shrink: 0;
  scroll-snap-align: start;
}
.admin-subnav-scroll {
  scroll-snap-type: x proximity;
  margin-left: calc(-1 * var(--space-2));
  margin-right: calc(-1 * var(--space-2));
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}

#platform-modules,
#branding-identity,
#currency-engine,
#security-safeguards,
#admin-2fa,
#payment-gateways,
#affiliate-childpanels,
#terms-policies,
#theme-appearance {
  scroll-margin-top: 76px;
}

#platform-modules {
  padding: clamp(1rem, 3vw, 1.5rem);
  min-width: 0;
}

/* Theme preset cards: keep 2 cols on phones, slim padding, no overflow */
@media (max-width: 480px) {
  .theme-color-card,
  .theme-mode-card {
    min-width: 0;
    padding: 0.75rem 0.5rem !important;
  }
  #theme_preview_box {
    padding: 0.75rem !important;
  }
  #theme_preview_box .btn {
    flex: 1 1 140px;
  }
}

/* 2FA recovery codes: 2 cols desktop, 1 col on tiny phones */
@media (max-width: 420px) {
  #adminSetup2faRecoveryList,
  #setup2faRecoveryList {
    grid-template-columns: 1fr !important;
  }
}

/* Settings 2FA modals use inline styles (not .modal-*), make them sheet-like */
@media (max-width: 540px) {
  #modalAdmin2faSetup,
  #modalAdmin2faDisable {
    padding: 0.5rem !important;
    align-items: flex-end !important;
  }
  #modalAdmin2faSetup > div,
  #modalAdmin2faDisable > div {
    max-width: 100% !important;
    width: 100% !important;
    padding: 1rem !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    max-height: 92vh !important;
  }
  #adminSetup2faQrImg {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Long redirect URI / secret strings must wrap, never force x-scroll */
#adminSetup2faSecretText,
code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Action button groupings inside tables */
.table-action-group {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: nowrap;
}

@media (max-width: 768px) {
  .table-action-group {
    flex-wrap: wrap;
    gap: 6px;
  }
}

/* --------------------------------------------------------------------------
 * Global Responsive Polish & Touch-Target Architecture
 * -------------------------------------------------------------------------- */
@media (pointer: coarse), (max-width: 768px) {
  .btn, .form-control, .form-select, .mobile-nav-item, .pagination-item {
    min-height: 44px;
  }
  .btn-sm {
    min-height: 44px;
  }
  .mobile-toggle,
  .landing-mobile-toggle,
  .sidebar-close-btn,
  .modal-close {
    min-width: 44px;
    min-height: 44px;
  }
  .alert-close {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .page-link {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Responsive media + overflow safety */
img, video, canvas, svg {
  max-width: 100%;
}
pre, code {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.card, .stat-card, .page-header, .content-wrapper {
  min-width: 0;
}

/* Horizontal Overflow Protection */
@media (max-width: 640px) {
  .card, .stat-card, .table-responsive, .page-header, .app-container, .main-content {
    max-width: 100vw;
  }
  .grid-cols-2, .admin-two-col, .admin-two-col-equal {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  .settings-grid-3col, .settings-grid-4col, .settings-terms-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Card Micro-Polish & Hover Elevation */
.card-interactive {
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 180ms ease, border-color 180ms ease;
}

.card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}

/* Touch-Friendly Horizontal Filter Pills */
.status-filter-pills, .filter-pills-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.status-filter-pills::-webkit-scrollbar,
.filter-pills-scroll::-webkit-scrollbar {
  display: none;
}

/* Flexible Form 2-Column Row */
.form-row-2col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .form-row-2col {
    grid-template-columns: 1fr 1fr;
  }
}

/* Responsive Quick Amount Preset Chips */
.quick-amount-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  gap: 8px;
}

@media (max-width: 480px) {
  .quick-amount-chips {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 360px) {
  .quick-amount-chips {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* iOS Safari Auto-Zoom Prevention on Touch Devices */
@media (max-width: 768px) {
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Universal Mobile Grid Clamping for Inline and Component Grids (< 560px) */
@media (max-width: 560px) {
  div[style*="minmax(240px, 1fr)"],
  div[style*="minmax(220px, 1fr)"],
  div[style*="minmax(200px, 1fr)"],
  div[style*="minmax(180px, 1fr)"],
  div[style*="minmax(160px, 1fr)"],
  div[style*="minmax(min(100%, 280px), 1fr)"],
  div[style*="minmax(min(100%, 260px), 1fr)"],
  section[style*="minmax("],
  #dripfeed_inputs,
  #setup2faRecoveryList {
    grid-template-columns: 1fr !important;
  }
}

/* Mobile-Optimized Bottom Sheet Modals (< 540px) */
@media (max-width: 540px) {
  .modal-overlay {
    padding: var(--space-1);
    align-items: flex-end;
  }
  .modal-content {
    max-width: 100vw;
    width: 100%;
    max-height: 85vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
  .modal-header {
    padding: 12px 16px;
  }
  .modal-body {
    padding: 14px 16px;
  }
  .modal-footer {
    padding: 12px 16px;
    flex-direction: column-reverse;
  }
  .modal-footer .btn {
    width: 100%;
  }
}

/* Mobile Topbar Compact Fit (< 480px) */
@media (max-width: 480px) {
  .topbar {
    padding: 6px 8px;
    gap: 4px;
    flex-wrap: wrap;
  }
  .topbar-left,
  .topbar-right {
    min-width: 0;
  }
  .topbar-right {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex: 1 1 auto;
  }
  .topbar-currency-switcher,
  .landing-currency-switcher {
    min-width: 0;
    flex-shrink: 1;
  }
  .topbar-currency-switcher select {
    max-width: 92px;
    padding: 2px 4px;
    font-size: 10.5px;
  }
  .balance-chip {
    padding: 4px 8px;
    font-size: 11px;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
  }
  .balance-chip strong {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 18vw;
  }
  .balance-add-btn {
    width: 24px;
    height: 24px;
    min-width: 24px;
    font-size: 12px;
    flex-shrink: 0;
  }
  .user-badge {
    flex-shrink: 0;
  }
  .user-avatar-circle {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 11px;
  }
}

/* Ultra-small devices (< 360px): single-column stats, full-width actions */
@media (max-width: 360px) {
  .grid-cols-4 {
    grid-template-columns: 1fr !important;
  }
  .stat-card {
    flex-direction: row;
    align-items: center;
  }
  .stat-content .stat-number,
  .stat-details .stat-value {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
    font-size: 1.05rem;
  }
  .topbar-right {
    width: 100%;
    justify-content: flex-start;
  }
  .page-header > div:last-child .btn {
    flex: 1 1 100%;
  }
  .quick-amount-chips {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Responsive Pagination Wrapping */
@media (max-width: 640px) {
  .pagination {
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
  }
  .page-link {
    min-width: 38px;
    height: 38px;
  }
}
