/* ==========================================================================
   MyShop - CSS Design System & Variables (Premium Indian Retail Styling)
   ========================================================================== */

:root {
  /* Colors - Modern, high-contrast, premium HSL values */
  --bg-app: #f4f6fa;
  --bg-card: #ffffff;
  --bg-card-hover: #fcfdfe;
  --border-light: rgba(225, 230, 240, 0.8);
  
  --primary: hsl(226, 70%, 40%);          /* Sapphire Royal Indigo */
  --primary-light: hsl(226, 70%, 94%);    /* Light Indigo tint */
  --primary-glow: rgba(30, 58, 138, 0.15);
  
  --accent-saffron: hsl(28, 92%, 52%);    /* Growth / Saffron Gold */
  --accent-saffron-light: hsl(28, 92%, 93%);
  
  --success-profit: hsl(142, 68%, 28%);   /* Prosperity Emerald Green */
  --success-profit-bg: hsl(142, 68%, 93%);
  
  --danger: hsl(0, 84%, 55%);             /* Stock Warning Crimson */
  --danger-light: hsl(0, 84%, 93%);
  
  --text-main: hsl(222, 47%, 15%);
  --text-muted: hsl(220, 16%, 50%);
  --text-white: #ffffff;
  
  /* Layout Metrics */
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  
  /* Fonts */
  --font-en: 'Outfit', sans-serif;
  --font-hi: 'Noto Sans Devanagari', sans-serif;
}

/* Dark Mode Variables - Slick Slate Dark */
.dark-mode {
  --bg-app: hsl(222, 47%, 8%);
  --bg-card: hsl(222, 47%, 12%);
  --bg-card-hover: hsl(222, 47%, 15%);
  --border-light: rgba(30, 41, 59, 0.8);
  
  --primary: hsl(224, 75%, 60%);
  --primary-light: hsl(224, 75%, 15%);
  --primary-glow: rgba(59, 130, 246, 0.25);
  
  --accent-saffron: hsl(32, 95%, 55%);
  --accent-saffron-light: hsl(32, 95%, 15%);
  
  --success-profit: hsl(142, 72%, 40%);
  --success-profit-bg: hsl(142, 72%, 12%);
  
  --danger: hsl(0, 85%, 62%);
  --danger-light: hsl(0, 85%, 15%);
  
  --text-main: hsl(210, 40%, 96%);
  --text-muted: hsl(215, 16%, 65%);
}

/* ==========================================================================
   Base resets & Smartphone Framing
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-en);
}

body {
  background-color: #0f172a; /* Outer backdrop on desktop */
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  color: var(--text-main);
  overflow: hidden;
}

/* Phone Mockup Frame (centered on desktop, fills mobile screens) */
.app-container {
  width: 100%;
  max-width: 430px; /* iPhone 15 Pro Max width */
  height: 100vh;
  max-height: 900px;
  background-color: var(--bg-app);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  transition: background-color 0.3s ease;
}

/* Mobile full-screen override */
@media (max-width: 480px) {
  body {
    background-color: var(--bg-app);
  }
  .app-container {
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
}

/* Desktop framing mock border */
@media (min-width: 481px) {
  .app-container {
    border: 12px solid #1e293b;
    border-radius: 40px;
  }
}

/* ==========================================================================
   Tab Navigation & Page Views
   ========================================================================== */

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-in-out;
  z-index: 1;
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 10;
}

#app-core {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 88px 16px; /* 88px bottom padding for floating bar */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.tab-panel {
  display: none;
  animation: fadeInTab 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-panel.active {
  display: block;
}

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

.hidden {
  display: none !important;
}

/* ==========================================================================
   Multilingual Font Adjustments
   ========================================================================== */

.lang-hindi * {
  font-family: var(--font-hi), sans-serif;
}

/* ==========================================================================
   Header component
   ========================================================================== */

