/* ==========================================================================
   CUSeller Premium Styling System - Vanilla CSS
   ========================================================================== */

/* Design System Tokens */
:root {
  color-scheme: light dark;
  --font-family-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-family-title: 'Outfit', sans-serif;
  
  /* Default Color Palette - Dark Mode HSL Custom Curated */
  --bg-primary: hsl(215, 33%, 7%);       /* #0b111e (Deep Amazon Slate) */
  --bg-secondary: hsl(215, 28%, 11%);    /* #141b29 (Sleek Slate Blue) */
  --bg-surface: hsl(215, 28%, 11%);      /* #141b29 (Sleek Slate Blue) */
  --bg-card: hsl(215, 28%, 11%);
  --bg-glass: rgba(20, 27, 41, 0.5);
  --bg-glass-hover: rgba(20, 27, 41, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-active: rgba(255, 98, 1, 0.4);
  
  --text-primary: hsl(210, 40%, 98%);     /* #F8FAFC */
  --text-secondary: hsl(215, 25%, 72%);   /* #94A3B8 */
  --text-muted: hsl(215, 16%, 47%);       /* #64748B */
  
  --color-indigo: hsl(23, 100%, 50%);     /* #FF6201 (Amazon Vibrant Orange) */
  --color-indigo-glow: rgba(255, 98, 1, 0.15);
  --color-emerald: rgb(16, 185, 129);     /* #10B981 */
  --color-emerald-glow: rgba(16, 185, 129, 0.15);
  --color-amber: hsl(36, 100%, 48%);       /* #F59E0B (Amazon Warm Gold) */
  --color-rose: hsl(0, 84%, 60%);         /* #EF4444 */
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.7);
  --border-radius-sm: 8px;
  --border-radius-md: 14px;
  --border-radius-lg: 24px;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

/* System Default prefers-color-scheme: light overrides */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: only light;
    --bg-primary: hsl(210, 40%, 96%);       /* Warm Light Gray-Blue */
    --bg-secondary: hsl(0, 0%, 100%);      /* Pure White */
    --bg-surface: hsl(0, 0%, 100%);        /* Pure White */
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-glass-hover: rgba(255, 255, 255, 0.85);
    --border-color: rgba(15, 23, 42, 0.08);
    --border-color-active: rgba(255, 98, 1, 0.6);
    --text-primary: hsl(215, 28%, 15%);
    --text-secondary: hsl(215, 20%, 40%);
    --text-muted: hsl(215, 16%, 60%);
    --color-indigo-glow: rgba(255, 98, 1, 0.1);
    --color-emerald-glow: rgba(16, 185, 129, 0.1);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 8px 30px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: only dark;
  }
}

/* Explicit class override for Light Theme */
.light-theme {
  color-scheme: only light !important;
}
body.light-theme {
  --bg-primary: hsl(210, 40%, 96%);
  --bg-secondary: hsl(0, 0%, 100%);
  --bg-surface: hsl(0, 0%, 100%);
  --bg-card: hsl(0, 0%, 100%);
  --bg-glass: rgba(255, 255, 255, 0.7);
  --bg-glass-hover: rgba(255, 255, 255, 0.85);
  --border-color: rgba(15, 23, 42, 0.08);
  --border-color-active: rgba(255, 98, 1, 0.6);
  --text-primary: hsl(215, 28%, 15%);
  --text-secondary: hsl(215, 20%, 40%);
  --text-muted: hsl(215, 16%, 60%);
  --color-indigo-glow: rgba(255, 98, 1, 0.1);
  --color-emerald-glow: rgba(16, 185, 129, 0.1);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
}

/* Explicit class override for Dark Theme */
.dark-theme {
  color-scheme: only dark !important;
}
body.dark-theme {
  --bg-primary: hsl(215, 33%, 7%);
  --bg-secondary: hsl(215, 28%, 11%);
  --bg-surface: hsl(215, 28%, 11%);
  --bg-card: hsl(215, 28%, 11%);
  --bg-glass: rgba(20, 27, 41, 0.5);
  --bg-glass-hover: rgba(20, 27, 41, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-active: rgba(255, 98, 1, 0.4);
  --text-primary: hsl(210, 40%, 98%);
  --text-secondary: hsl(215, 25%, 72%);
  --text-muted: hsl(215, 16%, 47%);
  --color-indigo-glow: rgba(255, 98, 1, 0.15);
  --color-emerald-glow: rgba(16, 185, 129, 0.15);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.7);
}

/* Helper rules for inline styles in Light Mode */
body.light-theme [style*="color: #ffffff"], 
body.light-theme [style*="color:#ffffff"], 
body.light-theme [style*="color: white"], 
body.light-theme [style*="color:white"],
body.light-theme [style*="color: rgb(255, 255, 255)"],
body.light-theme [style*="color:rgb(255, 255, 255)"],
body.amazon-theme [style*="color: #ffffff"], 
body.amazon-theme [style*="color:#ffffff"], 
body.amazon-theme [style*="color: white"], 
body.amazon-theme [style*="color:white"],
body.amazon-theme [style*="color: rgb(255, 255, 255)"],
body.amazon-theme [style*="color:rgb(255, 255, 255)"] { 
  color: var(--text-primary) !important; 
}

body.light-theme input, 
body.light-theme select,
body.light-theme textarea,
body.light-theme .form-control {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

body.light-theme .form-control option {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

body.light-theme .logo-text {
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary)) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

body.light-theme [style*="background: linear-gradient(135deg, #ffffff, #94a3b8)"],
body.light-theme [style*="background: linear-gradient(135deg, #ffffff, #94a3b8);"],
body.amazon-theme [style*="background: linear-gradient(135deg, #ffffff, #94a3b8)"],
body.amazon-theme [style*="background: linear-gradient(135deg, #ffffff, #94a3b8);"] {
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary)) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

body.light-theme .modal-card,
body.light-theme .help-card,
body.light-theme .settings-card,
body.light-theme .manual-layout,
body.light-theme .glass {
  background: rgba(255, 255, 255, 0.7) !important;
}

body.light-theme .welcome-hero {
  background: radial-gradient(circle at top right, rgba(255, 98, 1, 0.05), transparent 60%) !important;
}

