/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface2: #222;
  --primary: #2196F3;
  --primary-dark: #1565C0;
  --accent: #00BCD4;
  --success: #4CAF50;
  --warning: #FF9800;
  --danger: #F44336;
  --text: #f0f0f0;
  --text-muted: #888;
  --border: #333;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
  --transition: 0.2s ease;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

.hidden { display: none !important; }

/* ===== Loading ===== */
.loading-screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--bg); z-index: 999;
  gap: 16px;
}

.spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== App Shell ===== */
.app {
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
  max-width: 480px; margin: 0 auto;
  position: relative;
}

/* ===== Top Bar ===== */
.topbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  min-height: 52px;
  position: sticky; top: 0; z-index: 10;
}

.back-btn {
  background: none; border: none; color: var(--primary);
  font-size: 22px; cursor: pointer; padding: 4px 8px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.topbar-logo {
  width: 120px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
  cursor: pointer;
}

.page-title {
  flex: 1; font-size: 16px; font-weight: 600;
  min-width: 0;
}

.topbar-right {
  display: flex; align-items: center; gap: 10px;
}

.user-greeting {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
}

.user-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
}

.balance-badge {
  background: var(--surface2);
  color: var(--success);
  font-size: 13px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--border);
}

.cart-btn {
  background: var(--primary);
  border: none; color: #fff;
  font-size: 14px; padding: 6px 12px;
  border-radius: 20px; cursor: pointer;
  display: flex; align-items: center; gap: 4px;
}

/* ===== Main Content ===== */
#main-content {
  flex: 1; overflow-y: auto;
  padding: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ===== Bottom Nav ===== */
.bottom-nav {
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.nav-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px; padding: 10px 4px;
  background: none; border: none; color: var(--text-muted);
  font-size: 11px; cursor: pointer;
  transition: color var(--transition);
}

.nav-btn span { font-size: 10px; }
.nav-btn.active { color: var(--primary); }

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

/* ===== Home Page ===== */
.welcome-banner {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.welcome-banner h2 { font-size: 20px; font-weight: 700; }
.welcome-banner p { font-size: 13px; color: rgba(255,255,255,0.8); margin-top: 4px; }

.section-title {
  font-size: 14px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
}

.category-card:active { transform: scale(0.97); }
.category-card:hover { border-color: var(--primary); }

.category-card .icon { font-size: 32px; margin-bottom: 8px; }
.category-card .name { font-size: 13px; font-weight: 600; }
.category-card .count { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ===== Product Grid ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
}

.product-card:active { transform: scale(0.97); }
.product-card:hover { border-color: var(--primary); }

.product-card-img {
  width: 100%; aspect-ratio: 4/3;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  overflow: hidden;
  position: relative;
}
.product-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.product-card-body { padding: 10px; }
.product-card-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.product-card-price {
  font-size: 14px; font-weight: 700;
  color: var(--primary); margin-top: 6px;
}

.badge {
  display: inline-block;
  font-size: 10px; font-weight: 600;
  padding: 2px 6px; border-radius: 4px;
  margin-top: 4px;
}

.badge-preorder { background: var(--warning); color: #000; }
.badge-out { background: var(--danger); color: #fff; }
.badge-stock { background: var(--success); color: #fff; }

/* ===== Product Detail ===== */
.product-detail-img {
  width: 100%; aspect-ratio: 16/9;
  background: var(--surface2);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 72px;
  overflow: hidden;
  position: relative;
  margin-bottom: 16px;
}
.product-detail-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

.product-detail-name { font-size: 20px; font-weight: 700; line-height: 1.3; }

.product-detail-meta {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 0;
  flex-wrap: wrap;
}

.product-detail-price {
  font-size: 24px; font-weight: 700;
  color: var(--primary);
}

.product-description {
  font-size: 14px; color: var(--text-muted);
  line-height: 1.6; margin: 12px 0;
}

.qty-control {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0;
}

.qty-btn {
  width: 36px; height: 36px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); font-size: 20px;
  border-radius: 50%; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}

.qty-display {
  font-size: 18px; font-weight: 700; min-width: 32px;
  text-align: center;
}

.alert-btn {
  width: 100%; padding: 12px;
  background: var(--warning); border: none;
  color: #000; font-size: 15px; font-weight: 600;
  border-radius: var(--radius); cursor: pointer;
  margin-top: 8px;
}

/* ===== Cart Page ===== */
.cart-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}

.cart-item-icon { font-size: 40px; flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.cart-item-price { font-size: 13px; color: var(--primary); margin-top: 4px; font-weight: 500; }

.cart-item-actions { 
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  justify-content: flex-end;
}
.cart-item-qty { font-size: 13px; font-weight: 600; color: var(--text-muted); min-width: 50px; text-align: right; }
.cart-small-btn {
  width: 28px; height: 28px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); font-size: 14px;
  border-radius: 50%; cursor: pointer;
}

.cart-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
  margin-bottom: 12px;
}

.cart-summary-row {
  display: flex; justify-content: space-between;
  align-items: center; padding: 8px 0;
  font-size: 14px;
  color: var(--text-muted);
}

.cart-summary-row span:last-child {
  color: var(--text);
  font-weight: 500;
}

.cart-summary-row.total {
  border-top: 1px solid var(--border);
  margin-top: 10px; padding-top: 12px;
  font-size: 16px; font-weight: 700;
  color: var(--text);
}
}