.app-header {
  padding: calc(16px + var(--safe-area-top)) 16px 12px 16px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.shop-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shop-avatar {
  font-size: 24px;
  background-color: var(--primary-light);
  width: 44px;
  height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
}

.shop-info h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.shop-status-text {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.btn-lang-toggle {
  background-color: var(--primary-light);
  color: var(--primary);
  border: none;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 48px;
  text-align: center;
}

.btn-lang-toggle:active {
  transform: scale(0.92);
  background-color: var(--primary);
  color: white;
}

/* ==========================================================================
   Onboarding Layouts
   ========================================================================== */

#screen-onboarding {
  justify-content: center;
  align-items: center;
  padding: 24px;
  background: linear-gradient(135deg, hsl(226, 60%, 20%) 0%, hsl(222, 47%, 9%) 100%);
  color: var(--text-white);
}

.onboarding-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.brand-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.logo-circle {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--accent-saffron) 0%, #ea580c 100%);
  border-radius: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 8px 24px rgba(234, 88, 12, 0.4);
}

.logo-icon {
  width: 36px;
  height: 36px;
  fill: var(--text-white);
}

.brand-hero h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-hero .subtitle {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
}

.onboarding-step {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: slideInOnboarding 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInOnboarding {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.onboarding-step h2 {
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 4px;
}

/* Language Selection Grid */
.lang-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.btn-lang {
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px 16px;
  color: var(--text-white);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-lang:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-lang.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.lang-title {
  font-size: 18px;
  font-weight: 700;
}

.lang-sub {
  font-size: 13px;
  opacity: 0.8;
}

/* Form Styles */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group .label-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: -4px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
  width: 100%;
  height: 52px;
  border-radius: 12px;
  border: 1.5px solid var(--border-light);
  background-color: var(--bg-card);
  color: var(--text-main);
  padding: 0 16px;
  font-size: 16px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.2s ease;
}

#screen-onboarding input[type="text"] {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  color: var(--text-white);
}

#screen-onboarding input[type="text"]:focus {
  border-color: var(--accent-saffron);
  background: rgba(255, 255, 255, 0.1);
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary);
}

/* Store Type Card Grid */
.store-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.store-type-card {
  cursor: pointer;
  position: relative;
}

.store-type-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.store-type-card .card-inner {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.store-type-card input[type="radio"]:checked + .card-inner {
  border-color: var(--accent-saffron);
  background: rgba(234, 88, 12, 0.15);
  box-shadow: 0 0 12px rgba(234, 88, 12, 0.2);
}

.type-icon {
  font-size: 24px;
}

.store-type-card span {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-white);
}

/* General Button Components */
.btn {
  height: 52px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  width: 100%;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent-saffron) 0%, #ea580c 100%);
  color: var(--text-white);
  box-shadow: 0 4px 16px rgba(234, 88, 12, 0.3);
}

.btn-primary:active {
  background: #ea580c;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-white);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
}

#app-core .btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1.5px solid var(--border-light);
}

.btn-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

/* ==========================================================================
   Dashboard ("My Shop") Stylings
   ========================================================================== */

/* Store Value Card (Beautiful Glowing Gradient Card) */
.store-value-card {
  background: linear-gradient(135deg, var(--primary) 0%, #1e3a8a 100%);
  border-radius: 24px;
  padding: 24px;
  color: var(--text-white);
  box-shadow: 0 12px 32px var(--primary-glow);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.store-value-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.val-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.val-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  background-color: var(--success-profit);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success-profit);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.9); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 12px var(--success-profit); }
  100% { transform: scale(0.9); opacity: 0.5; }
}

.val-amount {
  font-size: 38px;
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.val-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 16px;
  gap: 8px;
}

.val-sub-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.val-sub-item span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

.val-sub-num {
  font-size: 14px;
  font-weight: 700;
}

.val-sub-item.highlight-profit .val-sub-num {
  color: #34d399; /* Bright green text in dark card background */
  font-size: 15px;
}

/* Alert Summary Grid */
.alert-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.status-summary-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.status-summary-card:active {
  transform: scale(0.96);
  background-color: var(--bg-card-hover);
}