/* System prefers-color-scheme light adaptations (when class is system default) */
@media (prefers-color-scheme: light) {
  body:not(.dark-theme) [style*="color: #ffffff"], 
  body:not(.dark-theme) [style*="color:#ffffff"], 
  body:not(.dark-theme) [style*="color: white"], 
  body:not(.dark-theme) [style*="color:white"],
  body:not(.dark-theme) [style*="color: rgb(255, 255, 255)"],
  body:not(.dark-theme) [style*="color:rgb(255, 255, 255)"] { 
    color: var(--text-primary) !important; 
  }
  
  body:not(.dark-theme) input, 
  body:not(.dark-theme) select,
  body:not(.dark-theme) textarea,
  body:not(.dark-theme) .form-control {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
  }

  body:not(.dark-theme) .form-control option {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
  }
  
  body:not(.dark-theme) .logo-text {
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary)) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
  }
  
  body:not(.dark-theme) [style*="background: linear-gradient(135deg, #ffffff, #94a3b8)"],
  body:not(.dark-theme) [style*="background: linear-gradient(135deg, #ffffff, #94a3b8);"] {
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary)) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
  }
  
  body:not(.dark-theme) .modal-card,
  body:not(.dark-theme) .help-card,
  body:not(.dark-theme) .settings-card,
  body:not(.dark-theme) .manual-layout,
  body:not(.dark-theme) .glass {
    background: rgba(255, 255, 255, 0.7) !important;
  }
  
  body:not(.dark-theme) .welcome-hero {
    background: radial-gradient(circle at top right, rgba(255, 98, 1, 0.05), transparent 60%) !important;
  }
}

/* Global Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100vh;
  overflow: hidden;
}

body {
  font-family: var(--font-family-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-title);
  font-weight: 600;
  letter-spacing: -0.02em;
}

a {
  color: var(--color-indigo);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  filter: brightness(1.2);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: hsl(215, 15%, 25%);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-indigo);
}

/* Utilities */
.text-green { color: var(--color-emerald) !important; }
.text-red { color: var(--color-rose) !important; }
.text-yellow { color: var(--color-amber) !important; }
.text-center { text-align: center; }
.font-mono { font-family: 'Courier New', Courier, monospace; }
.w-full { width: 100%; }

/* Glassmorphism Styles */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-md);
  transition: var(--transition-smooth);
}

.glass:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* App Container Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: 280px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 10;
  overflow: hidden;
}

.sidebar-header {
  margin-bottom: 35px;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.logo-icon {
  font-size: 24px;
  color: var(--color-indigo);
  background: linear-gradient(135deg, var(--color-indigo), #06B6D4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text {
  font-family: var(--font-family-title);
  font-weight: 800;
  font-size: 22px;
  background: linear-gradient(135deg, #ffffff, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text span {
  color: var(--color-indigo);
  -webkit-text-fill-color: var(--color-indigo);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  text-transform: uppercase;
}

.badge-remote {
  background-color: rgba(99, 102, 241, 0.12);
  color: var(--color-indigo);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.sidebar-nav {
  flex-grow: 1;
  overflow-y: auto;
  margin-bottom: 15px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.sidebar-nav ul {
  list-style: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  color: var(--text-secondary);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  margin-bottom: 8px;
  font-weight: 500;
  transition: var(--transition-fast);
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.nav-item.active {
  background-color: var(--color-indigo-glow);
  color: var(--text-primary);
  border-left: 3px solid var(--color-indigo);
  font-weight: 600;
}

.nav-item i {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

.inventory-count-badge {
  margin-left: auto;
  background-color: var(--color-indigo);
  color: #ffffff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  flex-shrink: 0;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: var(--border-radius-sm);
  font-size: 12px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.connection-status.online .status-indicator {
  background-color: var(--color-emerald);
  box-shadow: 0 0 8px var(--color-emerald);
}

.connection-status.offline .status-indicator {
  background-color: var(--color-rose);
  box-shadow: 0 0 8px var(--color-rose);
}

.operator-profile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
  margin-top: 10px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-indigo), #3B82F6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
}

.operator-info {
  display: flex;
  flex-direction: column;
}

.operator-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.operator-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* Main Content Area */
.main-content {
  position: relative;
  flex-grow: 1;
  padding: 40px;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Pull to Refresh Indicator */
.pull-to-refresh {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 42px;
  height: 42px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  transition: transform 0.1s ease, top 0.1s ease, opacity 0.1s ease;
  opacity: 0;
  pointer-events: none;
}

.pull-to-refresh .pull-icon {
  color: var(--color-indigo);
  font-size: 16px;
  transition: transform 0.1s ease;
}

.pull-to-refresh.refreshing .pull-icon {
  animation: spinPull 1s linear infinite !important;
}

@keyframes spinPull {
  100% {
    transform: rotate(360deg);
  }
}


/* Content Header */
.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
}

.header-title-area h1 {
  font-size: 32px;
  font-weight: 700;
}

.header-title-area p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.metric-mini {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.metric-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.metric-value {
  font-size: 18px;
  font-weight: 700;
}

/* Tab Management */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-family-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-indigo), #4f46e5);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

.btn-success {
  background: linear-gradient(135deg, var(--color-emerald), #059669);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Forms styling */
.form-control {
  width: 100%;
  padding: 10px 14px;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family-sans);
  font-size: 14px;
  transition: var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-indigo);
  box-shadow: 0 0 0 2px var(--color-indigo-glow);
}

.form-control-sm {
  width: 100%;
  padding: 6px 10px;
  background-color: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family-sans);
  font-size: 13px;
}

.form-control-sm:focus {
  outline: none;
  border-color: var(--color-indigo);
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

/* Range Slider */
.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  margin: 10px 0;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-indigo);
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 0 8px var(--color-indigo);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.range-hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* Sourcing Hub Layout */
.sourcing-layout {
  display: grid;
  grid-template-columns: 280px 1fr 330px;
  gap: 20px;
  align-items: start;
}

.filters-panel {
  padding: 24px;
  position: sticky;
  top: 110px;
}

.filters-panel h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.filter-group {
  margin-bottom: 25px;
}

.filter-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.value-display {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-indigo);
}

.checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
  margin-top: 4px;
  accent-color: var(--color-indigo);
}

.checkbox-wrapper label {
  font-size: 13px;
  color: var(--text-primary);
  text-transform: none;
  cursor: pointer;
}

.checkbox-wrapper label strong {
  display: block;
  font-weight: 600;
}

.checkbox-wrapper label span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.filter-stats {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
}

/* Sourcing Grid & Search Row */
.grid-area {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sourcing-subtabs {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  width: 100%;
}

.search-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  width: 100%;
}

.sort-selector {
  margin-left: 10px;
}

.search-input-wrapper {
  position: relative;
  flex-grow: 1;
}

.search-input-wrapper i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input-wrapper input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  background-color: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  transition: var(--transition-fast);
}

.search-input-wrapper input:focus {
  outline: none;
  border-color: var(--color-indigo);
  background-color: rgba(30, 41, 59, 0.6);
}

.sort-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-selector label {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Product Cards Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-color-active);
  box-shadow: var(--shadow-lg);
}

.product-card-image {
  position: relative;
  height: 180px;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.2);
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image-wrapper {
  position: relative;
  height: 180px;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.product-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
}

.product-category-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(4px);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.product-roi-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: var(--color-emerald);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
}