.balance-warning {
  background: rgba(244,67,54,0.1);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--danger);
  margin: 12px 0;
  line-height: 1.5;
}

/* ===== Wallet Page ===== */
.wallet-page.wallet-compact-page {
  display: grid;
  gap: 10px;
}

.wallet-topup-card,
.wallet-history-card {
  margin-bottom: 0;
}

.wallet-topup-card {
  padding: 14px;
}

.wallet-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.wallet-title {
  font-size: 16px;
  line-height: 1.2;
}

.wallet-method-pill {
  font-size: 11px;
  font-weight: 700;
  color: #8cc8ff;
  background: rgba(33,150,243,0.12);
  border: 1px solid rgba(33,150,243,0.26);
  border-radius: 999px;
  padding: 6px 10px;
}

.wallet-input-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.wallet-input,
.custom-amount {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.wallet-input:focus,
.custom-amount:focus {
  outline: none;
  border-color: var(--primary);
}

.wallet-cta {
  margin-top: 10px;
}

.wallet-history-card {
  display: block;
  padding: 12px;
}

.wallet-history-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.wallet-history-headline span {
  font-size: 11px;
  color: var(--text-muted);
}

.wallet-compact-list {
  display: grid;
  gap: 8px;
  min-width: 350px;
}

.wallet-scroll-x {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

.wallet-tx-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  overflow: hidden;
}

.wallet-tx-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px;
  cursor: pointer;
}

.wallet-tx-card.expanded .wallet-tx-toggle {
  border-bottom: 1px solid var(--border);
}

.wallet-tx-left {
  min-width: 0;
}

.wallet-tx-title {
  font-size: 13px;
  font-weight: 700;
}

.wallet-tx-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.wallet-tx-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.wallet-tx-detail {
  display: grid;
  gap: 6px;
  padding: 10px;
  background: rgba(255,255,255,0.02);
}

.wallet-tx-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.wallet-tx-detail-row span {
  color: var(--text-muted);
}

.wallet-tx-detail-row strong {
  font-size: 11px;
  color: var(--text);
  font-weight: 600;
  text-align: right;
  max-width: 56%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallet-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid transparent;
}

.wallet-status-pill.is-success {
  color: #82e39c;
  background: rgba(76,175,80,0.12);
  border-color: rgba(76,175,80,0.22);
}

