/* 
  Kho Sỉ Ăn Vặt 1989 - Staff Mobile APK POS Style
  Full-Screen Responsive for all Android Devices & Screen Heights
*/

:root {
  --bg-main: #0d1117;
  --bg-card: #161b22;
  --bg-card-hover: #21262d;
  --border-color: #30363d;
  --primary: #f0883e;
  --primary-hover: #ff9a4d;
  --accent-blue: #58a6ff;
  --accent-green: #3fb950;
  --accent-red: #f85149;
  --accent-yellow: #d29922;
  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --radius: 12px;
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-stack);
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow: hidden;
  user-select: none;
}

/* APP FULL-SCREEN CONTAINER (STRETCHES 100% ACROSS ENTIRE DEVICE DISPLAY) */
.app-screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-main);
  overflow: hidden;
}

/* TOP APP BAR */
.app-bar {
  flex: 0 0 auto;
  background: rgba(22, 27, 34, 0.98);
  backdrop-filter: blur(10px);
  padding: calc(32px + env(safe-area-inset-top, 0px)) 16px 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
}

.app-branding {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-icon {
  font-size: 24px;
  background: rgba(240, 136, 62, 0.15);
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(240, 136, 62, 0.3);
}

.app-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.app-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.live-indicator-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: #21262d;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

.shift-badge-btn {
  background: linear-gradient(135deg, rgba(63, 185, 80, 0.15), rgba(88, 166, 255, 0.15));
  border: 1px solid rgba(63, 185, 80, 0.4);
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

.shift-badge-btn strong {
  color: var(--accent-green);
}

/* CONTENT SCROLL AREA (FILLS ENTIRE AVAILABLE VERTICAL SPACE) */
.content-scroll-area {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 12px 16px 12px;
}

/* TABS */
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* STICKY SEARCH & FILTERS */
.sticky-controls {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-main);
  padding-bottom: 6px;
}

.search-field {
  background: #161b22;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 8px;
}

.search-icon {
  margin-right: 8px;
  font-size: 14px;
}

.search-field input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 14px;
  outline: none;
}

.btn-clear {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
}

/* SUPPLIER & CATEGORY ROW */
.supplier-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.sup-pill {
  flex: 1;
  padding: 6px 4px;
  background: #21262d;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.sup-pill.active {
  background: rgba(240, 136, 62, 0.2);
  border-color: var(--primary);
  color: #fff;
}

.chip-scroll-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 6px;
  scrollbar-width: none;
}

.chip-scroll-row::-webkit-scrollbar {
  display: none;
}

.chip-pill {
  white-space: nowrap;
  background: #161b22;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
}

.chip-pill.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
  font-weight: 600;
}

.meta-ribbon {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  padding: 2px 4px;
}

.meta-ribbon strong {
  color: var(--text-main);
}

/* PRODUCT CARD FEED */
.product-feed-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.prod-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.1s ease, border-color 0.2s;
}

.prod-card:active {
  transform: scale(0.99);
}

.prod-card-top {
  display: flex;
  gap: 10px;
}

.prod-thumb {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: #21262d;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.prod-info {
  flex: 1;
  min-width: 0;
}

.prod-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 3px;
  white-space: normal;
}

.prod-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stock-tag {
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}
.stock-tag.in-stock { background: rgba(63, 185, 80, 0.2); color: var(--accent-green); }
.stock-tag.low-stock { background: rgba(210, 153, 34, 0.2); color: var(--accent-yellow); }
.stock-tag.out-stock { background: rgba(248, 81, 73, 0.2); color: var(--accent-red); }

/* 4-TIER PRICE GRID */
.price-grid-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: #0d1117;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid #21262d;
}

.price-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.price-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.price-val {
  font-size: 12px;
  font-weight: 700;
}

.price-item.cost .price-label { color: var(--accent-yellow); }
.price-item.cost .price-val { color: var(--accent-yellow); }