.product-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
}

.product-card-content h4 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  min-height: 42px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-specs {
  display: flex;
  gap: 15px;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.product-spec-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.product-financials-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price-item {
  display: flex;
  flex-direction: column;
}

.price-item span {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.price-item strong {
  font-size: 15px;
  color: var(--text-primary);
}

.profit-item {
  text-align: right;
}

.profit-item strong {
  font-size: 18px;
  color: var(--color-emerald);
  display: block;
}

/* Modals System */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  width: 90%;
  max-width: 850px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--border-radius-lg);
  padding: 30px;
  position: relative;
  transform: scale(0.95);
  transition: var(--transition-smooth);
}

.modal-card-sm {
  max-width: 550px;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 22px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: var(--color-rose);
}

/* Detail Modal Inner Layout */
.modal-prod-details {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 30px;
}

.modal-image-col {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal-image-col img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
}

.product-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge-sec {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.badge-sec.active {
  background-color: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--color-emerald);
}

.modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-calc-col h3 {
  font-size: 18px;
  margin-bottom: 15px;
}

.calc-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 15px;
}

.form-group-sm label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.pricing-breakdown-box {
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 15px;
  margin-bottom: 15px;
}

.pricing-breakdown-box h4 {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}

.price-row.highlight {
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.price-row hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 8px 0;
}

.profit-row {
  font-size: 15px;
}

.roi-row {
  font-size: 12px;
  color: var(--text-muted);
}

.pricing-summary-box {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 15px;
  background-color: var(--color-indigo-glow);
  border: 1px solid var(--border-color-active);
  padding: 12px 15px;
  border-radius: var(--border-radius-sm);
}

.summary-stat {
  display: flex;
  flex-direction: column;
}

.summary-stat span {
  font-size: 11px;
  color: var(--text-secondary);
}

.summary-stat strong {
  font-size: 16px;
}

/* Stepper Steppers layout */
.stepper-progress {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 8px;
}

.step-progress-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--border-color);
  transform: translateY(-50%);
  z-index: 1;
}

.step-node {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  border: 2px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  position: relative;
  z-index: 2;
  transition: var(--transition-smooth);
}

.step-node.active {
  border-color: var(--color-indigo);
  background-color: var(--bg-primary);
  color: var(--color-indigo);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.step-node.completed {
  border-color: var(--color-emerald);
  background-color: var(--color-emerald);
  color: #ffffff;
}

.stepper-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 25px;
}

.step-pane {
  display: none;
}

.step-pane.active {
  display: block;
}

.step-pane h3 {
  font-size: 18px;
  margin-bottom: 15px;
}

.btn-row-right {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.btn-row-between {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

/* Step 2 API Check Graphic */
.api-check-box {
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  padding: 30px 20px;
  text-align: center;
  border-radius: var(--border-radius-md);
  margin: 15px 0;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.api-check-icon {
  font-size: 32px;
  color: var(--color-indigo);
  margin-bottom: 10px;
}

.api-check-box.success .api-check-icon {
  color: var(--color-emerald);
}

.api-check-box.warning .api-check-icon {
  color: var(--color-amber);
}

/* Step 3 XML progress log */
.progress-bar-container {
  width: 100%;
  height: 8px;
  background-color: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  margin: 20px 0;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-indigo), #06B6D4);
  transition: width 0.1s ease;
}

.progress-steps-log {
  background-color: rgba(0, 0, 0, 0.3);
  padding: 15px;
  border-radius: var(--border-radius-sm);
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
  overflow-y: auto;
}

.progress-steps-log .pending {
  color: var(--text-muted);
}

/* Step 4 Success giant view */
.success-giant-icon {
  font-size: 64px;
  color: var(--color-emerald);
  text-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
  margin-bottom: 15px;
}

.success-details-box {
  background-color: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 15px;
  border-radius: var(--border-radius-md);
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.success-details-box div {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

/* Alerts and boxes */
.alert-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px;
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  margin-top: 15px;
  line-height: 1.5;
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--text-primary);
}

.alert-warning i {
  color: var(--color-amber);
  font-size: 18px;
}

.alert-info {
  background-color: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--text-primary);
}

.alert-info i {
  color: var(--color-indigo);
  font-size: 18px;
}

/* Amazon Inventory Tab Layout */
.inventory-layout {
  padding: 24px;
}

.inventory-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 20px;
}

.sync-api-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-indigo);
  background-color: var(--color-indigo-glow);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.table-container {
  overflow-x: auto;
  border-radius: var(--border-radius-sm);
}

.inventory-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.inventory-table th {
  background-color: rgba(0, 0, 0, 0.2);
  padding: 14px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.inventory-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  vertical-align: middle;
}

.inventory-table tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.prod-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.prod-cell img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.prod-info-cell {
  display: flex;
  flex-direction: column;
}

.prod-info-cell strong {
  font-size: 14px;
  color: var(--text-primary);
}