.wallet-status-pill.is-pending {
  color: #ffd18a;
  background: rgba(255,152,0,0.12);
  border-color: rgba(255,152,0,0.22);
}

.wallet-status-pill.is-danger {
  color: #ff9c95;
  background: rgba(244,67,54,0.12);
  border-color: rgba(244,67,54,0.22);
}

.wallet-status-pill.is-neutral {
  color: #c0ccd7;
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
}

.wallet-tx-amount {
  font-size: 14px;
  font-weight: 800;
}

.wallet-tx-amount.credit {
  color: var(--success);
}

.wallet-tx-amount.debit {
  color: var(--danger);
}

.wallet-empty {
  padding: 16px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.wallet-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.wallet-page-btn {
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  border-radius: 8px;
  font-size: 12px;
  padding: 7px 10px;
  cursor: pointer;
}

.wallet-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.wallet-page-indicator {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== Buttons ===== */
.btn {
  display: block; width: 100%;
  padding: 14px; border: none; border-radius: var(--radius);
  font-size: 15px; font-weight: 600;
  cursor: pointer; transition: opacity var(--transition);
}

.btn:active { opacity: 0.85; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== Empty State ===== */
.empty-state {
  text-align: center; padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state .icon { font-size: 56px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 80px; left: 50%;
  transform: translateX(-50%);
  background: #333; color: #fff;
  padding: 10px 20px; border-radius: 24px;
  font-size: 14px; z-index: 1000;
  white-space: nowrap;
  box-shadow: var(--shadow);
  transition: opacity 0.3s;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  display: flex; align-items: flex-end;
}

.modal-box {
  background: var(--surface);
  width: 100%; border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px 20px;
  max-height: 80vh; overflow-y: auto;
}

.modal-title {
  font-size: 17px; font-weight: 700;
  margin-bottom: 16px;
}

/* ===== Order Status ===== */
.order-status-icon { font-size: 56px; text-align: center; margin-bottom: 12px; }
.order-status-text { font-size: 16px; font-weight: 600; text-align: center; }
.order-status-sub { font-size: 13px; color: var(--text-muted); text-align: center; margin-top: 6px; }

/* ===== Filters ===== */
.filter-row {
  display: flex; gap: 8px; overflow-x: auto;
  padding-bottom: 4px; margin-bottom: 14px;
  scrollbar-width: none;
}

.filter-chip {
  flex-shrink: 0;
  padding: 6px 14px; border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 13px; cursor: pointer;
  transition: all var(--transition);
}

.filter-chip.active {
  background: var(--primary); border-color: var(--primary);
  color: #fff;
}

/* ===== Responsive Tweaks ===== */
@media (max-width: 360px) {
  .category-grid { grid-template-columns: 1fr 1fr; }
  .product-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .wallet-title {
    font-size: 15px;
  }

  .wallet-tx-sub {
    max-width: 150px;
  }
}

/* ===== Admin Portal ===== */
.admin-head h2 {
  font-size: 18px;
  margin-bottom: 6px;
}

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

.admin-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.admin-tab {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text-muted);
  padding: 10px 8px;
  font-size: 13px;
  cursor: pointer;
}

.admin-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.admin-form-grid {
  display: grid;
  gap: 10px;
}

.admin-form-grid textarea.custom-amount {
  min-height: 88px;
  resize: vertical;
}

.admin-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

.admin-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 10px;
  gap: 10px;
}

.admin-small-btn {
  width: auto;
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-item {
  margin-bottom: 0;
}

.admin-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.admin-muted {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* ===== POS Page ===== */
.pos-search-card {
  padding: 14px;
}

/* Product picker grid — horizontal scroll on small screens */
.pos-product-grid {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.pos-product-grid::-webkit-scrollbar { display: none; }

.pos-pick-card {
  flex-shrink: 0;
  width: 104px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: border-color var(--transition);
}
.pos-pick-card:hover { border-color: var(--primary); }

.pos-pick-icon  { font-size: 28px; line-height: 1; }
.pos-pick-name  { font-size: 11px; font-weight: 600; line-height: 1.3; color: var(--text); word-break: break-word; }
.pos-pick-price { font-size: 12px; color: var(--primary); font-weight: 700; }

.pos-pick-btn {
  margin-top: 4px;
  width: 100%;
  padding: 5px 0;
  background: var(--primary);
  border: none;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition);
}
.pos-pick-btn-added { background: var(--success) !important; }

/* Cart table */
.pos-cart-table {
  display: grid;
  gap: 2px;
}

.pos-cart-head {
  display: grid;
  grid-template-columns: 1fr 64px 80px 64px 28px;
  gap: 6px;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.pos-cart-row {
  display: grid;
  grid-template-columns: 1fr 64px 80px 64px 28px;
  gap: 6px;
  align-items: center;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.pos-cart-row:last-child { border-bottom: none; }

.pos-cart-name-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.pos-cart-icon-sm { font-size: 18px; flex-shrink: 0; }
.pos-cart-name-sm {
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.pos-cart-cell {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.pos-cart-subtotal {
  color: var(--primary);
  font-weight: 700;
}

.pos-cart-qty-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.pos-qty-btn {
  width: 22px;
  height: 22px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color var(--transition);
}
.pos-qty-btn:hover { border-color: var(--primary); }

.pos-remove-btn {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.pos-remove-btn:hover { background: rgba(244,67,54,0.12); }

.pos-empty-msg {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 16px 0;
}

/* Grand total row */
.pos-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0 0;
  border-top: 1px solid var(--border);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.pos-total-row strong { color: var(--success); font-size: 20px; }

/* Select */
.pos-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.pos-select option { background: var(--surface2); color: var(--text); }

.select2-container {
  width: 100% !important;
}

.select2-container--default .select2-selection--single {
  height: 50px;
  background: var(--surface2) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  display: flex;
  align-items: center;
  box-shadow: none !important;
}

.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(33,150,243,0.12);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--text) !important;
  line-height: 48px;
  padding-left: 14px;
  padding-right: 44px;
  font-size: 14px;
  font-weight: 600;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: var(--text-muted) !important;
  font-weight: 500;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 48px;
  right: 10px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: var(--text-muted) transparent transparent transparent;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  border-color: transparent transparent var(--text-muted) transparent;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
  display: none !important;
}

.select2-dropdown {
  background: var(--surface2) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);
}

.select2-container--open .select2-dropdown {
  margin-top: 6px;
}

.select2-search--dropdown {
  padding: 10px;
  background: var(--surface2) !important;
  border-bottom: 1px solid var(--border);
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 40px;
  outline: none;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
  border-color: var(--primary);
}

.select2-results,
.select2-results > .select2-results__options {
  background: var(--surface2) !important;
}

.select2-results > .select2-results__options {
  max-height: 220px;
  padding: 6px;
}

.select2-results__option {
  color: var(--text) !important;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background: rgba(33,150,243,0.18);
  color: var(--text);
}

.select2-container--default .select2-results__option--selected {
  background: rgba(33,150,243,0.08);
}

.select2-container--default .select2-selection--single .select2-selection__arrow b,
.select2-container--default .select2-selection--single .select2-selection__clear,
.select2-container--default .select2-search--dropdown .select2-search__field::placeholder,
.select2-container--default .select2-results__option--disabled,
.select2-container--default .select2-results__message {
  color: var(--text-muted) !important;
}

.select2-container--default .select2-results__message {
  color: var(--text-muted);
  padding: 12px;
}

.pos-s2-create {
  color: var(--primary);
  font-weight: 700;
}

/* Payment method cards row */
.pos-pm-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pos-pm-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.pos-pm-card:hover { border-color: var(--primary); }
.pos-pm-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(33,150,243,0.18);
}

.pos-pm-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pos-pm-wf {
  background: #e3003a;
}
.pos-pm-wf span {
  color: #fff;
  font-weight: 900;
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
}

.pos-pm-rev {
  background: #191c1f;
  border: 1px solid #444;
}
.pos-pm-rev span {
  color: #fff;
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
}

.pos-pm-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pos-pm-info strong {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.pos-pm-info span {
  font-size: 10px;
  color: var(--text-muted);
}

/* Crypto card */
.pos-pm-crypto {
  background: linear-gradient(135deg, #f7931a, #e8720c);
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  border-radius: 12px;
}

/* Amount label hint */
.pos-amount-hint {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

/* Confirm modal */
.pos-confirm-rows {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.pos-confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.pos-confirm-row:last-child { border-bottom: none; }
.pos-confirm-row span { color: var(--text-muted); flex-shrink: 0; }
.pos-confirm-row strong { color: var(--text); text-align: right; font-size: 13px; }

.pos-confirm-total {
  background: rgba(33,150,243,0.06);
}
.pos-confirm-total span { font-weight: 700; color: var(--text); font-size: 14px; }
.pos-confirm-total strong { color: var(--success); font-size: 18px; font-weight: 800; }

/* ── POS Grid (tap-able product boxes) ── */
.pos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.pos-box {
  position: relative;
  cursor: pointer;
  padding: 16px 10px;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.pos-box:active { transform: scale(0.96); }
.pos-box-active {
  border-color: var(--primary);
  background: rgba(33,150,243,0.08);
}
.pos-box-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.pos-box-icon  { font-size: 34px; margin-bottom: 6px; }
.pos-box-img   {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  margin: 0 auto 6px;
  display: block;
}
.pos-box-name  { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 2px; word-break: break-word; }
.pos-box-holder { font-size: 10px; color: var(--text-muted); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-box-price { font-size: 13px; font-weight: 700; color: var(--primary); }

/* ── Checkout bar ── */
.pos-checkout-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--primary);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 14px;
  box-shadow: 0 -4px 20px rgba(33,150,243,0.3);
}
.pos-bar-hidden { display: none !important; }
.pos-bar-left  { display: flex; align-items: center; gap: 8px; }
.pos-bar-right { display: flex; align-items: center; gap: 10px; }
.pos-bar-badge {
  background: rgba(255,255,255,0.25);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
  padding: 2px 8px;
}
.pos-bar-label { color: rgba(255,255,255,0.85); font-size: 13px; }
.pos-bar-total { color: #fff; font-weight: 700; font-size: 15px; }
.pos-bar-btn {
  background: #fff;
  color: var(--primary);
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* ── Checkout modal cart ── */
.pos-co-cart-list { display: flex; flex-direction: column; gap: 6px; }
.pos-co-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.pos-co-icon  { font-size: 20px; flex-shrink: 0; }
.pos-co-img   { width: 36px; height: 36px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.pos-co-info  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pos-co-name  { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-co-holder { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-co-sub   { font-weight: 700; color: var(--success); min-width: 48px; text-align: right; flex-shrink: 0; }
.pos-remove-btn {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
}

/* ── Checkout modal payment grid ── */
.pos-co-pm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}
.pos-co-pm-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--surface2);
  transition: border-color 0.12s, background 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.pos-co-pm-card.selected {
  border-color: var(--primary);
  background: rgba(33,150,243,0.1);
}
.pos-co-pm-icon {
  min-width: 34px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  background: var(--surface2);
}
.pos-co-pm-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.pos-co-pm-text strong {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pos-co-pm-text span {
  font-size: 10px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Keep POS checkout compact instead of full-width */
.pos-checkout-modal {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

/* ── POS total row ── */
.pos-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
}
.pos-total-row strong { color: var(--success); font-size: 18px; font-weight: 800; }

/* ── POS empty message ── */
.pos-empty-msg { font-size: 13px; color: var(--text-muted); text-align: center; }
