
    :root {
      --bg: #f8fafc;
      --glass: rgba(255, 255, 255, 0.7);
      --glass-heavy: rgba(255, 255, 255, 0.95);
      --glass-border: rgba(255, 255, 255, 0.6);
      --text: #0f172a;
      --text-muted: #64748b;
      --accent: #3b82f6;
      --success: #10b981;
      --danger: #ef4444;
      --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
    }

    * { box-sizing: border-box; }
    
    :root {
      --font-main: 'Hind Siliguri', 'SolaimanLipi', 'Noto Sans Bengali', 'Nirmala UI', system-ui, -apple-system, sans-serif;
      --font-mono: ui-monospace, Consolas, 'Courier New', monospace;
    }

    * { box-sizing: border-box; }

    html, body, input, button, select, textarea {
      font-family: var(--font-main);
    }
    
    body {
      margin: 0; padding: 0; min-height: 100vh;
      background-color: var(--bg);
      
      
      color: var(--text);
      font-family: var(--font-main);
      overflow-x: hidden; line-height: 1.5; font-size: 14px;
    }

    

    .container { max-width: 850px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
    
    .modes {
      display: flex; gap: 4px; background: rgba(0, 0, 0, 0.05);
      padding: 4px; border-radius: 16px; border: 1px solid rgba(0,0,0,0.05);
    }
    .modes button {
      padding: 10px 20px; border: none; background: transparent;
      color: var(--text-muted); border-radius: 12px;
      cursor: pointer; font-weight: 700; font-size: 13px;
      transition: all 0.3s;
    }
    .modes button.active { background: #fff; color: var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,0.05); }

    .btn-add {
      background: var(--success); color: white;
      border: none; padding: 10px 20px; border-radius: 14px;
      font-weight: 800; cursor: pointer; font-size: 13px;
      display: flex; align-items: center; gap: 6px;
    }

    /* Floating Search */
    .search-wrapper {
      position: fixed; left: 16px; right: 16px; max-width: 818px; margin: 0 auto;
      z-index: 150; transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    .search-glass {
      display: flex; align-items: center;
      background: var(--glass-heavy); backdrop-filter: blur(16px);
      border: 1px solid var(--glass-border); border-radius: 20px;
      padding: 6px 16px; box-shadow: var(--shadow);
    }
    .search-glass svg { width: 22px; height: 22px; stroke: var(--text-muted); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; fill: none; margin-right: 12px; }
    #q {
      flex: 1; border: none; background: transparent; padding: 14px 0;
      font-size: 18px; color: var(--text); outline: none; font-weight: 600;
    }
    #q::placeholder { color: #94a3b8; font-weight: 500; }
    #clear {
      background: rgba(0,0,0,0.05); border: none; border-radius: 50%;
      width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
      color: var(--text-muted); cursor: pointer; font-size: 16px; transition: 0.2s;
    }
    #clear:hover { background: rgba(0,0,0,0.1); color: var(--text); }

    @media (max-width: 650px) {
      .search-wrapper { top: 76px; transform: translateY(calc(100vh - 200px - env(safe-area-inset-bottom))); }
      .search-wrapper.active { transform: translateY(0); }
    }
    @media (min-width: 651px) {
      .search-wrapper { top: 76px; transform: translateY(0); }
    }

    .suggestions { 
      position: fixed; top: 145px; left: 0; right: 0; bottom: 0; 
      z-index: 110; padding: 12px; display: flex; justify-content: center; 
      align-items: flex-start; pointer-events: none; opacity: 0; transition: opacity 0.2s;
    }
    .suggestions:not(.hidden) { opacity: 1; pointer-events: auto; }
    .suggestions-backdrop {
      position: fixed; inset: 0; z-index: -1;
      background: #f8fafc; /* Solid to completely hide background */
    }

    .glass-panel {
      background: var(--glass-heavy);
      border: 1px solid #fff;
      border-radius: 24px; overflow: hidden;
      box-shadow: var(--shadow);
      width: 100%; max-width: 850px; display: flex; flex-direction: column;
      max-height: calc(100dvh - 160px); pointer-events: auto;
    }

    .list { overflow-y: auto; overflow-x: hidden; padding: 10px; display: flex; flex-direction: column; gap: 10px; flex: 1; max-height: calc(100dvh - 170px); }
    
    .row {
      display: flex; align-items: center; justify-content: space-between; gap: 12px;
      padding: 14px; border: 1px solid rgba(0,0,0,0.05);
      border-radius: 16px; background: #fff;
      cursor: pointer; transition: all 0.2s; min-height: 56px;
    }
    .row:hover { background: #f8fafc; transform: scale(1.01); border-color: var(--accent); box-shadow: 0 4px 12px rgba(59,130,246,0.1); }
    .row.active { background: #eff6ff; border-color: var(--accent); }

    .name { font-size: 16px; font-weight: 800; color: var(--text); line-height: 1.2; }
    .sub { font-size: 13px; color: var(--text-muted); font-weight: 600; margin-top: 4px; }
    .pt-mrp { background: #f8fafc; color: var(--text-muted); border: 1px solid rgba(0,0,0,0.05); }
    .pt-retail { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
    .pt-buy { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
    .tabs { display: flex; gap: 8px; margin-bottom: 20px; background: #fff; padding: 6px; border-radius: 16px; border: 1px solid rgba(0,0,0,0.05); box-shadow: 0 4px 10px rgba(0,0,0,0.02); }
    .tab-btn { flex: 1; padding: 12px; border: none; background: transparent; border-radius: 12px; font-weight: 800; color: var(--text-muted); cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; }
    .tab-btn.active { background: #f8fafc; color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,0.05); border: 1px solid rgba(0,0,0,0.05); }
    .tab-content { display: none; }
    .tab-content.active { display: block; animation: fadeIn 0.3s ease; }
    @keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

    .prices-inline { margin-left: auto; display: flex; gap: 8px; align-items: center; }
    .price-tag { display: flex; flex-direction: column; align-items: center; padding: 6px 4px; border-radius: 10px; font-family: ui-monospace, Consolas, monospace; position: relative; }
    .price-tag .lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.7; }
    .price-tag .val { font-size: 15px; font-weight: 800; margin-top: 2px; }
    .profit-badge { position: absolute; top: -8px; right: -4px; font-size: 9px; padding: 2px 6px; border-radius: 8px; font-weight: 800; z-index: 5; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
    .profit-badge.good { background: #10b981; color: #fff; }
    .profit-badge.bad { background: #ef4444; color: #fff; }
    
    .item-
    .quick-add { background: #eff6ff; color: var(--accent); border: 1px solid #bfdbfe; width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; margin-left: 10px; flex-shrink: 0; }
    .quick-add:hover { background: var(--accent); color: #fff; }
    
    /* Hide Buy Price globally if in SELL mode using a simple CSS class toggle on body */
    body.mode-sell .pt-buy { opacity: 0.3; filter: grayscale(100%); }


    main { padding: 20px 16px 120px; max-width: 850px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; min-height: 50vh; }

    .item-card {
      background: var(--glass-heavy); backdrop-filter: blur(20px);
      border: 1px solid #fff; border-radius: 28px;
      padding: 28px; box-shadow: var(--shadow);
      animation: slideUp 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    @keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

    .card-
    .name-edit-group { display: flex; flex-direction: column; gap: 6px; }
    .label-small { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
    
    .input-name-bn { font-size: 22px; font-weight: 800; color: var(--text); border: none; background: transparent; width: 100%; outline: none; line-height: 1.3; white-space: pre-wrap; }
    .input-name-en { font-size: 16px; font-weight: 600; color: var(--text-muted); border: none; background: transparent; width: 100%; outline: none; }
    
    .input-name-bn:not([readonly]), .input-name-en:not([readonly]) {
      background: #fff; border-radius: 10px; padding: 10px 14px; border: 1px solid rgba(0,0,0,0.1); box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    }

    .price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
    
    .price-block {
      background: #fff; border: 1px solid rgba(0,0,0,0.05); box-shadow: 0 4px 10px rgba(0,0,0,0.02);
      border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 8px;
      transition: 0.3s; position: relative; overflow: hidden;
    }
    
    .price-block .label { font-size: 13px; font-weight: 700; color: var(--text-muted); z-index: 2; }
    .price-block .val-input { 
      background: transparent; border: none; color: var(--text); 
      font-size: 24px; font-weight: 800; width: 100%; outline: none; 
      font-family: ui-monospace, Consolas, monospace; z-index: 2;
    }
    
    .block-mrp { background: linear-gradient(145deg, #ffffff, #f8fafc); border-top: 4px solid var(--accent); }
    .block-retail { background: linear-gradient(145deg, #ffffff, #f0fdf4); border-top: 4px solid var(--success); }
    .block-buy { background: linear-gradient(145deg, #ffffff, #fef2f2); border-top: 4px solid var(--danger); }
    .block-buy .val-input { color: var(--danger); }
    .block-retail .val-input { color: var(--success); }

    .supplier-box { 
      margin-top: 20px; background: #f8fafc; padding: 18px; 
      border-radius: 20px; border: 1px dashed rgba(0,0,0,0.1);
    }

    .history-section { margin-top: 30px; }
    .history-title { font-size: 14px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
    .history-title::after { content: ''; flex: 1; height: 1px; background: rgba(0,0,0,0.05); }

    .history-row {
      display: flex; flex-wrap: wrap; gap: 12px; padding: 14px; background: #fff;
      border-radius: 16px; border: 1px solid rgba(0,0,0,0.05); margin-bottom: 10px;
      align-items: center;
    }
    .hist-date { font-size: 13px; font-weight: 700; color: var(--accent); min-width: 90px; }
    .hist-vals { flex: 1; font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: 14px; color: var(--text); }
    .hist-sup { font-size: 12px; color: var(--text-muted); font-weight: 500; width: 100%; margin-top: 4px; border-top: 1px solid rgba(0,0,0,0.05); padding-top: 6px; }

    .card-actions { display: flex; gap: 12px; margin-top: 30px; }
    .card-actions button {
      flex: 1; padding: 16px; border-radius: 16px; font-weight: 700;
      cursor: pointer; border: none; font-size: 15px; transition: 0.2s;
      display: flex; align-items: center; justify-content: center; gap: 8px;
    }
    .btn-primary { background: linear-gradient(135deg, var(--accent), #2563eb); color: white; box-shadow: 0 4px 15px rgba(59,130,246,0.3); }
    .btn-secondary { background: #fff; color: var(--text); border: 1px solid rgba(0,0,0,0.1); }
    .card-actions button:hover { transform: translateY(-2px); }

    .hidden { display: none !important; }
    .cart-panel { margin-bottom: 0; }
    .cart-head { display:flex; align-items:center; justify-content: space-between; margin-bottom:12px; }
    .cart-title { font-size:18px; font-weight:800; color: var(--text); display: flex; align-items: center; gap: 8px; }
    .cart-list { display:flex; flex-direction:column; gap:10px; }
    .cart-row { display:flex; align-items:center; gap:10px; padding:14px; border:1px solid rgba(0,0,0,0.05); background: #fff; border-radius:16px; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
    .cart-name { font-weight:700; color: var(--text); min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .qty { display:flex; align-items:center; gap:8px; margin-left:auto; background: #f1f5f9; padding: 4px; border-radius: 10px; flex-shrink:0; }
    .qty-btn { width:28px; height:28px; border:none; border-radius:8px; background: #fff; color:var(--text); cursor:pointer; font-weight: bold; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
    .cart-amount { width:85px; text-align:right; font-family: ui-monospace, Consolas, monospace; font-weight: 700; color: var(--accent); }
    .cart-foot { display:flex; align-items:center; justify-content: space-between; margin-top:16px; padding-top: 16px; border-top: 2px dashed rgba(0,0,0,0.05); }
    .btn-clear { background: #f1f5f9; border:none; color:var(--text-muted); padding:8px 16px; border-radius:12px; font-weight: 700; cursor: pointer; }
    .btn-checkout { background: linear-gradient(135deg, var(--success), #059669); color:#fff; border:none; padding:12px 24px; border-radius:14px; font-weight: 800; font-size: 15px; box-shadow: 0 4px 15px rgba(16,185,129,0.3); cursor: pointer; }
    .inline-qty { display:flex; align-items:center; gap:6px; background: #f1f5f9; padding: 4px; border-radius: 10px; }
    .inline-qty .qty-btn { width:28px; height:28px; border:none; border-radius:8px; background:#fff; color:var(--text); cursor:pointer; font-weight:bold; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
    .inline-qty .qty-val { min-width: 20px; text-align:center; font-weight:700; }
    
    .section-title { font-size: 16px; font-weight: 800; color: var(--text-muted); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

    .modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow-y: auto; }
    .modal-backdrop.hidden { display: none; }
    .details-modal { margin: auto; width: 100%; max-width: 850px; background-color: var(--bg);   position: relative; max-height: 90vh; overflow-y: auto; }
    .modal-panel { width: 100%; max-width: 720px; padding: 16px; border-radius: 24px; }
    .rev-
    .rev-body { display:flex; flex-direction: column; gap: 10px; }

    @media (max-width: 650px) {
      .row { flex-direction: column; align-items: flex-start; padding: 14px 12px; gap: 10px; height: auto; min-height: auto; }
      .row-left { width: 100%; padding-right: 0 !important; }
      .row-right { width: 100% !important; display: flex; flex-direction: row !important; justify-content: space-between !important; align-items: center; gap: 8px; }
      .prices-inline { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
      .price-tag { padding: 6px 2px; text-align: center; align-items: center; min-width: 0; }
      .price-tag .lbl { font-size: 9px; }
      .price-tag .val { font-size: 13px; }
      .profit-badge { position: static; top: auto; right: auto; margin-top: 2px; }
      .quick-add { margin-left: 0; width: 36px; height: 36px; flex-shrink: 0; }
      .price-grid { grid-template-columns: 1fr; gap: 12px; }
      .suggestions { top: 130px; padding: 8px; }
      .glass-panel { max-height: calc(100dvh - 140px); }
      .list { max-height: calc(100dvh - 140px); padding: 8px; }
      .input-name-bn { font-size: 22px; }
      .input-name-en { font-size: 15px; }
      .price-block .val-input { font-size: 20px; }
      .item-card { padding: 20px; }
      .suggestions .glass-panel { border-radius: 0; border-left: none; border-right: none; border-bottom: none; }
    }
  
/* ===== Modern Item Details Modal Styling ===== */
@media (max-width: 768px) {
  .modal-backdrop {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
  }
  .item-card.details-modal, .details-modal, #add-card, #result-modal .item-card {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    padding: 14px !important;
  }
  .price-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .price-block {
    padding: 10px !important;
    border-radius: 12px !important;
  }
}

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(8px);
  z-index: 500; display: flex; align-items: center; justify-content: center; padding: 16px;
  overflow-y: auto;
}
.modal-backdrop.hidden { display: none !important; }

.item-card.details-modal {
  margin: auto; width: 100%; max-width: 780px;
  background: #111827 !important; border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 24px !important; box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8) !important;
  padding: 24px !important; color: #f8fafc !important;
  max-height: 90vh; overflow-y: auto;
}

body:not(.theme-dark) .item-card.details-modal {
  background: #ffffff !important; border-color: rgba(0, 0, 0, 0.1) !important;
  color: #0f172a !important; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2) !important;
}

.card-header-modern {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08); padding-bottom: 16px;
}
body:not(.theme-dark) .card-header-modern { border-bottom-color: rgba(0, 0, 0, 0.08); }

.btn-icon-close {
  width: 38px; height: 38px; min-width: 38px; min-height: 38px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s;
}
.btn-icon-close:hover { background: rgba(239, 68, 68, 0.2); color: #ef4444; border-color: rgba(239, 68, 68, 0.4); }

.input-name-bn {
  font-family: 'Hind Siliguri', system-ui, sans-serif !important;
  font-size: 22px !important; font-weight: 800 !important;
  color: #ffffff !important; border: none !important; background: transparent !important;
  width: 100% !important; outline: none !important;
}
body:not(.theme-dark) .input-name-bn { color: #0f172a !important; }

.input-name-en {
  font-family: 'Hind Siliguri', system-ui, sans-serif !important;
  font-size: 14px !important; font-weight: 600 !important;
  color: #94a3b8 !important; border: none !important; background: transparent !important;
  width: 100% !important; outline: none !important;
}

.price-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px;
}

.price-block {
  background: #1f2937 !important; border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 16px !important; padding: 14px !important;
}
body:not(.theme-dark) .price-block {
  background: #f8fafc !important; border-color: rgba(0, 0, 0, 0.08) !important;
}

.price-block.block-mrp { border-top: 3px solid #64748b !important; }
.price-block.block-retail {
  border-top: 3px solid #10b981 !important;
  background: linear-gradient(145deg, #1f2937, rgba(16, 185, 129, 0.15)) !important;
}
body:not(.theme-dark) .price-block.block-retail {
  background: linear-gradient(145deg, #ffffff, #f0fdf4) !important;
}
.price-block.block-retail .val-input { color: #34d399 !important; font-size: 24px !important; font-weight: 800 !important; }
body:not(.theme-dark) .price-block.block-retail .val-input { color: #059669 !important; }

.price-block.block-buy {
  border-top: 3px solid #ef4444 !important;
  background: linear-gradient(145deg, #1f2937, rgba(239, 68, 68, 0.12)) !important;
}
body:not(.theme-dark) .price-block.block-buy {
  background: linear-gradient(145deg, #ffffff, #fef2f2) !important;
}
.price-block.block-buy .val-input { color: #f87171 !important; }
body:not(.theme-dark) .price-block.block-buy .val-input { color: #dc2626 !important; }

.price-block .val-input {
  width: 100%; border: none; background: transparent; outline: none;
  font-family: ui-monospace, Consolas, monospace; font-size: 20px; font-weight: 800;
  color: #f8fafc; margin-top: 6px;
}
body:not(.theme-dark) .price-block .val-input { color: #0f172a; }

.btn-secondary-modern {
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8; cursor: pointer; transition: all 0.2s;
}
.btn-secondary-modern:hover {
  background: rgba(59, 130, 246, 0.15); border-color: rgba(59, 130, 246, 0.3); color: #60a5fa;
}
body:not(.theme-dark) .btn-secondary-modern {
  background: #f1f5f9; border-color: #cbd5e1; color: #475569;
}

/* Dark mode contrast for active rows and counters */
body.theme-dark .row.active, .theme-dark .row.active {
  background: #1e293b !important;
  border-color: #60a5fa !important;
}
body.theme-dark .row.active .name, .theme-dark .row.active .name {
  color: #93c5fd !important;
}
body.theme-dark .inline-qty, .theme-dark .inline-qty {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
body.theme-dark .inline-qty .qty-btn, .theme-dark .inline-qty .qty-btn {
  background: #1e293b !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}
body.theme-dark .inline-qty .qty-val, .theme-dark .inline-qty .qty-val {
  color: #f8fafc !important;
}
body.theme-dark .suggestions-backdrop {
  background: #090d16 !important;
}


/* ===== Modern Shop Footer Styling ===== */
.shop-footer {
  margin-top: 60px;
  padding: 40px 24px 30px;
  background: rgba(15, 23, 42, 0.03);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-family: inherit;
}
body.theme-dark .shop-footer {
  background: rgba(15, 23, 42, 0.6);
  border-top-color: rgba(255, 255, 255, 0.08);
}
.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
}
.footer-heading {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-link-btn {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 8px 14px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
body.theme-dark .footer-link-btn {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}
.footer-link-btn:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--accent);
  transform: translateX(3px);
}
.footer-bottom {
  max-width: 1100px;
  margin: 30px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
body.theme-dark .footer-bottom {
  border-top-color: rgba(255, 255, 255, 0.06);
}
.footer-bottom .logo {
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-bottom .badge {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}
.footer-bottom .copyright {
  font-size: 12px;
  color: var(--text-muted);
}


/* ===== ALWAYS ON TOP SEARCH BAR ===== */
.search-wrapper {
  position: sticky !important;
  top: 58px !important;
  left: 0 !important;
  right: 0 !important;
  max-width: 850px !important;
  margin: 10px auto 12px !important;
  padding: 0 16px !important;
  z-index: 200 !important;
  transform: none !important;
  transition: none !important;
}
@media (max-width: 650px) {
  .search-wrapper {
    top: 52px !important;
    margin: 8px auto 10px !important;
    padding: 0 12px !important;
    transform: none !important;
  }
}
#q {
  flex: 1 !important;
  border: none !important;
  background: transparent !important;
  padding: 12px 0 !important;
  font-size: 16px !important;
  color: var(--text) !important;
  outline: none !important;
  font-weight: 600 !important;
  font-family: inherit !important;
}
#q:focus {
  position: static !important;
  transform: none !important;
  width: 100% !important;
}
.search-glass {
  display: flex !important;
  align-items: center !important;
  background: var(--glass-heavy) !important;
  backdrop-filter: blur(16px) !important;
  border: 1.5px solid rgba(59, 130, 246, 0.3) !important;
  border-radius: 18px !important;
  padding: 4px 16px !important;
  box-shadow: 0 6px 20px -4px rgba(0, 0, 0, 0.08) !important;
}
.search-glass:focus-within {
  border-color: var(--accent) !important;
  box-shadow: 0 8px 25px -4px rgba(59, 130, 246, 0.25) !important;
}
.suggestions { 
  position: fixed !important;
  top: 180px !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 78px !important; 
  z-index: 190 !important;
  padding: 8px 16px !important;
  display: flex !important;
  justify-content: center !important; 
  align-items: flex-start !important;
  pointer-events: none !important;
  opacity: 0 !important;
  transition: opacity 0.2s !important;
}
@media (max-width: 650px) {
  .suggestions {
    top: 215px !important;
    bottom: 80px !important;
    padding: 8px 12px !important;
  }
}
.suggestions:not(.hidden) { opacity: 1 !important; pointer-events: auto !important; }


    /* Clean Top Header Navigation Bar */
    header {
      position: sticky; top: 0; z-index: 220;
      background: rgba(255, 255, 255, 0.92);
      backdrop-filter: blur(16px);
      border-bottom: 1px solid rgba(0,0,0,0.06);
      padding: 8px 16px;
    }
    body.theme-dark header {
      background: rgba(15, 23, 42, 0.92);
      border-color: rgba(255, 255, 255, 0.08);
    }
    .appbar {
      max-width: 1200px; margin: 0 auto;
      display: flex; justify-content: space-between; align-items: center;
      gap: 12px;
    }
    .brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
    .brand-name { font-size: 18px; font-weight: 900; color: var(--text); letter-spacing: -0.3px; }
    .view-title { display: none !important; }

    .header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
    .header-actions button, .header-actions a {
      width: 34px; height: 34px; border-radius: 10px;
      border: 1px solid rgba(0,0,0,0.06); background: rgba(0,0,0,0.02);
      color: var(--text-muted); display: flex; align-items: center; justify-content: center;
      cursor: pointer; text-decoration: none; transition: all 0.15s ease;
    }
    body.theme-dark .header-actions button, body.theme-dark .header-actions a {
      border-color: rgba(255,255,255,0.08); background: rgba(255,255,255,0.04);
    }
    .header-actions button:hover, .header-actions a:hover {
      background: rgba(37,99,235,0.1); color: #2563eb; border-color: rgba(37,99,235,0.3);
    }

    .hdr-nav-btn {
      background: rgba(0,0,0,0.03); border: 1px solid rgba(0,0,0,0.06);
      padding: 6px 12px; border-radius: 10px; font-weight: 700; font-size: 12.5px;
      color: var(--text); display: inline-flex; align-items: center; gap: 6px;
      cursor: pointer; transition: all 0.15s ease; white-space: nowrap;
    }
    body.theme-dark .hdr-nav-btn {
      background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.08); color: #f8fafc;
    }
    .hdr-nav-btn:hover {
      background: rgba(37,99,235,0.08); color: #2563eb; border-color: rgba(37,99,235,0.25);
    }
    .hdr-nav-btn kbd {
      font-size: 10px; font-weight: 800; background: rgba(0,0,0,0.06);
      padding: 1px 4px; border-radius: 4px; opacity: 0.7; font-family: ui-monospace, monospace;
    }
    body.theme-dark .hdr-nav-btn kbd { background: rgba(255,255,255,0.1); }

    .hdr-dropdown {
      position: absolute; top: calc(100% + 6px); right: 0;
      background: var(--glass-heavy, #ffffff);
      border: 1px solid rgba(0,0,0,0.1); border-radius: 14px;
      box-shadow: 0 12px 30px -6px rgba(0,0,0,0.2);
      padding: 6px; min-width: 220px; z-index: 999;
      display: flex; flex-direction: column; gap: 2px;
      animation: scaleUpModal 0.15s ease-out;
    }
    body.theme-dark .hdr-dropdown {
      background: #1e293b; border-color: rgba(255,255,255,0.1);
    }
    .hdr-drop-item {
      background: transparent; border: none; padding: 8px 12px;
      text-align: left; font-size: 13px; font-weight: 700; color: var(--text);
      border-radius: 8px; cursor: pointer; transition: all 0.15s ease; width: 100%;
    }
    body.theme-dark .hdr-drop-item { color: #f8fafc; }
    .hdr-drop-item:hover {
      background: rgba(37,99,235,0.08); color: #2563eb;
    }


    /* ========================================================================= */
    /* 🌟 ENTERPRISE DISTINCT MOBILE & DESKTOP SEARCH ARCHITECTURE               */
    /* ========================================================================= */
    
    /* Search Wrapper Top Sticky Alignment */
    .search-wrapper {
      position: sticky !important;
      top: 58px !important;
      left: 0 !important;
      right: 0 !important;
      max-width: 850px !important;
      margin: 14px auto 18px !important;
      padding: 0 16px !important;
      z-index: 200 !important;
    }
    @media (max-width: 767px) {
      .search-wrapper {
        top: 54px !important;
        margin: 12px auto 16px !important;
        padding: 0 12px !important;
      }
    }

    .search-chips-bar {
      display: flex;
      gap: 6px;
      overflow-x: auto;
      padding: 8px 2px 4px;
      margin-bottom: 12px;
      scrollbar-width: none;
      -webkit-overflow-scrolling: touch;
    }
    .search-chips-bar::-webkit-scrollbar { display: none; }
    
    .search-chip {
      background: rgba(255, 255, 255, 0.7);
      border: 1px solid rgba(0, 0, 0, 0.08);
      border-radius: 999px;
      padding: 5px 12px;
      font-size: 12px;
      font-weight: 700;
      color: var(--text-muted);
      cursor: pointer;
      white-space: nowrap;
      transition: all 0.2s ease;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    body.theme-dark .search-chip {
      background: rgba(30, 41, 59, 0.8);
      border-color: rgba(255, 255, 255, 0.1);
      color: #94a3b8;
    }
    .search-chip:hover {
      background: rgba(59, 130, 246, 0.12);
      border-color: rgba(59, 130, 246, 0.3);
      color: var(--accent);
      transform: translateY(-1px);
    }
    .search-chip.active {
      background: #3b82f6 !important;
      border-color: #3b82f6 !important;
      color: #ffffff !important;
      box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    }

    /* Suggestions Bounds & Non-Blocking Dock Fix */
    .suggestions { 
      position: fixed !important;
      top: 180px !important;
      left: 0 !important;
      right: 0 !important;
      bottom: 78px !important; 
      z-index: 150 !important;
      padding: 8px 16px !important;
      display: none !important;
      justify-content: center !important; 
      align-items: flex-start !important;
      pointer-events: none !important;
      opacity: 0 !important;
      visibility: hidden !important;
      transition: opacity 0.2s !important;
    }
    .suggestions.hidden, #sugg.hidden {
      display: none !important;
      pointer-events: none !important;
      visibility: hidden !important;
    }
    .suggestions.hidden * {
      pointer-events: none !important;
    }
    .suggestions:not(.hidden) {
      display: flex !important;
      opacity: 1 !important;
      pointer-events: auto !important;
      visibility: visible !important;
    }
    
    @media (max-width: 767px) {
      .suggestions {
        top: 215px !important;
        bottom: 80px !important;
        padding: 8px 12px !important;
      }
    }

    .suggestions-backdrop {
      position: fixed !important;
      inset: 0 !important;
      z-index: -1 !important;
      background: rgba(241, 245, 249, 0.94) !important;
      backdrop-filter: blur(12px) !important;
      -webkit-backdrop-filter: blur(12px) !important;
    }
    body.theme-dark .suggestions-backdrop {
      background: rgba(11, 15, 23, 0.94) !important;
    }

    .glass-panel {
      background: var(--glass-heavy) !important;
      border: 1px solid rgba(255, 255, 255, 0.8) !important;
      border-radius: 20px !important;
      overflow: hidden !important;
      box-shadow: 0 20px 40px -10px rgba(0,0,0,0.15) !important;
      width: 100% !important;
      max-width: 850px !important;
      display: flex !important;
      flex-direction: column !important;
      height: 100% !important;
      max-height: 100% !important;
    }
    body.theme-dark .glass-panel {
      border-color: rgba(255, 255, 255, 0.1) !important;
    }

    .list {
      overflow-y: auto !important;
      overflow-x: hidden !important;
      padding: 10px !important;
      display: flex !important;
      flex-direction: column !important;
      gap: 8px !important;
      flex: 1 !important;
      height: 100% !important;
      max-height: 100% !important;
    }

    /* Cart + shell chrome sit below modals by design (see z-index scale in lib/pos.css) */

    /* Badge & Tag Styling (Zero Absolute Collisions) */
    .category-pill {
      font-size: 10.5px;
      font-weight: 700;
      color: #3b82f6;
      background: rgba(59, 130, 246, 0.1);
      border: 1px solid rgba(59, 130, 246, 0.2);
      padding: 2px 7px;
      border-radius: 6px;
      white-space: nowrap;
    }
    body.theme-dark .category-pill {
      background: rgba(59, 130, 246, 0.2);
      color: #93c5fd;
    }

    .stock-pill {
      font-size: 11px;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 6px;
      display: inline-flex;
      align-items: center;
      gap: 3px;
      white-space: nowrap;
    }
    .stock-ok { background: rgba(16, 185, 129, 0.12); color: #059669; border: 1px solid rgba(16, 185, 129, 0.25); }
    .stock-low { background: rgba(245, 158, 11, 0.12); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.25); }
    .stock-out { background: rgba(239, 68, 68, 0.12); color: #dc2626; border: 1px solid rgba(239, 68, 68, 0.25); }
    body.theme-dark .stock-ok { color: #34d399; }
    body.theme-dark .stock-low { color: #fbbf24; }
    body.theme-dark .stock-out { color: #f87171; }

    .margin-pill {
      font-size: 10.5px;
      font-weight: 800;
      color: #059669;
      background: rgba(16, 185, 129, 0.12);
      border: 1px solid rgba(16, 185, 129, 0.25);
      padding: 3px 7px;
      border-radius: 6px;
      white-space: nowrap;
      display: inline-flex;
      align-items: center;
    }
    body.theme-dark .margin-pill { color: #34d399; }

    .price-tag {
      display: inline-flex !important;
      flex-direction: row !important;
      align-items: center !important;
      gap: 4px !important;
      padding: 3px 8px !important;
      border-radius: 7px !important;
      font-size: 11.5px !important;
      font-weight: 700 !important;
      background: rgba(0,0,0,0.03) !important;
      border: 1px solid rgba(0,0,0,0.06) !important;
      white-space: nowrap !important;
      position: static !important;
    }
    body.theme-dark .price-tag {
      background: rgba(255,255,255,0.04) !important;
      border-color: rgba(255,255,255,0.08) !important;
    }
    .price-tag .lbl {
      font-size: 9.5px !important;
      opacity: 0.75 !important;
      text-transform: uppercase !important;
    }
    .price-tag .val {
      font-size: 12.5px !important;
      font-weight: 800 !important;
      margin: 0 !important;
    }
    .price-tag.pt-retail {
      background: #ecfdf5 !important;
      border-color: #a7f3d0 !important;
      color: #065f46 !important;
    }
    body.theme-dark .price-tag.pt-retail {
      background: rgba(16, 185, 129, 0.15) !important;
      border-color: rgba(16, 185, 129, 0.3) !important;
      color: #34d399 !important;
    }
    .price-tag.pt-buy {
      background: #fef2f2 !important;
      border-color: #fecaca !important;
      color: #991b1b !important;
    }
    body.theme-dark .price-tag.pt-buy {
      background: rgba(239, 68, 68, 0.15) !important;
      border-color: rgba(239, 68, 68, 0.3) !important;
      color: #f87171 !important;
    }

    .diff-badge {
      font-size: 9.5px !important;
      font-weight: 900 !important;
      padding: 1px 4px !important;
      border-radius: 4px !important;
      display: inline-block !important;
      margin-left: 2px !important;
      line-height: 1.1 !important;
      position: static !important;
    }
    .diff-badge.good { background: #10b981 !important; color: #ffffff !important; }
    .diff-badge.bad { background: #ef4444 !important; color: #ffffff !important; }

    /* ------------------------------------------------------------------------- */
    /* 🖥️ DESKTOP SPECIFIC RULES ( >= 768px )                                    */
    /* ------------------------------------------------------------------------- */
    @media (min-width: 768px) {
      .row.search-enhanced-row {
        display: grid !important;
        grid-template-columns: 1.4fr 1.6fr auto !important;
        align-items: center !important;
        gap: 14px !important;
        padding: 10px 16px !important;
        border-radius: 14px !important;
        background: #ffffff !important;
        border: 1px solid rgba(0, 0, 0, 0.07) !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02) !important;
        min-height: 60px !important;
        transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
      }
      body.theme-dark .row.search-enhanced-row {
        background: #1e293b !important;
        border-color: rgba(255, 255, 255, 0.08) !important;
      }
      .row.search-enhanced-row:hover {
        border-color: #3b82f6 !important;
        transform: translateY(-2px) scale(1.005) !important;
        box-shadow: 0 8px 22px rgba(59, 130, 246, 0.15) !important;
      }
      .row.search-enhanced-row.active {
        background: #eff6ff !important;
        border-color: #3b82f6 !important;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
      }
      body.theme-dark .row.search-enhanced-row.active {
        background: #1e3a8a !important;
        border-color: #60a5fa !important;
      }

      .row-mobile-top {
        display: contents !important;
      }

      .row-avatar {
        width: 44px !important;
        height: 44px !important;
        border-radius: 12px !important;
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(37, 99, 235, 0.05)) !important;
        border: 1.5px solid rgba(59, 130, 246, 0.2) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: relative !important;
        flex-shrink: 0 !important;
      }
      body.theme-dark .row-avatar {
        background: rgba(15, 23, 42, 0.6) !important;
        border-color: rgba(255, 255, 255, 0.12) !important;
      }
      .avatar-emoji { font-size: 22px !important; }

      .quick-num-badge {
        display: inline-block !important;
        margin-right: 4px !important;
        background: #0f172a !important;
        color: #38bdf8 !important;
        border: 1.5px solid #38bdf8 !important;
        font-size: 9px !important;
        font-weight: 900 !important;
        padding: 1px 4px !important;
        border-radius: 4px !important;
        font-family: monospace !important;
        line-height: 1 !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
      }

      .row-main-col {
        display: flex !important;
        flex-direction: column !important;
        gap: 2px !important;
        min-width: 0 !important;
      }
      .row-title-bar {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
      }
      .row-title-bar .name {
        font-size: 15px !important;
        font-weight: 800 !important;
        color: var(--text) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
      }
      .row-sub-bar .sub-bn {
        font-size: 12px !important;
        color: var(--text-muted) !important;
        font-weight: 600 !important;
      }

      .row-price-col {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        min-width: 0 !important;
      }
      .prices-inline {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        flex-wrap: wrap !important;
      }

      .row-actions-col {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        flex-shrink: 0 !important;
      }
      .quick-add-text { display: none !important; }
      
      .quick-add {
        background: #eff6ff !important;
        color: #2563eb !important;
        border: 1px solid #bfdbfe !important;
        width: 36px !important;
        height: 36px !important;
        border-radius: 10px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        transition: all 0.2s !important;
        flex-shrink: 0 !important;
      }
      .quick-add:hover {
        background: #2563eb !important;
        color: #ffffff !important;
        transform: scale(1.08) !important;
      }
    }

    /* ------------------------------------------------------------------------- */
    /* 📱 MOBILE SPECIFIC RULES ( < 768px )                                      */
    /* ------------------------------------------------------------------------- */
    @media (max-width: 767px) {
      /* Compact 2-line card: name row + price+actions row */
      .row.search-enhanced-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
        padding: 10px 12px !important;
        border-radius: 14px !important;
        background: #ffffff !important;
        border: 1px solid rgba(0, 0, 0, 0.07) !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03) !important;
        margin-bottom: 4px !important;
        flex-shrink: 0 !important;
        height: auto !important;
        min-height: fit-content !important;
      }
      body.theme-dark .row.search-enhanced-row {
        background: #1e293b !important;
        border-color: rgba(255, 255, 255, 0.08) !important;
      }
      .row.search-enhanced-row.active {
        background: #eff6ff !important;
        border-color: #3b82f6 !important;
      }
      body.theme-dark .row.search-enhanced-row.active {
        background: #1e3a8a !important;
        border-color: #60a5fa !important;
      }

      /* Line 1: name badge + name + stock pill */
      .row-main-col {
        flex: 0 0 auto !important;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 1px !important;
      }
      .row-title-bar {
        display: flex !important;
        align-items: center !important;
        gap: 5px !important;
        flex-wrap: nowrap !important;
        overflow: hidden !important;
      }
      .row-title-bar .name {
        font-size: 14.5px !important;
        font-weight: 800 !important;
        color: var(--text) !important;
        line-height: 1.3 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
      }
      .stock-pill {
        font-size: 10px !important;
        padding: 1px 5px !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
      }
      .row-sub-bar {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        min-height: 0 !important;
      }
      .row-sub-bar .sub-bn {
        font-size: 11px !important;
        color: var(--text-muted) !important;
        font-weight: 600 !important;
      }
      .quick-num-badge { display: none !important; }

      /* Line 2: price on left + stepper + cart button on right — all in ONE row */
      .row-price-col {
        display: none !important; /* merged into actions row */
      }
      .row-actions-col {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px !important;
        width: 100% !important;
        flex-wrap: nowrap !important;
      }

      /* Inline direct number entry + round plus action button */
      .inline-qty {
        display: inline-flex !important;
        align-items: center !important;
        background: rgba(0, 0, 0, 0.04) !important;
        border-radius: 12px !important;
        padding: 2px 4px 2px 6px !important;
        border: 1px solid rgba(0, 0, 0, 0.08) !important;
        gap: 4px !important;
        flex-shrink: 0 !important;
      }
      body.theme-dark .inline-qty {
        background: rgba(255, 255, 255, 0.05) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
      }
      .inline-qty .qty-btn.qty-plus {
        width: 36px !important;
        height: 36px !important;
        font-size: 20px !important;
        font-weight: 800 !important;
        border-radius: 10px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: none !important;
        background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
        color: #ffffff !important;
        cursor: pointer !important;
        box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3) !important;
        transition: transform 0.15s ease !important;
      }
      .inline-qty .qty-btn.qty-plus:active {
        transform: scale(0.92) !important;
      }
      .inline-qty-input {
        width: 48px !important;
        height: 34px !important;
        text-align: center !important;
        font-size: 14px !important;
        font-weight: 800 !important;
        border: none !important;
        background: transparent !important;
        color: var(--text) !important;
        padding: 0 !important;
      }
      .inline-qty-input:focus {
        background: rgba(59, 130, 246, 0.08) !important;
        border-radius: 6px !important;
      }

      /* Clean plus icon action button (no 'কার্টে যোগ' text) */
      .quick-add {
        width: 38px !important;
        height: 38px !important;
        border-radius: 10px !important;
        background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
        color: #ffffff !important;
        border: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25) !important;
        flex-shrink: 0 !important;
        cursor: pointer !important;
        transition: transform 0.15s ease !important;
      }
      .quick-add:active {
        transform: scale(0.92) !important;
      }
      .quick-add svg { width: 20px !important; height: 20px !important; stroke-width: 3 !important; }
      .quick-add-text { display: none !important; }

      /* Mobile price shown inside sub-bar */
      .row-mobile-price {
        font-size: 12px !important;
        font-weight: 800 !important;
        color: var(--success, #10b981) !important;
      }
      .row-mobile-buy {
        font-size: 11px !important;
        font-weight: 700 !important;
        padding: 1px 5px !important;
        border-radius: 6px !important;
        font-family: ui-monospace, Consolas, monospace !important;
        background: rgba(239, 68, 68, 0.08) !important;
        color: #ef4444 !important;
        border: 1px solid rgba(239, 68, 68, 0.15) !important;
        margin-left: 4px !important;
      }
      body.mode-sell .row-mobile-buy {
        opacity: 0.35 !important;
        filter: grayscale(100%) !important;
      }
      body.theme-dark .row-mobile-buy {
        background: rgba(239, 68, 68, 0.15) !important;
        color: #f87171 !important;
        border-color: rgba(239, 68, 68, 0.25) !important;
      }
    }

/* ===== Mobile best-experience pass (single 900px breakpoint) ===== */
/* Modals always above the floating cart bar (z 999); toasts stay on top. */
.modal-backdrop { z-index: 1200 !important; }

@media (max-width: 900px) {
  /* slim header: icon actions live in the More sheet on mobile */
  .header-actions { display: none !important; }
  .appbar { padding-top: 10px !important; padding-bottom: 10px !important; }
  /* touch: chips + small buttons to 44px */
  .search-chip, .cat-chip, .top-chip { min-height: 44px !important; padding-top: 10px !important; padding-bottom: 10px !important; font-size: 13px !important; }
  #clear { min-width: 44px !important; min-height: 44px !important; }
  .st-change-btn { min-height: 44px !important; padding-top: 8px !important; padding-bottom: 8px !important; }
  /* 16px inputs stop iOS auto-zoom on focus */
  .val-input, input[type="text"], input[type="number"], input[type="tel"], input[type="search"], input[type="password"], select, textarea { font-size: 16px !important; }
  /* cart header wraps instead of sideways overflow */
  .cart-head { display: flex; flex-wrap: wrap; gap: 8px; }
  .cart-head .btn-clear { flex: 1 1 30%; text-align: center; white-space: nowrap; }
  /* 44px touch targets on all steppers */
  .qty-btn, .inline-qty .qty-btn { min-width: 44px; min-height: 44px; font-size: 18px; }
  .cart-qty-input { min-height: 44px !important; font-size: 16px !important; min-width: 64px !important; }
  .qty { gap: 6px !important; }
  /* tender chips: 3-column thumb grid */
  .quick-tender-chip { flex: 1 1 30%; text-align: center; padding: 12px 6px !important; font-size: 14px !important; }
  /* paid input big enough to read while typing */
  #co-paid { font-size: 20px !important; padding: 12px 14px !important; }
  /* customer chips: horizontal snap row, compact */
  #co-chips { flex-wrap: nowrap !important; overflow-x: auto; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
  #co-chips .btn-secondary { flex-shrink: 0; font-size: 12px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* confirm in thumb reach */
  #checkout-confirm { padding: 16px !important; font-size: 17px !important; }
  /* checkout 3-col row (type/phone/nid) stacks comfortably */
  #checkout-modal .details-modal { padding: 18px !important; }
  /* search rows: roomier stepper */
  .qty-btn.qty-plus, .qty-btn.qty-minus { min-width: 44px; min-height: 44px; }
  /* cart-row wrap lives in pos.css section 9 (single source; it uses !important) */
  /* baki/khata cards: stack grid to one column so amounts never clip */
  .v3-section-card { grid-template-columns: 1fr !important; row-gap: 10px; }
}

/* ===== Morphing add control: one ADD button becomes the stepper once in cart ===== */
/* Kill tap delay everywhere (keeps pinch-zoom; viewport already allows user zoom). */
body { touch-action: manipulation; }
.row-actions-col .inline-qty { display: none !important; }
.row-actions-col.has-qty .inline-qty { display: flex !important; }
.row-actions-col.has-qty .quick-add { display: none !important; }
.row-actions-col .quick-add {
  width: auto !important; min-height: 44px !important; padding: 0 18px !important;
  gap: 6px !important; display: inline-flex !important; align-items: center !important;
  background: #059669 !important; border-color: #059669 !important; color: #fff !important;
  font-weight: 800 !important; border-radius: 12px !important;
}
.row-actions-col .quick-add svg { width: 16px; height: 16px; }
.row-actions-col .quick-add .qa-label { font-size: 13px; }