.prod-info-cell span {
  font-size: 11px;
  color: var(--text-muted);
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.12);
  color: var(--color-emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.empty-inventory {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-icon {
  font-size: 54px;
  color: var(--text-muted);
  margin-bottom: 15px;
}

.empty-inventory h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.empty-inventory p {
  color: var(--text-secondary);
  font-size: 13px;
  max-width: 400px;
}

/* Repricer Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-switch {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 34px;
}

.slider-switch:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider-switch {
  background-color: var(--color-indigo);
}

input:checked + .slider-switch:before {
  transform: translateX(16px);
}

/* Financials Tab Layout */
.financials-layout {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.financial-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.fin-card {
  border-radius: var(--border-radius-md);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.card-gradient-purple {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.15), rgba(79, 70, 229, 0.05));
  border-left: 4px solid #A855F7;
}

.card-gradient-green {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(4, 120, 87, 0.05));
  border-left: 4px solid var(--color-emerald);
}

.card-gradient-indigo {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(67, 56, 202, 0.05));
  border-left: 4px solid var(--color-indigo);
}

.card-gradient-orange {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(180, 83, 9, 0.05));
  border-left: 4px solid var(--color-amber);
}

.fin-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fin-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.fin-value {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-family-title);
}

.fin-subtext {
  font-size: 11px;
  color: var(--text-muted);
}

.fin-icon-wrapper {
  width: 44px;
  height: 44px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-secondary);
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 30px;
}

.chart-card {
  padding: 24px;
}

.chart-card h3 {
  font-size: 16px;
  margin-bottom: 20px;
  color: var(--text-secondary);
}

.chart-container {
  position: relative;
  height: 250px;
  width: 100%;
}

.calculator-card {
  padding: 24px;
}

.calculator-card h3 {
  font-size: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 30px;
}

.calc-inputs {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.calc-results {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: var(--border-radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 15px;
}

.calc-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.calc-result-item span {
  color: var(--text-secondary);
}

.calc-result-item strong {
  font-size: 16px;
}

/* Settings Tab Layout */
.settings-layout {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
}

.settings-card, .help-card {
  padding: 30px;
}

.settings-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-indigo);
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  padding-bottom: 6px;
  letter-spacing: 0.05em;
}

.help-content h4 {
  font-size: 14px;
  margin-top: 15px;
  margin-bottom: 5px;
  color: var(--text-primary);
}

.help-content p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
}

/* ==========================================================================
   New Cart & Shipment Tracker Styles
   ========================================================================== */

/* Cart Items & Panel Styles */
.cart-panel {
  display: flex;
  flex-direction: column;
}

.cart-items {
  scrollbar-width: thin;
}

.cart-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 12px;
  position: relative;
  transition: var(--transition-fast);
}

.cart-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
}

.cart-item-header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.cart-item-img {
  width: 45px;
  height: 45px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.cart-item-title-col {
  flex-grow: 1;
  min-width: 0;
}

.cart-item-title-col h4 {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.cart-item-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-remove-cart {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition-fast);
  padding: 2px;
}

.btn-remove-cart:hover {
  color: var(--color-rose);
}

.cart-item-fields {
  display: grid;
  grid-template-columns: 0.9fr 0.9fr 1.1fr 1.3fr;
  gap: 6px;
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
  margin-top: 4px;
}

.cart-item-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cart-item-field label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.cart-item-field input {
  padding: 4px 6px;
  font-size: 12px;
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  width: 100%;
}

.cart-item-field input:focus {
  outline: none;
  border-color: var(--color-indigo);
}

.cart-item-financial {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  background-color: rgba(0,0,0,0.15);
  padding: 4px 8px;
  border-radius: 4px;
  margin-top: 4px;
}

.cart-item-financial span strong {
  font-weight: 700;
}

.cart-hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 10px 0;
}

/* Shipment Tracker Section Styles */
.shipments-layout {
  display: flex;
  flex-direction: column;
}

.shipment-card {
  margin-bottom: 25px;
  overflow: hidden;
}

.shipment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background-color: rgba(15, 23, 42, 0.4);
  border-bottom: 1px solid var(--border-color);
}

.shipment-meta-info {
  display: flex;
  gap: 20px;
  align-items: center;
}

.shipment-id-badge {
  font-family: var(--font-family-title);
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}

.shipment-date {
  font-size: 12px;
  color: var(--text-muted);
}

.shipment-type-badge {
  background-color: rgba(6, 182, 212, 0.1);
  color: #06B6D4;
  border: 1px solid rgba(6, 182, 212, 0.25);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  font-weight: 700;
}

.shipment-financial-total {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-emerald);
}

.shipment-body {
  padding: 24px;
}

.shipment-products-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.shipment-product-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 10px 14px;
}

.shipment-product-img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

.shipment-product-info {
  flex-grow: 1;
  min-width: 0;
}

.shipment-product-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shipment-product-qty {
  font-size: 11px;
  color: var(--text-muted);
}

/* Shipment Stepper Timeline */
.shipment-timeline-container {
  margin: 30px 0;
  position: relative;
}

.shipment-timeline {
  display: flex;
  justify-content: space-between;
  position: relative;
  width: 100%;
}

.shipment-timeline-line {
  position: absolute;
  top: 15px;
  left: 5%;
  right: 5%;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.05);
  z-index: 1;
}

.shipment-timeline-line-active {
  position: absolute;
  top: 15px;
  left: 5%;
  height: 4px;
  background: linear-gradient(90deg, var(--color-indigo), var(--color-emerald));
  z-index: 2;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.shipment-timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 18%;
  position: relative;
  z-index: 3;
}

.shipment-step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  border: 3px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: var(--transition-smooth);
}

.shipment-timeline-step.active .shipment-step-dot {
  border-color: var(--color-indigo);
  background-color: var(--bg-primary);
  color: var(--color-indigo);
  box-shadow: 0 0 12px var(--color-indigo-glow);
  transform: scale(1.1);
}

.shipment-timeline-step.completed .shipment-step-dot {
  border-color: var(--color-emerald);
  background-color: var(--color-emerald);
  color: #ffffff;
}

.shipment-step-pulse {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--color-indigo-glow);
  z-index: -1;
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { transform: scale(0.9); opacity: 0.9; }
  100% { transform: scale(1.5); opacity: 0; }
}