.summary-icon {
  font-size: 20px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.status-summary-card.total .summary-icon {
  background-color: var(--primary-light);
}

.status-summary-card.warning .summary-icon {
  background-color: var(--accent-saffron-light);
}

.status-summary-card.danger .summary-icon {
  background-color: var(--danger-light);
}

.summary-info {
  display: flex;
  flex-direction: column;
}

.summary-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.summary-number {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 2px;
}

/* Quick Add Promo Action banner */
.action-promo-card {
  background: linear-gradient(135deg, var(--accent-saffron-light) 0%, rgba(254, 215, 170, 0.3) 100%);
  border: 1.5px dashed var(--accent-saffron);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  margin-bottom: 24px;
  gap: 12px;
}

.action-promo-card:active {
  transform: scale(0.98);
}

.promo-text h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.promo-text p {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.promo-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--accent-saffron);
  color: var(--text-white);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 10px rgba(249, 115, 22, 0.3);
}

.promo-btn svg {
  width: 20px;
  height: 20px;
}

/* Visual Feeds */
.visual-feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.visual-feed-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.visual-feed-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ==========================================================================
   Visual Product Card Components
   ========================================================================== */

.product-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.product-card:active {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

/* Product Card Stock status badges */
.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.product-badge.out {
  background-color: var(--danger);
  color: var(--text-white);
}

.product-badge.low {
  background-color: var(--accent-saffron);
  color: var(--text-white);
}

.product-badge.ok {
  background-color: var(--success-profit-bg);
  color: var(--success-profit);
}

.product-image-container {
  width: 100%;
  aspect-ratio: 1.1 / 1;
  background-color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border-light);
}

.product-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image-container img {
  transform: scale(1.05);
}

.product-details-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.prod-meta-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag-brand {
  background-color: #f1f5f9;
  color: var(--text-muted);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.prod-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  /* Multi-line clamp: max 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 36px;
}

.stock-meter-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.stock-meter-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.stock-meter-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.stock-meter-value.warning {
  color: var(--accent-saffron);
}

.stock-meter-value.danger {
  color: var(--danger);
}

/* Card Pricing breakdown grid */
.prod-pricing-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border-light);
  padding-top: 8px;
  margin-top: auto;
  gap: 4px;
}

.price-sub {
  display: flex;
  flex-direction: column;
}