.price-item.sl .price-label { color: var(--accent-green); }
.price-item.sl .price-val { color: var(--accent-green); }

.price-item.retail .price-label { color: var(--accent-blue); }
.price-item.retail .price-val { color: var(--accent-blue); }

.price-item.shopee .price-label { color: var(--primary); }
.price-item.shopee .price-val { color: var(--primary); }

/* CARD ACTION BUTTON */
.btn-pos-action {
  background: linear-gradient(135deg, var(--primary), #e06c1b);
  color: #fff;
  border: none;
  padding: 9px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(240, 136, 62, 0.3);
}

/* BOTTOM NAVIGATION FULL WIDTH AT BOTTOM OF FLEX */
.bottom-nav {
  flex: 0 0 auto;
  width: 100%;
  background: #161b22;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 4px calc(14px + env(safe-area-inset-bottom, 0px)) 4px;
  z-index: 100;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
  padding: 4px 2px;
  border-radius: 8px;
  white-space: nowrap;
}

.nav-btn .nav-icon {
  font-size: 19px;
  transition: transform 0.15s ease;
}

.nav-btn.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  font-weight: 700;
}

.nav-btn.active .nav-icon {
  transform: scale(1.15);
}

/* BOTTOM SHEET MODAL FULL WIDTH */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
}

.modal-backdrop.open {
  display: flex !important;
}

#changeProductImageModal {
  z-index: 99999 !important;
}

#hdImageViewerModal {
  z-index: 99999 !important;
}

#editOrderModal {
  z-index: 99999 !important;
}

#productDetailModal {
  z-index: 9999 !important;
}