.shipment-step-label {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.shipment-timeline-step.active .shipment-step-label {
  color: var(--text-primary);
}

.shipment-timeline-step.completed .shipment-step-label {
  color: var(--color-emerald);
}

.shipment-step-desc {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 2px;
  max-width: 110px;
}

/* Log of shipment events */
.shipment-event-log-container {
  margin-top: 20px;
  background-color: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 15px;
}

.shipment-event-log-title {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.shipment-events {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: monospace;
  font-size: 12px;
  max-height: 120px;
  overflow-y: auto;
}

.shipment-event {
  display: flex;
  gap: 12px;
  line-height: 1.4;
}

.shipment-event-time {
  color: var(--text-muted);
  white-space: nowrap;
}

.shipment-event-text {
  color: var(--text-secondary);
}

/* Responsiveness for sourcing hub grid */
@media (max-width: 1200px) {
  .sourcing-layout {
    grid-template-columns: 260px 1fr;
  }
  .cart-panel {
    grid-column: 1 / -1;
    position: static !important;
  }
}

@media (max-width: 850px) {
  .sourcing-layout {
    grid-template-columns: 1fr;
  }
  .filters-panel {
    position: static !important;
    width: 100% !important;
    margin-bottom: 20px !important;
  }
}

/* Custom Interactive Tooltips */
.info-tooltip {
  position: relative;
  display: inline-block;
  margin-left: 6px;
  color: var(--color-indigo);
  cursor: pointer;
  font-size: 13px;
  vertical-align: middle;
  transition: color 0.2s ease, transform 0.2s ease;
}

.info-tooltip:hover {
  color: var(--color-amber);
  transform: scale(1.15);
}

/* User Manual Container Layout */
.manual-container-layout {
  display: flex;
  gap: 25px;
}

/* User Manual Anchor Highlighting */
.manual-layout div[id^="manual-"] {
  transition: background-color 0.8s ease, box-shadow 0.8s ease;
  border-radius: var(--border-radius-sm);
}

/* Manual Quick Navigation Links styling */
.manual-layout a {
  transition: padding-left 0.2s ease, color 0.2s ease;
}
.manual-layout a:hover {
  padding-left: 4px;
}

/* Language control */
html:not([lang="es"]) .lang-es { display: none !important; }
html:not([lang="en"]) .lang-en { display: none !important; }
html:not([lang="pt"]) .lang-pt { display: none !important; }
html:not([lang="fr"]) .lang-fr { display: none !important; }
html:not([lang="it"]) .lang-it { display: none !important; }

/* Welcome Tab styling */
.welcome-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.welcome-hero {
  text-align: center;
  padding: 30px 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  position: relative;
  overflow: hidden;
}

.welcome-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.welcome-hero h2 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-hero p {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 20px auto;
}

.welcome-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 30px;
  margin-bottom: 40px;
  align-items: start;
}

@media (max-width: 1024px) {
  .welcome-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.welcome-diagram-card {
  padding: 25px;
}

.welcome-diagram-card h3 {
  font-size: 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.workflow-image-container {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px;
}

.workflow-image-container img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 650px;
  object-fit: contain;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease;
}

.workflow-image-container img:hover {
  transform: scale(1.02);
}

.workflow-caption-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 15px;
  width: 100%;
  border-top: 1px dashed var(--border-color);
  padding-top: 15px;
}

.workflow-caption-item {
  text-align: center;
  font-size: 12px;
}

.workflow-caption-item i {
  font-size: 18px;
  margin-bottom: 6px;
}

.welcome-user-card {
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.welcome-user-card h3 {
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.active-user-status {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 15px;
}

.active-user-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--color-emerald);
  overflow: hidden;
  flex-shrink: 0;
}

.active-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.active-user-info {
  display: flex;
  flex-direction: column;
}

.active-user-name {
  font-weight: 700;
  font-size: 15px;
  color: #ffffff;
}

.active-user-email {
  font-size: 12px;
  color: var(--text-secondary);
}

.active-user-badge {
  font-size: 10px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--color-emerald);
  color: var(--color-emerald);
  padding: 2px 6px;
  border-radius: 4px;
  align-self: flex-start;
  margin-top: 4px;
  font-weight: 600;
}

.user-presets-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-presets-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.user-presets-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.user-preset-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.user-preset-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--color-indigo);
  color: #ffffff;
}

.user-preset-btn.active {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--color-emerald);
  color: #ffffff;
}

.user-preset-btn img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.custom-user-form {
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.features-highlight {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .features-highlight {
    grid-template-columns: 1fr;
  }
}

.feature-box {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-box i {
  font-size: 24px;
  margin-bottom: 5px;
}

/* Sidebar locked items styling */
.nav-item.locked {
  opacity: 0.45;
  cursor: not-allowed !important;
  position: relative;
}

.nav-item.locked:hover {
  background: transparent !important;
  color: var(--text-secondary) !important;
}

.nav-item.locked::after {
  content: '\f023'; /* FontAwesome lock icon */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: 15px;
  font-size: 11px;
  color: var(--color-amber);
}

/* Mock Ads styling */
.mock-ad-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  border-radius: var(--border-radius-sm);
  padding: 12px 15px;
  margin: 15px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  transition: var(--transition-smooth);
}

.mock-ad-banner::before {
  content: 'AD / SPONSORED';
  position: absolute;
  top: 2px;
  right: 5px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-amber);
  opacity: 0.6;
}

.mock-ad-content {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-primary);
}

.mock-ad-content i {
  font-size: 18px;
  color: var(--color-amber);
}

.mock-ad-text strong {
  display: block;
  color: #ffffff;
  font-size: 13px;
}

.mock-ad-text span {
  font-size: 11px;
  color: var(--text-secondary);
}