.price-lbl {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.price-amt {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.prod-card-total-val {
  grid-column: span 2;
  border-top: 1px dashed var(--border-light);
  padding-top: 6px;
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

.prod-card-total-val span {
  color: var(--text-muted);
  font-weight: 500;
}

.prod-card-total-val strong {
  font-weight: 700;
  color: var(--primary);
}

/* ==========================================================================
   Inventory Tab / Search & Horizontal Filter Chips
   ========================================================================== */

.search-sticky-wrapper {
  position: sticky;
  top: 0;
  background-color: var(--bg-app);
  z-index: 80;
  padding: 4px 0 12px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* WhatsApp Search Layout */
.search-bar-container {
  display: flex;
  align-items: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  height: 48px;
  padding: 0 16px;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.search-icon {
  font-size: 16px;
  color: var(--text-muted);
}

.search-bar-container input {
  flex: 1;
  border: none;
  background: none;
  font-size: 15px;
  outline: none;
  color: var(--text-main);
  font-weight: 500;
}

.clear-search-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

/* Category Filter Chips Horizontal Scroller */
.category-filters-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Hide default firefox scroll */
}

.category-filters-container::-webkit-scrollbar {
  display: none; /* Hide default chrome/safari scroll */
}

.filter-chip {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--text-white);
  box-shadow: 0 4px 10px var(--primary-glow);
}

.products-grid-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-bottom: 20px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
  gap: 12px;
}

.empty-icon {
  font-size: 48px;
  background-color: #f1f5f9;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.empty-icon-success {
  font-size: 48px;
  background-color: var(--success-profit-bg);
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.empty-state h4 {
  font-size: 16px;
  font-weight: 700;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-muted);
}

/* ==========================================================================
   Low Stock Screen layout
   ========================================================================== */

.attention-header {
  margin-bottom: 20px;
}

.attention-header h2 {
  font-size: 20px;
  font-weight: 800;
}

.attention-header p {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.low-stock-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Row-style visual card for low stock items */
.low-stock-item-card {
  display: flex;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 12px;
  gap: 12px;
  align-items: center;
  position: relative;
}

.low-stock-thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  background-color: #f8fafc;
  overflow: hidden;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

.low-stock-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.low-stock-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.low-stock-details h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  /* Truncate long titles */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.low-stock-brand {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.low-stock-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-top: 2px;
}

.low-stock-qty {
  font-weight: 700;
  color: var(--danger);
  background-color: var(--danger-light);
  padding: 2px 6px;
  border-radius: 4px;
}

.low-stock-min {
  color: var(--text-muted);
  font-weight: 500;
}

/* Quick Restock Action triggers */
.quick-restock-action {
  flex-shrink: 0;
}

.btn-restock {
  background-color: var(--success-profit-bg);
  color: var(--success-profit);
  border: none;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-restock:active {
  transform: scale(0.92);
  background-color: var(--success-profit);
  color: white;
}

/* ==========================================================================
   Settings Screen Layouts
   ========================================================================== */

.section-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 20px;
}

.settings-group {
  margin-bottom: 24px;
}

.settings-group-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 8px;
  padding-left: 4px;
}

.settings-row {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.settings-row.clickable {
  cursor: pointer;
}

.settings-row.clickable:active {
  transform: scale(0.98);
  background-color: var(--bg-card-hover);
}

.setting-desc {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.setting-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.setting-label.danger-text {
  color: var(--danger);
}

.setting-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.3;
}

.setting-input {
  border: none !important;
  background: transparent !important;
  height: auto !important;
  padding: 0 !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  color: var(--primary) !important;
  text-align: right;
  outline: none;
  width: 100%;
}

.setting-select {
  border: none !important;
  background: transparent !important;
  height: auto !important;
  padding: 0 20px 0 0 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--primary) !important;
  text-align: right;
  outline: none;
  width: auto !important;
  align-self: flex-end;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%232563eb' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 20px;
}

.setting-action {
  font-size: 18px;
  color: var(--text-muted);
  font-weight: 700;
}

/* Language toggle in settings */
.lang-switch-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  background-color: var(--bg-app);
  padding: 4px;
  border-radius: 10px;
}

.btn-toggle-option {
  border: none;
  background: transparent;
  padding: 10px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.btn-toggle-option.active {
  background-color: var(--bg-card);
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.settings-footer {
  text-align: center;
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.logo-small {
  font-size: 32px;
}

.settings-footer h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.settings-footer p {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   Bottom Navigation Component
   ========================================================================== */

.app-navigation {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: calc(64px + var(--safe-area-bottom));
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: var(--safe-area-bottom);
  z-index: 90;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.02);
}

.nav-item {
  background: none;
  border: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s ease;
  position: relative;
}

.nav-item:active .nav-icon {
  transform: scale(0.9);
}

.nav-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
  transition: transform 0.2s ease;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
}

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

/* Nav Badge */
.nav-badge-container {
  position: relative;
  display: inline-block;
}

.badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background-color: var(--danger);
  color: var(--text-white);
  font-size: 9px;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 1.5px solid var(--bg-card);
}

/* Center Floating Action Button (FAB) */
.fab-wrapper {
  position: relative;
  width: 60px;
  height: 100%;
  display: flex;
  justify-content: center;
}

.fab-btn {
  position: absolute;
  top: -18px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-saffron) 0%, #ea580c 100%);
  color: var(--text-white);
  border: none;
  box-shadow: 0 6px 16px rgba(234, 88, 12, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 105;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fab-btn:active {
  transform: scale(0.9) translateY(4px);
}

.fab-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ==========================================================================
   Modals & Scanning Flows (AI Simulator Overlay)
   ========================================================================== */

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end; /* Native bottom sheet sheet style */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 100%;
  max-height: 90%;
  background-color: var(--bg-card);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 20px 12px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.btn-close-modal:active {
  background-color: var(--primary-light);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 32px 20px;
}

.add-flow-step {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-instruction {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
}

/* Webcam simulator and Live camera layout */
.camera-viewport-container {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  overflow: hidden;
  background-color: #0f172a;
  position: relative;
  border: 2px solid var(--border-light);
}

.camera-viewport-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.webcam-simulator {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sim-bg-dots {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(rgba(255, 255, 255, 0.15) 2px, transparent 0);
  background-size: 24px 24px;
}

.selected-photo-preview-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #1e293b;
  z-index: 1;
}

.selected-photo-preview-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.photo-select-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.6);
  padding: 24px;
}

.photo-select-prompt .icon {
  font-size: 44px;
}

.photo-select-prompt span {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

/* Dynamic scanning laser scanner overlay animation */
.laser-scanner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.laser-line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent 5%, var(--accent-saffron) 50%, transparent 95%);
  box-shadow: 0 0 16px var(--accent-saffron), 0 0 6px var(--accent-saffron);
  animation: scanlaser 2s infinite linear;
}

@keyframes scanlaser {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

.scanner-glow {
  position: absolute;
  left: 0;
  width: 100%;
  height: 40px;
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.08) 0%, transparent 100%);
  animation: scanlaserglow 2s infinite linear;
  top: 0%;
}