.modal-sheet {
  background: #161b22;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 16px 18px 75px 18px;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: #484f58;
  border-radius: 2px;
  margin: 0 auto 12px auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.pos-prod-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.pos-prod-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

/* POS FORM SECTIONS */
.pos-section {
  margin-bottom: 14px;
}

.pos-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.qty-selector-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-qty {
  width: 42px;
  height: 42px;
  background: #21262d;
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

.input-qty {
  width: 60px;
  height: 42px;
  background: #0d1117;
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 8px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}

.quick-qty-group {
  display: flex;
  gap: 4px;
  margin-left: 4px;
  flex: 1;
}

.btn-quick-qty {
  flex: 1;
  background: #21262d;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

/* PRICE TIER SELECTION */
.price-tier-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.price-tier-btn {
  background: #0d1117;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  cursor: pointer;
  text-align: left;
}

.price-tier-btn.active {
  background: rgba(240, 136, 62, 0.15);
  border-color: var(--primary);
}

.tier-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.tier-val {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
}

.custom-price-box {
  margin-top: 8px;
  background: #0d1117;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--primary);
}

.custom-price-box label {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.custom-price-box input {
  width: 100%;
  padding: 8px;
  background: #161b22;
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-input {
  width: 100%;
  padding: 9px 12px;
  background: #0d1117;
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
}

/* BILL SUMMARY BOX */
.bill-summary-box {
  background: #0d1117;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
}

.bill-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.bill-row.highlight-total {
  font-size: 15px;
  color: #fff;
  font-weight: 700;
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
  margin-top: 6px;
}

.bill-row.highlight-total strong {
  color: var(--accent-green);
  font-size: 16px;
}

.green-text {
  color: var(--accent-green);
  font-weight: 600;
}

.btn-confirm-sale {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-green), #2ea043);
  color: #fff;
  border: none;
  padding: 13px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(63, 185, 80, 0.4);
}

/* SHIFT HISTORY TAB */
.shift-summary-card {
  background: linear-gradient(135deg, #161b22, #1c2128);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
}

.shift-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.shift-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.kpi-box {
  background: #0d1117;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #21262d;
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 11px;
  color: var(--text-muted);
}

.kpi-val {
  font-size: 16px;
  font-weight: 700;
  margin-top: 3px;
}

.kpi-val.highlight { color: #fff; }
.kpi-val.green { color: var(--accent-green); }
.kpi-val.blue { color: var(--accent-blue); }
.kpi-val.yellow { color: var(--accent-yellow); }

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.btn-refresh-orders {
  background: #21262d;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
}

.shift-orders-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shift-order-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 12px;
}

.soc-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.soc-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 30px 10px;
  font-size: 13px;
}

/* TOAST POPUP */
.toast-popup {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #238636;
  color: #fff;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
  opacity: 0;
  z-index: 300;
  pointer-events: none;
}

.toast-popup.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.audit-reason-btn {
  background: #21262d;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.audit-reason-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #fff;
  font-weight: 600;
}

/* FLOATING MULTI-ITEM CART BAR */
.floating-cart-bar {
  position: fixed;
  bottom: 66px;
  left: 12px;
  right: 12px;
  background: linear-gradient(135deg, #097937, #0d9648);
  border: 1.5px solid #3fb950;
  border-radius: 16px;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(63, 185, 80, 0.4);
  z-index: 150;
  cursor: pointer;
  animation: bounceIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceIn {
  from { transform: translateY(50px) scale(0.9); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.cart-bar-info {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}

.cart-bar-badge {
  background: #fff;
  color: #097937;
  font-size: 13px;
  font-weight: 800;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.cart-bar-title {
  font-size: 13px;
  font-weight: 700;
}

.cart-bar-sub {
  font-size: 11px;
  opacity: 0.9;
}

.cart-bar-btn {
  background: #fff;
  color: #097937;
  border: none;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* CARD ACTION BUTTONS GROUP (ADD TO CART + QUICK BUY) */
.card-action-group {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.btn-add-cart {
  flex: 1;
  background: #21262d;
  border: 1px solid #38bdf8;
  color: #38bdf8;
  padding: 9px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-add-cart:active {
  background: rgba(56, 189, 248, 0.2);
  transform: scale(0.97);
}

.btn-quick-buy {
  flex: 1.2;
  background: linear-gradient(135deg, #f0883e, #d26a27);
  border: none;
  color: #fff;
  padding: 9px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(240, 136, 62, 0.3);
}

/* INVENTORY RICH CARDS (TAB 3 TỒN KHO) */
.inv-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s, border-color 0.15s;
  cursor: pointer;
}

.inv-card:active {
  border-color: #38bdf8;
  background: #1c2128;
}

.inv-card-top {
  display: flex;
  gap: 10px;
}

.inv-card-thumb-box {
  width: 58px;
  height: 58px;
  background: #0d1117;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 26px;
}

.inv-card-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inv-card-meta {
  flex: 1;
  min-width: 0;
}

.inv-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inv-card-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.inv-card-prices {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: #0d1117;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #21262d;
  font-size: 10.5px;
  text-align: center;
}

.inv-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.btn-inv-action {
  flex: 1;
  padding: 7px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}

.btn-inv-detail {
  background: #21262d;
  border: 1px solid #38bdf8;
  color: #38bdf8;
}

.btn-inv-edit {
  background: #21262d;
  border: 1px solid #f0883e;
  color: #f0883e;
}

.btn-inv-cart {
  background: #238636;
  border: none;
  color: #fff;
}

/* MULTI-ITEM CART MODAL ROWS */
.cart-items-scroll {
  max-height: 40vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
  margin-bottom: 12px;
}

.cart-item-row {
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.cart-item-thumb {
  width: 46px;
  height: 46px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: #161b22;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 20px;
  flex-shrink: 0;
}

.cart-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-tier-select {
  background: #161b22;
  border: 1px solid var(--border-color);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 3px;
  width: 100%;
}

.cart-item-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cart-btn-step {
  width: 26px;
  height: 26px;
  background: #21262d;
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cart-inp-qty {
  width: 38px;
  height: 26px;
  text-align: center;
  background: #161b22;
  border: 1px solid var(--border-color);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 4px;
}

.cart-btn-del {
  background: transparent;
  border: none;
  color: #f85149;
  font-size: 16px;
  padding: 4px;
  cursor: pointer;
}

/* PRODUCT FULL DETAIL MODAL */
.prod-detail-img-box {
  width: 100%;
  height: 200px;
  background: #0d1117;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  margin-bottom: 12px;
}

.prod-detail-img-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.prod-detail-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  font-size: 12px;
}

.prod-detail-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #21262d;
}

.prod-detail-table td:first-child {
  color: var(--text-muted);
  width: 38%;
}

.prod-detail-table td:last-child {
  color: #fff;
  font-weight: 600;
}

/* TAB 2 & 3: RICH INVENTORY CARDS */
.inventory-audit-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 24px;
}

.inv-card {
  background: #161b22;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.inv-card:active {
  border-color: #38bdf8;
  transform: scale(0.99);
}

.inv-card-top {
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
}

.inv-card-thumb-box {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: #0d1117;
  border: 1px solid #30363d;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.inv-card-meta {
  flex: 1;
  min-width: 0;
}

.inv-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.inv-card-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.inv-card-prices {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: #0d1117;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #21262d;
  text-align: center;
  cursor: pointer;
}

.inv-card-prices strong {
  font-size: 11.5px;
  display: block;
}

.inv-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.btn-inv-action {
  flex: 1;
  padding: 7px 4px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: #21262d;
  color: #fff;
  text-align: center;
  transition: all 0.15s ease;
}

.btn-inv-detail {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.08);
}

.btn-inv-edit {
  color: #f0883e;
  border-color: rgba(240, 136, 62, 0.4);
  background: rgba(240, 136, 62, 0.08);
}

.btn-inv-cart {
  color: #3fb950;
  border-color: rgba(63, 185, 80, 0.4);
  background: rgba(63, 185, 80, 0.12);
}

/* MULTI-ITEM SHOPPING CART STYLES */
.cart-items-scroll {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.cart-item-row {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 10px;
  padding: 8px 10px;
}

.cart-item-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #161b22;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 20px;
}

.cart-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.cart-item-tier-select {
  background: #161b22;
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 6px;
  font-size: 11px;
  padding: 3px 6px;
  outline: none;
  font-weight: 600;
}

.cart-item-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cart-btn-step {
  width: 28px;
  height: 28px;
  background: #21262d;
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.cart-inp-qty {
  width: 38px;
  height: 28px;
  background: #161b22;
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 6px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
}

.cart-btn-del {
  background: rgba(248, 81, 73, 0.15);
  border: 1px solid rgba(248, 81, 73, 0.4);
  color: #f85149;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   APPLE IOS & PWA STANDALONE OPTIMIZATIONS
   Safe Area Insets (Dynamic Island / Notch / Home Bar) & iOS Touch Momentum
   ========================================================================== */

/* Top Bar: Adaptive Safe Area for iPhone Notch & Dynamic Island */
.app-bar {
  padding-top: max(14px, calc(10px + env(safe-area-inset-top, 0px))) !important;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Bottom Navigation Bar: Adaptive Safe Area for iPhone Home Indicator Bar */
.bottom-nav {
  padding-bottom: max(10px, env(safe-area-inset-bottom, 0px)) !important;
  padding-left: max(10px, env(safe-area-inset-left, 0px));
  padding-right: max(10px, env(safe-area-inset-right, 0px));
}

/* Bottom Floating Cart Bar */
.floating-cart-bar {
  bottom: calc(65px + max(6px, env(safe-area-inset-bottom, 0px))) !important;
}

/* Modal Bottom Sheets: Padding for iOS Home Bar */
.modal-sheet {
  padding-bottom: max(20px, calc(16px + env(safe-area-inset-bottom, 0px))) !important;
  -webkit-overflow-scrolling: touch;
}

/* Touch Performance & Momentum Scrolling for iOS Safari & Standalone WebApp */
.tab-panel,
.cart-items-scroll,
.product-feed-list,
.rich-inventory-cards {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

img, button, .nav-btn, .prod-card {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}