.mock-ad-action-btn {
  background: var(--color-amber);
  color: #000000;
  border: none;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.mock-ad-action-btn:hover {
  filter: brightness(1.2);
}

/* Pricing cards styling */
.pricing-section {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.pricing-section h3 {
  font-size: 20px;
  margin-bottom: 5px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  width: 100%;
  max-width: 750px;
}

.pricing-card {
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  position: relative;
  overflow: hidden;
}

.pricing-card.popular {
  border-color: var(--color-indigo);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}

.pricing-card.popular::before {
  content: 'RECOMENDADO / POPULAR';
  position: absolute;
  top: 15px;
  right: -30px;
  background: var(--color-indigo);
  color: white;
  font-size: 8px;
  font-weight: 700;
  padding: 4px 30px;
  transform: rotate(45deg);
}

.pricing-header h4 {
  font-size: 18px;
  margin-bottom: 5px;
  color: #ffffff;
}

.pricing-price {
  font-family: var(--font-family-title);
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.pricing-price span {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pricing-features li i {
  color: var(--color-emerald);
}

.pricing-features li.disabled {
  opacity: 0.5;
}

.pricing-features li.disabled i {
  color: var(--color-rose);
}

/* Donations panel */
.donation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 15px;
}

.donation-card {
  padding: 15px;
  text-align: center;
  cursor: pointer;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  transition: var(--transition-fast);
}

.donation-card:hover {
  border-color: var(--color-emerald);
  background: rgba(16, 185, 129, 0.1);
  transform: translateY(-2px);
}

.donation-card.active {
  border-color: var(--color-emerald);
  background: rgba(16, 185, 129, 0.15);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.donation-amount {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
}

/* Sidebar operator logout button */
.btn-logout {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  border-radius: var(--border-radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 5px;
  width: 100%;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
  border-color: var(--color-rose);
}

/* Blur locks for main page overlay */
.locked-tab-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
}

.locked-tab-card {
  max-width: 450px;
  padding: 30px;
}

.locked-tab-card i {
  font-size: 40px;
  color: var(--color-amber);
  margin-bottom: 15px;
}

.locked-tab-card h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.locked-tab-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Confetti and celebrations */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  top: -20px;
  z-index: 9999;
  border-radius: 3px;
  animation: fall linear forwards;
  pointer-events: none;
}

@keyframes fall {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  100% {
    transform: translateY(105vh) rotate(720deg);
  }
}

/* Custom styled Google login card */
.google-account-row {
  transition: all 0.2s ease;
}
.google-account-row:hover {
  background: rgba(66, 133, 244, 0.08) !important;
  border-color: rgba(66, 133, 244, 0.4) !important;
}

/* Adjust locked pointer-events */
.nav-item.locked {
  pointer-events: auto !important; /* Allow clicks so JS event listener can show toast */
}

/* Mobile Responsive Sidebar Toggle & Content Header Layout */
@media (max-width: 1024px) {
  #btnMobileMenuToggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
  
  .content-header {
    display: grid !important;
    grid-template-columns: auto auto 1fr !important;
    align-items: center !important;
    gap: 15px !important;
    padding-bottom: 15px !important;
  }
  
  .header-actions {
    justify-self: end !important;
  }
  
  .sidebar {
    position: fixed !important;
    top: 0;
    left: -280px !important;
    height: 100vh !important;
    height: 100dvh !important;
    padding: 20px !important;
    z-index: 1100 !important;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
  }
  
  .sidebar.active {
    left: 0 !important;
  }
  
  .main-content {
    width: 100% !important;
    padding: 20px !important;
  }
}

/* Tablet Layout Adjustments */
@media (max-width: 768px) {
  .content-header {
    grid-template-columns: auto 1fr !important;
    grid-template-rows: auto auto !important;
    gap: 12px 15px !important;
  }
  
  #btnMobileMenuToggle {
    grid-column: 1 !important;
    grid-row: 1 !important;
    margin-right: 0 !important;
  }
  
  .header-title-area {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
  }
  
  .header-title-area h1 {
    font-size: 24px !important;
  }
  
  .header-title-area p {
    font-size: 12px !important;
    margin-top: 2px !important;
    line-height: 1.3 !important;
  }
  
  .header-actions {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    justify-self: stretch !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 12px !important;
    margin-top: 5px !important;
  }
  
  .metric-mini {
    align-items: flex-start !important;
  }
  
  .metric-label {
    font-size: 10px !important;
  }
  
  .metric-value {
    font-size: 15px !important;
  }
  
  #btnQuickSync {
    height: 38px !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
  }
}

/* Smartphone Portrait Layout Adjustments */
@media (max-width: 480px) {
  .header-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }
  
  .language-selector {
    grid-column: 1 !important;
  }
  
  .language-selector select {
    width: 100% !important;
    height: 38px !important;
    font-size: 12px !important;
  }
  
  .metric-mini {
    grid-column: 2 !important;
    align-items: flex-end !important;
    text-align: right !important;
  }
  
  #btnQuickSync {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    justify-content: center !important;
  }
}

/* Premium weekly report products discard styling */
.product-card.discarded-product {
  opacity: 0.35 !important;
  filter: grayscale(90%) !important;
  border-color: rgba(255, 255, 255, 0.04) !important;
  box-shadow: none !important;
  transition: all 0.3s ease;
  pointer-events: auto !important;
}

.product-card.discarded-product:hover {
  opacity: 0.60 !important;
  filter: grayscale(40%) !important;
  transform: none !important;
}