@keyframes scanlaserglow {
  0% { top: 0%; transform: scaleY(1); }
  50% { top: 100%; transform: scaleY(-1); }
  100% { top: 0%; transform: scaleY(1); }
}

.scanning-label {
  background-color: rgba(15, 23, 42, 0.85);
  color: var(--accent-saffron);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  margin-top: auto;
  margin-bottom: 24px;
  border: 1px solid var(--accent-saffron);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 15;
}

/* Capture control overlay */
.camera-controls {
  position: absolute;
  bottom: 16px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 15;
}

.btn-capture {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 4px solid var(--text-white);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.shutter-inner {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--text-white);
  transition: transform 0.1s ease;
}

.btn-capture:active .shutter-inner {
  transform: scale(0.9);
  background-color: var(--danger);
}

/* Preset Quick Choices */
.mock-presets-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.presets-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  padding-left: 2px;
}

.presets-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  padding: 2px 0 6px 0;
  scrollbar-width: none;
}

.presets-row::-webkit-scrollbar {
  display: none;
}

.preset-chip {
  background-color: var(--bg-app);
  border: 1px solid var(--border-light);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.preset-chip:active {
  background-color: var(--primary-light);
  border-color: var(--primary);
}

.action-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.action-footer .btn {
  height: 48px;
}

/* AI review form enhancements */
.scan-success-badge {
  background-color: var(--success-profit-bg);
  color: var(--success-profit);
  padding: 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-thumbnail-preview {
  position: relative;
  width: 120px;
  aspect-ratio: 1.1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background-color: #f8fafc;
  border: 1px solid var(--border-light);
  align-self: center;
  margin-bottom: 8px;
}

.form-thumbnail-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.change-photo-btn {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(15, 23, 42, 0.85);
  color: var(--text-white);
  border: none;
  font-size: 10px;
  font-weight: 700;
  padding: 6px 0;
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Qty Counter control inside form */
.qty-counter-input {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  border: 1.5px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  height: 52px;
}

.qty-btn {
  background-color: var(--bg-app);
  border: none;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
}

.qty-btn:active {
  background-color: var(--border-light);
}

.qty-counter-input input {
  border: none !important;
  text-align: center;
  padding: 0 !important;
  font-size: 18px !important;
  font-weight: 700 !important;
}

/* ==========================================================================
   Scrollbars
   ========================================================================== */

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.2);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.4);
}