.product-card.discarded-product .btn-add-premium {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

/* Select options contrast and readability fix for dark mode */
select option,
.form-control option,
.form-control-sm option {
  background-color: #141b29 !important; /* Sleek Slate Blue / deep dark theme background */
  color: #f8fafc !important; /* Off-white text for high contrast */
}

/* --- MOBILE RESPONSIVENESS AND SCROLLBAR HIDING FIXES --- */

/* Hide scrollbar for the main content container to maintain sleek app-like interface */
.main-content::-webkit-scrollbar {
  display: none !important;
}
.main-content {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
  overflow-x: hidden !important; /* Avoid horizontal scrolling */
}

@media (max-width: 768px) {
  /* Prevent horizontal document overflow completely */
  html, body, .app-container {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .main-content {
    padding: 15px !important;
    gap: 20px !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  /* Collapse all 2-column and 3-column layouts to 1-column on mobile */
  .settings-grid,
  .calc-grid,
  .charts-grid,
  .form-group-row,
  .welcome-grid,
  .modal-prod-details,
  .sourcing-chat-layout,
  .manual-container-layout {
    grid-template-columns: 1fr !important;
    flex-direction: column !important;
    gap: 20px !important;
  }

  /* Prevent grid item blowout caused by inline styles like grid-column: span 2 */
  .welcome-diagram-card,
  .settings-card,
  .form-group-sm {
    grid-column: 1 / -1 !important;
  }

  /* Collapse premium products feed to 1 column on mobile */
  #premiumProductsGridContainer {
    grid-template-columns: 1fr !important;
  }

  /* Stacking and resetting styles for chat and manual layouts on mobile */
  .sourcing-chat-layout {
    min-height: auto !important;
  }
  
  .sourcing-chat-layout > div {
    height: auto !important;
  }

  .manual-container-layout > div:first-child {
    width: 100% !important;
    position: static !important;
  }

  /* Responsive subtabs for mobile (wrap cleanly) */
  .sourcing-subtabs {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
  }
  
  .sourcing-subtabs button {
    flex: 1 1 calc(50% - 8px) !important;
    min-width: 130px !important;
    justify-content: center !important;
    text-align: center !important;
    font-size: 11px !important;
    padding: 6px 8px !important;
    height: auto !important;
  }
  
  .sourcing-subtabs button:last-child {
    flex: 1 1 100% !important;
  }

  /* Responsive search bar layout to prevent squeeze/overlap */
  .search-bar-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    margin-bottom: 15px !important;
  }
  
  .search-input-wrapper {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }
  
  #btnSearchAi {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    justify-content: center !important;
  }
  
  .search-mode-select,
  .sort-selector {
    grid-column: span 1 !important;
    width: 100% !important;
    margin-left: 0 !important;
  }

  .search-mode-select select,
  .sort-selector select {
    width: 100% !important;
  }

  /* Grid item min-width fallback to prevent CSS Grid blowout */
  .settings-grid > *,
  .calc-grid > *,
  .charts-grid > * {
    min-width: 0 !important;
  }

  /* Reduce card padding on mobile devices for optimized screen real estate */
  .settings-card,
  .help-card,
  .calculator-card,
  .chart-card,
  .modal-card,
  .glass {
    padding: 15px !important;
  }

  /* Custom tooltips adjustment */
  .info-tooltip {
    display: none !important; /* Hide secondary tooltips on mobile touch targets */
  }
}

@media (max-width: 480px) {
  .form-group-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}

/* --- AMAZON GRAPHICAL THEME --- */
.amazon-theme {
  color-scheme: only light !important;
}

body.amazon-theme {
  --bg-primary: #eaeded;                   /* Amazon light background */
  --bg-secondary: #232f3e;                 /* Amazon nav bar secondary dark */
  --bg-surface: #ffffff;                   /* White cards */
  --bg-card: #ffffff;
  --bg-glass: #ffffff;
  --bg-glass-hover: #ffffff;
  --border-color: #d5d9d9;                 /* Light grey borders */
  --border-color-active: #ff9900;          /* Amazon Orange */
  --text-primary: #111111;                 /* Charcoal dark text */
  --text-secondary: #565959;               /* Secondary text */
  --text-muted: #767676;
  --color-indigo: #e47911;                 /* Primary orange */
  --color-indigo-glow: rgba(228, 121, 17, 0.15);
  --color-emerald: #007600;                /* Green success */
  --color-amber: #b12704;                  /* Warning red-brown */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.075);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* General Layout Adaptations for Amazon theme */
.amazon-theme .modal-card,
.amazon-theme .help-card,
.amazon-theme .settings-card,
.amazon-theme .manual-layout,
.amazon-theme .glass {
  background: #ffffff !important;
  border: 1px solid #d5d9d9 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1) !important;
  border-radius: 8px !important;
}

.amazon-theme .glass:hover {
  border-color: #ff9900 !important;
}

/* Top content header bar styling as Amazon Navigation Sub-bar */
.amazon-theme .content-header {
  background-color: #232f3e !important;
  color: #ffffff !important;
  padding: 15px 25px !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
  margin-bottom: 15px !important;
  border-bottom: none !important;
}

.amazon-theme .content-header h1 {
  color: #ffffff !important;
  font-size: 22px !important;
  font-weight: 600 !important;
}

.amazon-theme .content-header p {
  color: #febd69 !important;               /* Yellow active accent */
  font-size: 13px !important;
}

.amazon-theme .content-header .metric-mini {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 4px !important;
  padding: 6px 12px !important;
}

.amazon-theme .content-header .metric-label {
  color: #e6e6e6 !important;
}

.amazon-theme .content-header .metric-value {
  color: #ffffff !important;
  font-weight: 700 !important;
}

/* Sidebar overrides for Amazon theme */
.amazon-theme .sidebar {
  background-color: #131921 !important;    /* Amazon dark primary */
  border-right: 1px solid #1a222d !important;
}

.amazon-theme .sidebar a,
.amazon-theme .sidebar .nav-item,
.amazon-theme .sidebar .operator-profile,
.amazon-theme .sidebar .operator-name,
.amazon-theme .sidebar h3,
.amazon-theme .sidebar span,
.amazon-theme .sidebar i {
  color: #e6e6e6 !important;
}

.amazon-theme .sidebar .nav-item.active {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #febd69 !important;               /* Amazon yellow active */
  border-left: 3px solid #ff9900 !important;
}

.amazon-theme .sidebar .nav-item.active i,
.amazon-theme .sidebar .nav-item.active span {
  color: #febd69 !important;
}

.amazon-theme .sidebar .nav-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #ffffff !important;
}

.amazon-theme .sidebar .nav-item:hover i,
.amazon-theme .sidebar .nav-item:hover span {
  color: #ffffff !important;
}

/* Sidebar logo overrides to resemble actual Amazon branding */
.amazon-theme .logo-text {
  background: none !important;
  -webkit-text-fill-color: #ffffff !important;
  color: #ffffff !important;
}

.amazon-theme .logo-text span {
  color: #ff9900 !important;
  -webkit-text-fill-color: #ff9900 !important;
}

/* Headings text color override for clean reading on light pages */
.amazon-theme h1,
.amazon-theme h2,
.amazon-theme h3,
.amazon-theme h4,
.amazon-theme h5,
.amazon-theme h6 {
  color: #111111;
}

.amazon-theme .sidebar h1,
.amazon-theme .sidebar h2,
.amazon-theme .sidebar h3,
.amazon-theme .sidebar h4,
.amazon-theme .sidebar h5,
.amazon-theme .sidebar h6,
.amazon-theme .content-header h1,
.amazon-theme .content-header h2,
.amazon-theme .content-header h3,
.amazon-theme .content-header h4,
.amazon-theme .content-header h5,
.amazon-theme .content-header h6 {
  color: #ffffff !important;
}

/* Amazon style buttons */
.amazon-theme .btn-primary {
  background: linear-gradient(to bottom, #f7dfa5, #f0c14b) !important;
  border: 1px solid #a88734 !important;
  color: #111111 !important;
  font-weight: 500 !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset !important;
  border-radius: 8px !important;
}

.amazon-theme .btn-primary:hover {
  background: linear-gradient(to bottom, #f5d78e, #eeb933) !important;
  border-color: #846a29 !important;
}

.amazon-theme .btn-secondary {
  background: linear-gradient(to bottom, #f7f8fa, #e7e9ec) !important;
  border: 1px solid #adb1b8 !important;
  color: #111111 !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset !important;
}

.amazon-theme .btn-secondary:hover {
  background: linear-gradient(to bottom, #e7eaf0, #d9dce1) !important;
  border-color: #a2a6ac !important;
}

.amazon-theme .btn-success {
  background: linear-gradient(to bottom, #a1d99b, #74c476) !important;
  border: 1px solid #5a9e5c !important;
  color: #111111 !important;
  border-radius: 8px !important;
}

.amazon-theme .btn-success:hover {
  background: linear-gradient(to bottom, #8fcf88, #5cb85e) !important;
}

.amazon-theme .btn-danger {
  background: linear-gradient(to bottom, #f5c0b8, #e05c50) !important;
  border: 1px solid #b3392f !important;
  color: #ffffff !important;
  border-radius: 8px !important;
}

.amazon-theme .btn-danger:hover {
  background: linear-gradient(to bottom, #f2a89d, #ca4337) !important;
  border-color: #8f261d !important;
}

/* Active subtabs overrides to override inline JS styles */
.amazon-theme .sourcing-subtabs .btn.active,
.amazon-theme .sourcing-subtabs .btn-secondary.active,
.amazon-theme #btnSubTabSearch.active,
.amazon-theme #btnSubTabChat.active,
.amazon-theme #btnSubTabPremium.active,
.amazon-theme .settings-card .btn.active,
.amazon-theme .settings-card .btn-secondary.active,
.amazon-theme #btnTabPaypal.active,
.amazon-theme #btnTabCard.active {
  background: linear-gradient(to bottom, #f7dfa5, #f0c14b) !important;
  border-color: #a88734 !important;
  color: #111111 !important;
}

/* Form inputs styling for Amazon theme */
.amazon-theme input[type="text"],
.amazon-theme input[type="number"],
.amazon-theme input[type="password"],
.amazon-theme input[type="email"],
.amazon-theme select,
.amazon-theme textarea,
.amazon-theme .form-control {
  background-color: #ffffff !important;
  color: #111111 !important;
  border: 1px solid #888c8c !important;
  border-radius: 4px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) inset !important;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

.amazon-theme input:focus,
.amazon-theme select:focus,
.amazon-theme textarea:focus,
.amazon-theme .form-control:focus {
  border-color: #e77600 !important;
  box-shadow: 0 0 3px 2px rgba(228, 121, 17, 0.25) !important;
  outline: none !important;
}

/* Option elements styling */
.amazon-theme select option {
  background-color: #ffffff !important;
  color: #111111 !important;
}

/* Product list wrappers background */
.amazon-theme .product-card-image,
.amazon-theme .product-image-wrapper {
  background-color: #f9f9f9 !important;
}

/* Chat bubble styling for Amazon theme and Light theme */
.chat-bubble-custom {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
}

.chat-bubble-custom.user {
  background: var(--color-indigo) !important;
  color: #ffffff !important;
  border: 1px solid transparent !important;
  border-bottom-right-radius: 2px !important;
}

.chat-bubble-custom.agent {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #ffffff !important;
  border: 1px solid var(--border-color) !important;
  border-bottom-left-radius: 2px !important;
}

/* Overrides for light theme */
body.light-theme .chat-bubble-custom.agent {
  background: rgba(15, 23, 42, 0.05) !important;
  color: var(--text-primary) !important;
}

body.light-theme .chat-bubble-custom.user {
  color: #ffffff !important;
}

/* Overrides for Amazon theme */
body.amazon-theme .chat-bubble-custom.agent {
  background: #f0f2f2 !important;
  color: #111111 !important;
  border-color: #d5d9d9 !important;
}

body.amazon-theme .chat-bubble-custom.user {
  background: linear-gradient(to bottom, #f7dfa5, #f0c14b) !important;
  border-color: #a88734 !important;
  color: #111111 !important;
}

/* Proforma and AI Offer card overrides for light/Amazon themes */
body.light-theme .chat-bubble-custom.proforma-offer,
body.light-theme .chat-bubble-custom.ai-offer {
  background: #ffffff !important;
  border: 1px solid var(--border-color-active) !important;
  box-shadow: 0 4px 15px rgba(255, 98, 1, 0.1) !important;
  color: var(--text-primary) !important;
}

body.light-theme .chat-bubble-custom.proforma-offer *,
body.light-theme .chat-bubble-custom.ai-offer * {
  color: var(--text-primary) !important;
}

body.light-theme .chat-bubble-custom.proforma-offer .btn,
body.light-theme .chat-bubble-custom.ai-offer .btn {
  color: #ffffff !important;
}

body.amazon-theme .chat-bubble-custom.proforma-offer,
body.amazon-theme .chat-bubble-custom.ai-offer {
  background: #ffffff !important;
  border: 1px solid #e47911 !important;
  box-shadow: 0 4px 12px rgba(228, 121, 17, 0.15) !important;
  color: #111111 !important;
}

body.amazon-theme .chat-bubble-custom.proforma-offer *,
body.amazon-theme .chat-bubble-custom.ai-offer * {
  color: #111111 !important;
}

body.amazon-theme .chat-bubble-custom.proforma-offer span,
body.amazon-theme .chat-bubble-custom.ai-offer span {
  color: #565959 !important;
}

body.amazon-theme .chat-bubble-custom.proforma-offer strong,
body.amazon-theme .chat-bubble-custom.ai-offer strong {
  color: #111111 !important;
}

body.amazon-theme .chat-bubble-custom.proforma-offer .btn-apply-offer,
body.amazon-theme .chat-bubble-custom.ai-offer .btn-apply-offer {
  background: linear-gradient(to bottom, #f7dfa5, #f0c14b) !important;
  border: 1px solid #a88734 !important;
  color: #111111 !important;
}




