/* ============================================================
   POS Core — Touch-First POS CSS
   Scope: .module-pos (applied to <body>)
   Target: 10-12" tablet, landscape & portrait modes
   Fat-Finger Rule: min 48px touch targets, 8px spacing
   ============================================================ */

/* ── Local Khmer Fonts (Battambang & Hanuman) ── */
@import url('fonts.css');
/* ── Google Font (Online Fallback) ── */
@import url('https://fonts.googleapis.com/css2?family=Battambang:wght@400;700&family=Hanuman:wght@400;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

html[lang="kh"], body.lang-kh,
html[lang="km"], body.lang-km {
  --font-main: 'Battambang', 'Hanuman', 'Outfit', system-ui, -apple-system, sans-serif;
  font-family: var(--font-main);
}

body.lang-kh, body.lang-kh input, body.lang-kh button, body.lang-kh select, body.lang-kh textarea,
body.lang-km, body.lang-km input, body.lang-km button, body.lang-km select, body.lang-km textarea {
  font-family: 'Battambang', 'Hanuman', 'Outfit', system-ui, -apple-system, sans-serif !important;
}

/* ── CSS Variables ── */
:root {
  --pos-bg: #0b0f19;
  --pos-cart-bg: #0f172a;
  --pos-controls-bg: #0b0f19;
  --pos-card: #151d33;
  --pos-border: rgba(255, 255, 255, 0.1);
  --pos-accent: #f43f5e;
  --pos-success: #10b981;
  --pos-warning: #f59e0b;
  --pos-primary: #6366f1;
  --pos-text: #f8fafc;
  --pos-text-muted: #94a3b8;
  --pos-tile-bg: #151d33;
  --pos-tile-hover: #1e294b;
  --pos-numpad-btn: #0f172a;
  --pos-numpad-hover: #1e293b;
  --font-main: 'Outfit', 'Battambang', 'Hanuman', system-ui, -apple-system, sans-serif;
  --min-touch: 48px;
  --touch-gap: 8px;

  /* Gradient Variables */
  --pos-gradient-1: #151d38;
  --pos-gradient-2: #080a14;

  /* Modal Variables */
  --pos-modal-bg: #0e1526;
  --pos-modal-border: rgba(255, 255, 255, 0.14);

  /* PIN Card Variables */
  --pos-pin-overlay-bg: rgba(8, 10, 20, 0.85);
  --pos-pin-card-bg: rgba(15, 23, 42, 0.9);
  --pos-pin-card-border: rgba(255, 255, 255, 0.14);
  --pos-pin-btn-bg: rgba(255, 255, 255, 0.05);
  --pos-pin-btn-border: rgba(255, 255, 255, 0.1);
  --pos-pin-btn-hover-bg: rgba(255, 255, 255, 0.12);
  --pos-pin-btn-hover-border: rgba(99, 102, 241, 0.5);
  --pos-pin-dots-bg: rgba(255, 255, 255, 0.05);
  --pos-pin-dots-border: rgba(255, 255, 255, 0.1);
  --pos-pin-dot-empty-border: rgba(255, 255, 255, 0.25);
  --pos-pin-cancel-bg: transparent;
  --pos-pin-cancel-border: rgba(255, 255, 255, 0.12);
  --pos-pin-cancel-text: #94a3b8;

  /* Footer & Menu Card Variables */
  --pos-cart-footer-bg: #090d18;
  --pos-menu-card-bg: rgba(255, 255, 255, 0.03);
  --pos-menu-card-border: rgba(255, 255, 255, 0.1);
  --pos-menu-card-hover-bg: rgba(255, 255, 255, 0.08);
  --pos-menu-card-hover-border: rgba(255, 255, 255, 0.2);
  --pos-menu-info-border: rgba(255, 255, 255, 0.1);
  --pos-newsale-bg: #3a3a4a;
}

/* ── Light Mode Color Variable Overrides ── */
body.light-theme {
  --pos-bg: #f8fafc;
  /* slate-50 */
  --pos-cart-bg: #ffffff;
  --pos-controls-bg: #f1f5f9;
  /* slate-100 */
  --pos-card: #e2e8f0;
  --pos-border: #cbd5e1;
  /* slate-300 */
  --pos-accent: #e11d48;
  /* rose-600 */
  --pos-success: #059669;
  /* emerald-600 */
  --pos-warning: #d97706;
  /* amber-600 */
  --pos-primary: #4f46e5;
  /* indigo-600 */
  --pos-text: #0f172a;
  /* slate-900 */
  --pos-text-muted: #64748b;
  /* slate-500 */
  --pos-tile-bg: #ffffff;
  --pos-tile-hover: #e2e8f0;
  --pos-numpad-btn: #f8fafc;
  --pos-numpad-hover: #cbd5e1;

  --pos-gradient-1: #f1f5f9;
  --pos-gradient-2: #e2e8f0;

  --pos-modal-bg: #ffffff;
  --pos-modal-border: rgba(15, 23, 42, 0.08);

  --pos-pin-overlay-bg: rgba(241, 245, 249, 0.85);
  --pos-pin-card-bg: rgba(255, 255, 255, 0.96);
  --pos-pin-card-border: rgba(15, 23, 42, 0.12);
  --pos-pin-btn-bg: #ffffff;
  --pos-pin-btn-border: #e2e8f0;
  --pos-pin-btn-hover-bg: #f8fafc;
  --pos-pin-btn-hover-border: #6366f1;
  --pos-pin-dots-bg: #f1f5f9;
  --pos-pin-dots-border: #cbd5e1;
  --pos-pin-dot-empty-border: #cbd5e1;
  --pos-pin-cancel-bg: transparent;
  --pos-pin-cancel-border: #cbd5e1;
  --pos-pin-cancel-text: #64748b;

  /* Footer & Menu Card Variables */
  --pos-cart-footer-bg: #f8fafc;
  --pos-menu-card-bg: rgba(15, 23, 42, 0.03);
  --pos-menu-card-border: rgba(15, 23, 42, 0.08);
  --pos-menu-card-hover-bg: rgba(15, 23, 42, 0.06);
  --pos-menu-card-hover-border: rgba(15, 23, 42, 0.15);
  --pos-menu-info-border: rgba(15, 23, 42, 0.1);
  --pos-newsale-bg: #cbd5e1;
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body.module-pos {
  font-family: var(--font-main);
  background: radial-gradient(circle at 50% 50%, var(--pos-gradient-1) 0%, var(--pos-gradient-2) 100%);
  color: var(--pos-text);
  font-size: 20px;
  line-height: 1.4;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button, input, select, textarea {
  font-family: var(--font-main);
}

/* ── App Shell ── */
#pos-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: var(--pos-bg);
}

/* ── Unified Full-Width Header Bar ── */
#pos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: var(--pos-cart-footer-bg);
  border-bottom: 1px solid var(--pos-border);
  min-height: 52px;
  height: 52px;
  box-sizing: border-box;
  width: 100vw;
  flex-shrink: 0;
  gap: 12px;
  z-index: 20;
}

body.light-theme #pos-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

/* Header Left: Customer & Wholesale Pills */
.pos-hdr-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  /* .pos-hdr-center/.pos-hdr-right never shrink (flex-shrink:0), so on a
     narrow screen this is the section that has to give way. Without this,
     its nowrap pills overflowed past this box's edge instead of shrinking,
     visually bleeding under the Shift Open pill and stealing its clicks --
     contain it here and let the pills truncate their own text instead. */
  overflow: hidden;
}

.pos-hdr-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  cursor: pointer;
  transition: all 0.15s ease;
  height: 38px;
  box-sizing: border-box;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
}

.pos-hdr-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

body.light-theme .pos-hdr-pill {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}

.pos-hdr-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(99, 102, 241, 0.5);
  color: #ffffff;
}

body.light-theme .pos-hdr-pill:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.pos-hdr-pill.customer-active-pill {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.45);
  color: #10b981;
  padding: 5px 5px 5px 12px;
  gap: 4px;
  cursor: default;
}

body.light-theme .pos-hdr-pill.customer-active-pill {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #047857;
}

.customer-active-pill .cust-name-tap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  min-width: 0;
}

.customer-active-pill .cust-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.pos-hdr-pill.ws-toggle-active {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.5);
  color: #10b981;
  font-weight: 700;
}

body.light-theme .pos-hdr-pill.ws-toggle-active {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #047857;
}

.pos-hdr-pill.ws-toggle-active:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
}

body.light-theme .pos-hdr-pill.ws-toggle-active:hover {
  background: #d1fae5;
  border-color: #34d399;
}

.ws-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  margin-left: 6px;
  vertical-align: middle;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
  animation: wsDotPulse 2s infinite ease-in-out;
}

body.light-theme .ws-dot {
  background: #059669;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.25);
}

@keyframes wsDotPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.25);
    opacity: 0.7;
  }
}

.ws-pill-clear {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.7;
  transition: background 0.12s ease, opacity 0.12s ease, color 0.12s ease;
}

.ws-pill-clear:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
}

.pos-hdr-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.pos-hdr-badge.ws-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Header Center: Shift & Live Clock */
.pos-hdr-center {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.pos-shift-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #10b981;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

body.light-theme .pos-shift-pill {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #059669;
}

.pos-shift-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.header-clock {
  font-size: 14px;
  font-weight: 600;
  color: var(--pos-text-muted);
  font-variant-numeric: tabular-nums;
}

/* Header Right: Cashier, Controls, Menu */
.pos-hdr-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── POS Segmented Language Switcher Pill ── */
.pos-lang-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--pos-border, rgba(255, 255, 255, 0.12));
  border-radius: 9999px;
  padding: 3px;
  gap: 3px;
  height: 38px;
  box-sizing: border-box;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
  user-select: none;
  flex-shrink: 0;
}

.pos-lang-pill .lang-pill-btn {
  background: transparent;
  border: none;
  color: var(--pos-text-muted, #94a3b8);
  font-family: 'Battambang', 'Hanuman', 'Outfit', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  padding: 6px 11px;
  height: 100%;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.pos-lang-pill .lang-pill-btn:hover:not(.active) {
  color: var(--pos-text, #f8fafc);
  background: rgba(255, 255, 255, 0.08);
}

.pos-lang-pill .lang-pill-btn.active {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.45);
}

/* Light Theme in POS */
.light-theme .pos-lang-pill,
[data-theme="light"] .pos-lang-pill {
  background: #f1f5f9;
  border-color: #cbd5e1;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.light-theme .pos-lang-pill .lang-pill-btn,
[data-theme="light"] .pos-lang-pill .lang-pill-btn {
  color: #64748b;
}

.light-theme .pos-lang-pill .lang-pill-btn:hover:not(.active),
[data-theme="light"] .pos-lang-pill .lang-pill-btn:hover:not(.active) {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.04);
}

.light-theme .pos-lang-pill .lang-pill-btn.active,
[data-theme="light"] .pos-lang-pill .lang-pill-btn.active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Login Card Topbar Specific Sizing */
.card-topbar .pos-lang-pill {
  height: 34px;
  padding: 2px;
  gap: 2px;
}

.card-topbar .pos-lang-pill .lang-pill-btn {
  font-size: 12px;
  padding: 4px 9px;
}

.pos-cashier-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 8px;
}

.pos-cashier-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--pos-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.pos-cashier-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--pos-text);
}

/* ── Main Split View ── */
#pos-main-content {
  flex: 1 1 0;
  display: flex;
  flex-direction: row;
  width: 100vw;
  overflow: hidden;
  height: calc(100vh - 52px);
}

/* Landscape Split: Left 380px Cart | Right Controls */
#panel-cart {
  flex: 0 0 380px;
  max-width: 420px;
  min-width: 340px;
  display: flex;
  flex-direction: column;
  background: var(--pos-cart-bg);
  border-right: 1px solid var(--pos-border);
  overflow: hidden;
  height: 100%;
}

#panel-controls {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  background: var(--pos-controls-bg);
  overflow: hidden;
  height: 100%;
}

/* Portrait Layout (Responsive Fallback) */
@media (orientation: portrait) {
  #pos-main-content {
    flex-direction: column;
  }
  #panel-controls {
    flex: 0 0 50%;
    height: 50%;
    order: 1;
  }
  #panel-cart {
    flex: 0 0 50%;
    height: 50%;
    order: 2;
    border-right: none;
    border-top: 1px solid var(--pos-border);
    max-width: 100%;
  }
}

/* Cart Sub-Header Bar */
.cart-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--pos-border);
  background: var(--pos-cart-bg);
  flex-shrink: 0;
}

body.light-theme .cart-header-bar {
  background: #ffffff;
  border-bottom-color: #e2e8f0;
}

.cart-header-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--pos-text);
  letter-spacing: -0.1px;
}

.cart-clear-all-btn {
  background: none;
  border: none;
  color: var(--pos-text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.cart-clear-all-btn:hover {
  color: var(--pos-accent, #ef4444);
  background: rgba(239, 68, 68, 0.1);
}

.cart-clear-all-btn:disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

/* ── Cart Items List & 2-Tier Stacked Cards ── */
#cart-items {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 8px;
  gap: 6px;
}

/* Generic hidden class utility */
.hidden {
  display: none !important;
}

/* Modern 2-Tier Stacked Cart Item Card */
.cart-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--pos-card);
  border: 1px solid var(--pos-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  box-sizing: border-box;
}

body.light-theme .cart-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.cart-card:hover {
  border-color: var(--pos-primary);
}

body.light-theme .cart-card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.cart-card.selected {
  border-color: var(--pos-primary);
  box-shadow: 0 0 0 1.5px var(--pos-primary);
}

/* Tier 1 (Top Line): Full Product Name + Line Total */
.cart-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.cart-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--pos-text);
  line-height: 1.3;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

body.light-theme .cart-card-name {
  color: #0f172a;
}

.cart-card-total {
  font-size: 15px;
  font-weight: 700;
  color: var(--pos-success, #10b981);
  text-align: right;
  white-space: nowrap;
  line-height: 1.2;
}

/* Tier 2 (Bottom Line): Unit info / Badges + Stepper & Delete */
.cart-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.cart-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--pos-text-muted);
  min-width: 0;
}

.cart-card-unit-price {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--pos-text-muted);
  white-space: nowrap;
}

.cart-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.cart-stepper {
  display: inline-flex;
  align-items: center;
  background: var(--pos-bg);
  border: 1px solid var(--pos-border);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

body.light-theme .cart-stepper {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.cart-stepper-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--pos-text);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
  line-height: 1;
}

.cart-stepper-btn:hover {
  background: var(--pos-card);
  color: var(--pos-primary);
}

body.light-theme .cart-stepper-btn:hover {
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.cart-stepper-btn.minus:hover {
  color: #ef4444;
}

.cart-card-qty {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--pos-text);
  min-width: 24px;
  text-align: center;
  cursor: pointer;
  padding: 0 4px;
}

body.light-theme .cart-card-qty {
  color: #0f172a;
}

.cart-edit-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  background: rgba(99, 102, 241, 0.08);
  color: var(--pos-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
}

.cart-edit-btn:hover {
  background: var(--pos-primary);
  color: #ffffff;
}

.cart-delete-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  padding: 0;
  margin-right: 2px;
}

.cart-delete-btn:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  transform: scale(1.05);
}

body.light-theme .cart-delete-btn {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

body.light-theme .cart-delete-btn:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.cart-promo-badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}


/* Cart totals / discount area */
#cart-totals {
  padding: 10px 12px;
  border-top: 1px solid var(--pos-border);
  flex-shrink: 0;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 18px;
}

.totals-row.discount {
  color: var(--pos-warning);
}

.totals-row.tax {
  color: var(--pos-text-muted);
}

/* Fixed checkout footer */
#cart-footer {
  padding: 10px 12px;
  background: var(--pos-cart-footer-bg);
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  flex-shrink: 0;
}

.total-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.cart-actions-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.cart-actions-row .btn-pos {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  min-height: 42px;
  height: 42px;
  padding: 0 4px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
  cursor: pointer;
}

/* 1. Clear: Danger Soft Red */
.btn-action-clear {
  background: rgba(239, 68, 68, 0.16) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
}
body.light-theme .btn-action-clear {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  border-color: #fca5a5 !important;
}
.btn-action-clear:hover {
  background: rgba(239, 68, 68, 0.28) !important;
  border-color: #ef4444 !important;
  transform: translateY(-1px);
}
body.light-theme .btn-action-clear:hover {
  background: #fecaca !important;
  border-color: #f87171 !important;
}

/* 2. Hold: Warning Soft Amber */
.btn-action-hold {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
}
body.light-theme .btn-action-hold {
  background: #fef3c7 !important;
  color: #d97706 !important;
  border-color: #fcd34d !important;
}
.btn-action-hold:hover {
  background: rgba(245, 158, 11, 0.28) !important;
  border-color: #f59e0b !important;
  transform: translateY(-1px);
}
body.light-theme .btn-action-hold:hover {
  background: #fde68a !important;
  border-color: #fbbf24 !important;
}

/* 3. Recall: Primary Soft Sky / Blue */
.btn-action-recall {
  background: rgba(14, 165, 233, 0.16) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(14, 165, 233, 0.35) !important;
}
body.light-theme .btn-action-recall {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border-color: #bae6fd !important;
}
.btn-action-recall:hover {
  background: rgba(14, 165, 233, 0.28) !important;
  border-color: #0ea5e9 !important;
  transform: translateY(-1px);
}
body.light-theme .btn-action-recall:hover {
  background: #bae6fd !important;
  border-color: #38bdf8 !important;
}

/* 4. Discount: Accent Soft Purple / Violet */
.btn-action-discount {
  background: rgba(168, 85, 247, 0.16) !important;
  color: #c084fc !important;
  border: 1px solid rgba(168, 85, 247, 0.35) !important;
}
body.light-theme .btn-action-discount {
  background: #f3e8ff !important;
  color: #7c3aed !important;
  border-color: #d8b4fe !important;
}
.btn-action-discount:hover {
  background: rgba(168, 85, 247, 0.28) !important;
  border-color: #a855f7 !important;
  transform: translateY(-1px);
}
body.light-theme .btn-action-discount:hover {
  background: #e9d5ff !important;
  border-color: #c084fc !important;
}

.cart-actions-row .btn-pos:active {
  transform: scale(0.96);
}

/* Disabled state for cart-dependent buttons (empty cart) */
.btn-action-clear:disabled,
.btn-action-hold:disabled,
.btn-action-discount:disabled {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  transform: none !important;
}

.total-label {
  font-size: 22px;
  font-weight: 600;
}

.total-amount {
  font-size: 32px;
  font-weight: 800;
  color: var(--pos-success);
  font-variant-numeric: tabular-nums;
}

/* Checkout button */
#btn-checkout {
  width: 100%;
  min-height: 56px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px -4px rgba(16, 185, 129, 0.4);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#btn-checkout:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -4px rgba(16, 185, 129, 0.5);
}

#btn-checkout:active:not(:disabled) {
  transform: scale(0.98);
}

#btn-checkout:disabled {
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: #64748b;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.8;
}

body.light-theme #btn-checkout:disabled {
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  color: #94a3b8;
}

/* ── Row 1: Full-Width Search Bar ── */
.pos-search-row {
  padding: 8px 12px 4px;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}

.pos-search-input-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.pos-search-icon {
  position: absolute;
  left: 14px;
  color: var(--pos-text-muted);
  pointer-events: none;
  z-index: 2;
  transition: color 0.15s ease;
}

.pos-search-input {
  width: 100%;
  padding: 0 40px 0 42px;
  min-height: 42px;
  height: 42px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  box-sizing: border-box;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pos-search-input::placeholder {
  color: #94a3b8;
  opacity: 0.9;
}

body.light-theme .pos-search-input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #1e293b;
}

body.light-theme .pos-search-input::placeholder {
  color: #94a3b8;
  opacity: 1;
}

.pos-search-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

body.light-theme .pos-search-input:focus {
  border-color: #3b82f6;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.pos-search-input-wrap:focus-within .pos-search-icon {
  color: #3b82f6;
}

.pos-search-clear-btn {
  position: absolute;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(148, 163, 184, 0.2);
  color: var(--pos-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  z-index: 2;
}

.pos-search-clear-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.pos-search-vk-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--pos-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  z-index: 3;
}

.pos-search-vk-btn:hover {
  background: rgba(99, 102, 241, 0.12);
  color: var(--pos-primary);
}

/* Push clear btn left when VK btn is present */
.pos-search-input-wrap .pos-search-clear-btn {
  right: 40px;
}

/* ── Row 2: Catalog Body Split (Left Vertical Category Sidebar + Right Product Grid) ── */
.pos-catalog-body {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

.pos-category-sidebar {
  width: 124px;
  min-width: 110px;
  max-width: 140px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--pos-cart-bg, #0f172a);
  border-right: 1px solid var(--pos-border);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 6px 14px 6px;
  gap: 6px;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

body.light-theme .pos-category-sidebar {
  background: #f8fafc;
  border-right-color: #e2e8f0;
}

.pos-category-sidebar::-webkit-scrollbar {
  width: 4px;
}

.pos-category-sidebar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 4px;
}

.pos-category-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.cat-tab {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #cbd5e1;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  word-break: break-word;
  white-space: normal;
  box-sizing: border-box;
}

body.light-theme .cat-tab {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #475569;
}

.cat-tab:hover {
  color: #ffffff;
  border-color: rgba(59, 130, 246, 0.6);
  background: rgba(59, 130, 246, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

body.light-theme .cat-tab:hover {
  color: #1d4ed8;
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.cat-tab.active {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
  color: #ffffff !important;
  border-color: #3b82f6 !important;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
  transform: none;
}

/* Category Headers in Grid */
.category-section-header {
  grid-column: 1 / -1;
  font-size: 17px;
  font-weight: 700;
  color: var(--pos-text);
  margin-top: 10px;
  margin-bottom: 2px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--pos-border);
  display: flex;
  align-items: center;
}

body.light-theme .category-section-header {
  color: #1e293b;
  border-bottom-color: #e2e8f0;
}

/* Product grid - 3 Columns for Optimal POS Touchscreen Readability */
#product-grid {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(195px, max-content);
  gap: 12px;
  align-content: start;
  box-sizing: border-box;
}

/* Infinite-scroll sentinel row -- invisible until a batch is loading, spans
   the full grid width so it doesn't get squeezed into one product column. */
.catalog-load-more-sentinel {
  grid-column: 1 / -1;
  min-height: 1px;
}

.catalog-loading-more {
  text-align: center;
  padding: 16px;
  color: var(--pos-text-muted);
  font-size: 13px;
}

@media (min-width: 1800px) {
  #product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  #product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.product-tile {
  position: relative;
  height: 100%;
  min-height: 195px;
  padding: 0;
  background: #141c30;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
  user-select: none;
  box-sizing: border-box;
}

body.light-theme .product-tile {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
}

.product-tile:hover {
  background: #19233c;
  box-shadow: 0 10px 24px -4px rgba(59, 130, 246, 0.25), 0 0 0 1.5px #3b82f6;
  border-color: #3b82f6 !important;
  transform: translateY(-3px);
}

body.light-theme .product-tile:hover {
  background: #ffffff;
  box-shadow: 0 10px 24px -4px rgba(59, 130, 246, 0.2), 0 0 0 2px #3b82f6;
  border-color: #3b82f6 !important;
  transform: translateY(-3px);
}

.product-tile:active {
  transform: scale(0.96);
}

/* 1:1 Square Image Container */
.product-tile-image-container {
  position: relative;
  width: calc(100% - 12px);
  height: 130px;
  margin: 6px 6px 0 6px;
  border-radius: 12px;
  overflow: hidden;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-sizing: border-box;
  flex-shrink: 0;
}

body.light-theme .product-tile-image-container {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.06);
}

.product-tile-top-badges {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 5;
  pointer-events: none;
  gap: 4px;
}

.tile-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  line-height: 1.2;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.tile-badge.badge-rack {
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

body.light-theme .tile-badge.badge-rack {
  background: #0f172a;
  color: #ffffff;
  border: none;
}

.tile-badge.badge-stock {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.4);
  backdrop-filter: blur(4px);
}

body.light-theme .tile-badge.badge-stock {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.tile-badge.badge-low {
  background: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.45);
  backdrop-filter: blur(4px);
}

body.light-theme .tile-badge.badge-low {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.tile-badge.badge-wh {
  background: #f59e0b;
  color: #ffffff;
  font-weight: 900;
  border: 1px solid #d97706;
}

.tile-badge.badge-oos {
  background: #ef4444;
  color: #ffffff;
  border: 1px solid #dc2626;
}

.tile-badge.badge-incart {
  background: rgba(59, 130, 246, 0.22);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.45);
  backdrop-filter: blur(4px);
}

body.light-theme .tile-badge.badge-incart {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

/* Non-stock service product (track_stock = 0, e.g. a per-kg laundry
   charge) -- never "0 left", there's no inventory to run out of. */
.tile-badge.badge-service {
  background: rgba(99, 102, 241, 0.22);
  color: #a5b4fc;
  border: 1px solid rgba(129, 140, 248, 0.45);
  backdrop-filter: blur(4px);
}

body.light-theme .tile-badge.badge-service {
  background: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
}

.product-tile-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
  box-sizing: border-box;
  z-index: 1;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-tile:hover .product-tile-img {
  transform: scale(1.05);
}

.product-placeholder-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(15, 23, 42, 0.8));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  color: #60a5fa;
  z-index: 1;
}

.product-tile-info {
  padding: 8px 10px 10px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
  min-width: 0;
  text-align: left;
  box-sizing: border-box;
}

.product-tile-name {
  font-family: var(--font-main);
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

body.light-theme .product-tile-name {
  color: #1e293b;
}

.product-tile-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 2px;
}

.product-tile-price {
  font-size: 15px;
  font-weight: 800;
  color: #10b981;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

body.light-theme .product-tile-price {
  color: #059669;
}

.product-tile.warehouse-only {
  opacity: 0.94;
}

/* Scan flash animation */
@keyframes scanFlash {
  0% {
    background: #0f9b58;
  }

  50% {
    background: #1de789;
  }

  100% {
    background: var(--pos-tile-bg);
  }
}

@keyframes scanFlashDanger {
  0% {
    background: #e94560;
    border-color: #e94560;
  }

  50% {
    background: #ff2a4b;
    border-color: #ff2a4b;
  }

  100% {
    background: var(--pos-tile-bg);
  }
}

.product-tile.scan-flash {
  animation: scanFlash 0.4s ease;
}

.product-tile.scan-flash-danger {
  animation: scanFlashDanger 0.5s ease;
}

/* ── On-Screen Number Pad ── */
#numpad-bar {
  padding: 8px;
  flex-shrink: 0;
  border-top: 1px solid var(--pos-border);
}

.numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.numpad-btn {
  min-height: var(--min-touch);
  background: var(--pos-numpad-btn);
  border: 1px solid var(--pos-border);
  border-radius: 8px;
  color: var(--pos-text);
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
  font-family: var(--font-main);
}

.numpad-btn:active {
  background: var(--pos-numpad-hover);
}

.numpad-btn.confirm {
  background: var(--pos-success);
  color: white;
}

.numpad-btn.clear {
  background: var(--pos-accent);
  color: white;
}

.numpad-btn.backspace {
  font-size: 22px;
}

/* ================================================================
   MODALS (overlays)
   ================================================================ */
/* Fullscreen Checkout Screen */
.checkout-fullscreen-overlay {
  position: fixed;
  inset: 0;
  background: var(--pos-bg);
  z-index: 1500;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-main);
}

.checkout-fullscreen-overlay.hidden {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Header Navigation Bar */
.checkout-fullscreen-header {
  height: 64px;
  background: var(--pos-card);
  border-bottom: 1px solid var(--pos-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.checkout-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.checkout-back-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--pos-border);
  background: var(--pos-tile-bg);
  color: var(--pos-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.checkout-back-btn:hover {
  background: var(--pos-border);
}

.checkout-title-group {
  display: flex;
  flex-direction: column;
}

.checkout-page-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--pos-text);
  margin: 0;
  line-height: 1.2;
}

.checkout-order-id-badge {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.checkout-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Currency Selector Pill */
.checkout-currency-toggle {
  display: flex;
  background: var(--pos-tile-bg);
  border: 1px solid var(--pos-border);
  border-radius: 20px;
  padding: 4px;
  gap: 4px;
}

.curr-toggle-btn {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--pos-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.curr-toggle-btn.active {
  background: var(--pos-card);
  color: var(--pos-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.checkout-close-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--pos-tile-bg);
  color: var(--pos-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.checkout-close-btn:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Fullscreen Layout Body */
.checkout-fullscreen-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  padding: 20px 24px;
  overflow: hidden;
  box-sizing: border-box;
}

.checkout-left-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

/* Top 4 Metrics Summary Cards Row */
.checkout-metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.co-metric-card {
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--pos-card);
  border: 1px solid var(--pos-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.co-metric-card .card-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: var(--pos-text-muted);
}

.co-metric-card .card-value {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.5px;
  color: var(--pos-text);
}

.co-metric-card.remaining {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(59, 130, 246, 0.15));
  border: 1.5px solid rgba(37, 99, 235, 0.3);
}

.co-metric-card.remaining .card-label {
  color: var(--pos-primary);
}

.co-metric-card.remaining .card-value {
  color: var(--pos-primary);
}

.co-metric-card.paid {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.co-metric-card.paid .card-label {
  color: #10b981;
}

.co-metric-card.paid .card-value {
  color: #10b981;
}

.co-metric-card.tendered {
  border: 1.5px solid var(--pos-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
}

.co-metric-card.tendered:hover {
  background: rgba(37, 99, 235, 0.05);
  border-color: var(--pos-primary);
}

.co-metric-card.tendered .card-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--pos-primary);
}

.co-metric-card.change {
  background: var(--pos-card);
  border: 1px solid var(--pos-border);
}

/* Numpad & Discount Modal Styles */
.btn-numpad {
  min-height: 52px;
  background: var(--pos-card);
  border: 1px solid var(--pos-border);
  border-radius: 12px;
  font-size: 20px;
  font-weight: 700;
  color: var(--pos-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-numpad:active,
.btn-numpad:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: var(--pos-primary);
  color: var(--pos-primary);
  transform: translateY(-1px);
}

.btn-numpad.danger-subtle {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.btn-numpad.danger-subtle:active,
.btn-numpad.danger-subtle:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

/* Z-Report Modal Tactile Numpad & Presets */
.zr-numpad-grid .btn-numpad:hover,
.zr-numpad-grid .btn-numpad:focus {
  background: rgba(245, 158, 11, 0.1);
  border-color: #f59e0b;
  color: #f59e0b;
  transform: translateY(-1px);
}

.zr-numpad-grid .btn-numpad:active {
  transform: scale(0.95) translateY(1px);
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
}

.zr-numpad-grid .btn-numpad.danger-subtle:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ef4444;
}

.preset-chip-sm:hover {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: #f59e0b !important;
  color: #f59e0b !important;
  transform: translateY(-1px);
}

.preset-chip-sm:active {
  transform: scale(0.95);
}

.discount-type-btn {
  background: transparent;
  color: var(--pos-text-muted);
  transition: all 0.2s ease;
}

.discount-type-btn.active {
  background: var(--pos-card);
  color: var(--pos-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Edit Item Modal & Wholesale Section */
.edit-item-section-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 14px 0 10px;
  color: var(--pos-text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.edit-item-section-divider::before,
.edit-item-section-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px dashed var(--pos-border);
}

.edit-item-section-divider span {
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Wholesale Tab inside Edit Item Modal */
.eim-ws-summary-banner {
  background: var(--pos-tile-bg);
  border: 1px solid var(--pos-border);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.eim-ws-sum-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.eim-ws-label {
  font-size: 11px;
  color: var(--pos-text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.eim-ws-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--pos-text);
}
.eim-ws-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.15);
  color: var(--pos-text-muted);
  border: 1px solid var(--pos-border);
}
.eim-ws-badge.is-ws {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}
.eim-ws-badge.is-forced {
  background: rgba(245, 158, 11, 0.18);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.4);
}

.eim-ws-section-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--pos-text-muted);
  margin-bottom: 8px;
}

.eim-ws-tiers-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.eim-ws-tier-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--pos-tile-bg);
  border: 1px solid var(--pos-border);
  border-radius: 10px;
  transition: all 0.15s ease;
}
.eim-ws-tier-row.tier-active {
  background: rgba(16, 185, 129, 0.08);
  border-color: #10b981;
}
.eim-ws-tier-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.eim-ws-tier-min {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--pos-primary);
}
.eim-ws-tier-right {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.eim-ws-tier-price {
  font-size: 15px;
  font-weight: 800;
  color: var(--pos-text);
}
.eim-ws-tier-savings {
  font-size: 11px;
  font-weight: 600;
  color: #10b981;
}

.btn-modal-apply-ws {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
  transition: all 0.15s ease;
}
.btn-modal-apply-ws:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.35);
}
.btn-modal-apply-ws:active {
  transform: translateY(0);
}

.btn-modal-revert-ws {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.08);
  border: 1.5px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-modal-revert-ws:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

/* Cart Wholesale Tier Badge */
.cart-ws-tier-badge {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #d97706 !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cart-ws-tier-badge:hover {
  background: rgba(245, 158, 11, 0.22) !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
  transform: scale(1.02);
}

/* Central Content Grid: Payment Methods + Keypad */
.checkout-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex: 1;
}

.co-card-box {
  background: var(--pos-card);
  border: 1px solid var(--pos-border);
  border-radius: 24px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

/* Payment Methods Grid */
.pm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.pm-btn {
  border-radius: 16px;
  border: 1px solid var(--pos-border);
  background: var(--pos-tile-bg);
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--pos-text);
  cursor: pointer;
  min-height: 80px;
  transition: all 0.2s ease;
  line-height: 1.2;
}

.pm-btn:hover {
  border-color: var(--pos-primary);
  background: var(--pos-card);
}

.pm-btn.active {
  border: 2px solid #3b82f6;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

[data-theme="dark"] .pm-btn.active {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

/* Split button pending-cancel (double-tap to confirm) */
.pm-btn.pending-cancel {
  border: 2px solid #ef4444;
  background: #fef2f2;
  color: #b91c1c;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
  animation: split-cancel-pulse 0.4s ease;
}

[data-theme="dark"] .pm-btn.pending-cancel {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

@keyframes split-cancel-pulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.pm-btn.placeholder {
  border: 1px dashed var(--pos-border);
  background: transparent;
  opacity: 0.4;
  cursor: default;
}

/* Touch Keypad Layout */
.co-keypad-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.co-keypad-layout {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  flex: 1;
}

.co-quick-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.co-quick-btn {
  flex: 1;
  border-radius: 16px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #2563eb;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  transition: all 0.15s ease;
}

.co-quick-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.co-quick-btn.set-total {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.co-num-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  flex: 1;
}

.co-num-btn {
  border-radius: 16px;
  border: 1px solid var(--pos-border);
  background: var(--pos-tile-bg);
  color: var(--pos-text);
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.co-num-btn:hover {
  background: var(--pos-border);
  transform: translateY(-1px);
}

.co-num-btn.backspace {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
  border-radius: 16px;
  font-size: 24px;
}

.co-num-btn.backspace:hover {
  background: #fca5a5;
  color: #b91c1c;
}

.co-num-btn.clear-btn {
  border-radius: 16px;
  background: #f1f5f9;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #475569;
  border: 1px solid #cbd5e1;
  min-height: 50px;
  margin-top: 4px;
}

.co-num-btn.clear-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Large Pay Action Button */
.co-pay-btn {
  width: 100%;
  min-height: 56px;
  border-radius: 20px;
  border: none;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.co-pay-btn.disabled {
  background: var(--pos-border, #e2e8f0);
  color: var(--pos-text-muted, #94a3b8);
  cursor: not-allowed;
  opacity: 0.6;
}

.co-pay-btn.ready {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.co-pay-btn.ready:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45);
}

.co-pay-btn.add-split {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

.co-pay-btn.add-split:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.45);
}

/* ── Split Payment Applied Cards (UI/UX Pro Max) ── */
.applied-payments-box {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.applied-payments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 2px;
}

.applied-payment-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--pos-tile-bg, #ffffff);
  border: 1px solid var(--pos-border, #e2e8f0);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: transform 0.1s ease, border-color 0.1s ease;
}

body.light-theme .applied-payment-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.applied-payment-card:hover {
  border-color: var(--pos-primary, #3b82f6);
}

.applied-payment-card .leg-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.applied-payment-card .leg-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--pos-primary, #2563eb);
}

.applied-payment-card .leg-amount-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.applied-payment-card .leg-amount {
  font-size: 16px;
  font-weight: 900;
  color: var(--pos-text, #0f172a);
  letter-spacing: -0.02em;
}

body.light-theme .applied-payment-card .leg-amount {
  color: #0f172a;
}

.applied-payment-card .leg-equiv {
  font-size: 12px;
  font-weight: 500;
  color: var(--pos-text-muted, #64748b);
}

.applied-payment-card .leg-del-btn {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.applied-payment-card .leg-del-btn:hover {
  background: #ef4444;
  color: #ffffff;
  transform: scale(1.08);
}

/* Right Cart Summary Panel */
.checkout-cart-panel {
  background: var(--pos-card);
  border: 1px solid var(--pos-border);
  border-radius: 24px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  overflow: hidden;
}

.co-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--pos-border);
}

.co-cart-title-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.co-cart-title {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--pos-text-muted);
}

.co-cart-badge {
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
}

.co-add-product-btn {
  border: none;
  background: #eff6ff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.co-add-product-btn:hover {
  background: #dbeafe;
}

.co-cart-items-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.co-cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--pos-tile-bg);
  border-radius: 14px;
  border: 1px solid var(--pos-border);
}

.co-cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.co-cart-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--pos-text);
}

.co-cart-item-meta {
  display: flex;
  gap: 4px;
}

.co-meta-pill {
  font-size: 10px;
  font-weight: 700;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 1px 6px;
  border-radius: 6px;
}

.co-cart-totals-box {
  border-top: 1px solid var(--pos-border);
  padding-top: 12px;
}

.co-total-due-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 8px;
}

.co-total-due-val {
  font-size: 28px;
  font-weight: 900;
  color: var(--pos-text);
  line-height: 1;
}

.co-total-due-sub {
  font-size: 14px;
  font-weight: 700;
  color: var(--pos-text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   RESPONSIVE LAYOUTS FOR ALL POS TOUCHSCREENS & DISPLAYS (UI/UX PRO MAX)
   Supports: 1024x768 (4:3), 1366x768 (16:9), 1920x1080 (FHD), Tablets & Laptops
   ========================================================================== */

/* ── Standard POS Displays (1024x768, 1280x800, 1366x768, Compact Viewports) ── */
@media (max-height: 840px) {
  /* Fullscreen Checkout Header */
  .checkout-fullscreen-header {
    height: 48px;
    padding: 0 16px;
  }
  .checkout-page-title {
    font-size: 16px;
  }
  .checkout-back-btn,
  .checkout-close-btn {
    width: 32px;
    height: 32px;
  }
  .curr-toggle-btn {
    padding: 4px 10px;
    font-size: 11px;
  }

  /* Fullscreen Checkout Body */
  .checkout-fullscreen-body {
    padding: 10px 14px;
    gap: 12px;
    grid-template-columns: 1fr 280px;
  }
  .checkout-left-area {
    gap: 8px;
  }

  /* 4 Metrics Summary Cards */
  .checkout-metrics-row {
    gap: 8px;
  }
  .co-metric-card {
    padding: 6px 10px;
    border-radius: 12px;
  }
  .co-metric-card .card-label {
    font-size: 10px;
    margin-bottom: 2px;
  }
  .co-metric-card .card-value {
    font-size: 18px;
  }

  /* Main Central Grid (Payment Methods + Touch Keypad) */
  .checkout-main-grid {
    gap: 10px;
  }
  .co-card-box {
    padding: 10px 12px;
    border-radius: 16px;
  }
  .co-box-title {
    font-size: 11px !important;
    margin-bottom: 8px !important;
  }

  /* Payment Methods 6-Card Grid */
  .pm-grid {
    gap: 6px;
    grid-template-columns: repeat(3, 1fr);
  }
  .pm-btn {
    min-height: 48px;
    padding: 6px 4px;
    font-size: 10.5px;
    border-radius: 10px;
  }
  .pm-btn svg {
    width: 16px !important;
    height: 16px !important;
    margin-bottom: 2px !important;
  }

  /* Keypad Buttons */
  .co-keypad-wrapper {
    gap: 6px;
  }
  .co-keypad-layout {
    gap: 8px;
    grid-template-columns: 68px 1fr;
  }
  .co-quick-col {
    gap: 6px;
  }
  .co-quick-btn {
    min-height: 38px;
    font-size: 13px;
    border-radius: 10px;
  }
  .co-num-grid {
    gap: 6px;
  }
  .co-num-btn {
    min-height: 38px;
    font-size: 18px;
    border-radius: 10px;
  }
  .co-num-btn.clear-btn {
    min-height: 34px;
    font-size: 12px;
    border-radius: 10px;
    margin-top: 2px;
  }
  .co-pay-btn {
    min-height: 44px;
    font-size: 16px;
    border-radius: 12px;
  }

  /* Right Cart Summary Panel */
  .checkout-cart-panel {
    padding: 12px;
    border-radius: 16px;
  }
  .co-cart-header {
    margin-bottom: 8px;
    padding-bottom: 6px;
  }
  .co-cart-item-row {
    padding: 6px 8px;
    border-radius: 10px;
  }
  .co-cart-item-name {
    font-size: 12px;
  }
  .co-total-due-val {
    font-size: 20px !important;
  }

  /* PIN Modal Screen Lock & Manager Override */
  .pin-card {
    padding: 16px 20px !important;
    gap: 10px !important;
    max-width: 330px !important;
    border-radius: 16px !important;
  }
  .pin-icon-wrapper {
    width: 40px !important;
    height: 40px !important;
    border-radius: 10px !important;
    margin-bottom: 0 !important;
  }
  .pin-title {
    font-size: 16px !important;
  }
  .pin-subtitle-msg {
    font-size: 11px !important;
  }
  .pin-dots-container {
    padding: 8px 14px !important;
    border-radius: 10px !important;
  }
  .pin-dot {
    width: 10px !important;
    height: 10px !important;
  }
  .pin-dots {
    gap: 12px !important;
  }
  .pin-grid {
    gap: 8px !important;
  }
  .pin-btn {
    min-height: 40px !important;
    font-size: 18px !important;
    border-radius: 10px !important;
  }
  .pin-actions .cancel-btn {
    min-height: 38px !important;
    font-size: 13px !important;
  }

  /* Main POS Terminal Left Cart Panel & Checkout Button Scaling */
  #btn-checkout {
    min-height: 44px !important;
    font-size: 16px !important;
    border-radius: 12px !important;
  }
  .cart-actions-row .btn-pos {
    min-height: 36px !important;
    font-size: 12px !important;
  }
  .total-amount {
    font-size: 24px !important;
  }
  .total-label {
    font-size: 18px !important;
  }
  #cart-footer {
    padding: 8px 10px !important;
  }
  #pos-header,
  .pos-header {
    height: 52px !important;
    padding: 0 12px !important;
  }
}

/* ── Small Width Adjustments (e.g. 1024px Width or Small Tablet) ── */
@media (max-width: 1050px) {
  .checkout-fullscreen-body {
    grid-template-columns: 1fr 260px;
    gap: 10px;
  }
  .pm-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Narrow Mobile Screens (Portrait Phones / Narrow Tablets ≤ 768px) ── */
@media (max-width: 768px) {
  .checkout-fullscreen-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .checkout-cart-panel {
    display: none;
  }
  .checkout-metrics-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .checkout-main-grid {
    grid-template-columns: 1fr;
  }
}

/* POS Modal Overlays (Ultra-Fast 60fps Performance) */
.pos-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
}

.pos-modal-overlay.hidden {
  display: none;
}

.pos-modal {
  background: var(--pos-modal-bg, #0f172a);
  border: 1px solid var(--pos-modal-border, rgba(255, 255, 255, 0.1));
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
  animation: modalFadeIn 0.12s ease-out;
  box-sizing: border-box;
  will-change: transform, opacity;
}

/* Custom sleek scrollbar for modal */
.pos-modal::-webkit-scrollbar {
  width: 6px;
}

.pos-modal::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 4px;
}

.pos-modal::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 4px;
}

.pos-modal::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

#checkout-modal .pos-modal {
  max-width: 520px;
  max-height: 94vh;
  padding: 16px 20px;
}

/* Success ("Sale Complete") modal — fixed header + scrollable receipt + sticky action bar */
#success-modal .pos-modal {
  width: min(540px, 94vw);
  max-width: 540px;
  max-height: 92vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#success-modal .sm-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 24px 12px;
}

#success-modal .sm-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 18px 14px;
  text-align: left;
}

#success-modal .sm-body::-webkit-scrollbar {
  width: 6px;
}

#success-modal .sm-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 4px;
}

#success-modal .sm-footer {
  flex-shrink: 0;
  display: flex;
  gap: 12px;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--pos-modal-border, rgba(255, 255, 255, 0.1));
  background: var(--pos-modal-bg, #0f172a);
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pos-modal h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
}

/* PIN Pad Fullscreen Overlay (Optimized 60fps) */
#pin-overlay {
  position: fixed;
  inset: 0;
  background: var(--pos-pin-overlay-bg, rgba(8, 10, 20, 0.82));
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* Lock screen: fully opaque — background content must NOT be visible */
#pin-overlay.mode-lock {
  background: #080a14 !important;
}

body.light-theme #pin-overlay {
  background: rgba(241, 245, 249, 0.88);
}

body.light-theme #pin-overlay.mode-lock {
  background: #f1f5f9 !important;
}

#pin-overlay.hidden {
  display: none;
}

/* Centered PIN Card */
.pin-card {
  background: var(--pos-pin-card-bg, #0f172a);
  border: 1px solid var(--pos-pin-card-border, rgba(255, 255, 255, 0.1));
  border-radius: 24px;
  width: 100%;
  max-width: 380px;
  padding: 32px 28px 28px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  position: relative;
  box-sizing: border-box;
}

body.light-theme .pin-card {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

.pin-card-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pin-icon-wrapper {
  background: rgba(99, 102, 241, 0.12);
  color: var(--pos-primary, #6366f1);
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(99, 102, 241, 0.25);
  margin-bottom: 4px;
}

body.light-theme .pin-icon-wrapper {
  background: rgba(79, 70, 229, 0.1);
  border-color: rgba(79, 70, 229, 0.2);
  color: #4f46e5;
}

.pin-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--pos-text, #f8fafc);
  margin: 0;
}

body.light-theme .pin-title {
  color: #0f172a !important;
}

.pin-subtitle-msg {
  font-size: 13px;
  font-weight: 500;
  color: var(--pos-text-muted, #94a3b8);
  margin: 0;
}

body.light-theme .pin-subtitle-msg {
  color: #64748b !important;
}

/* ── PIN Action Context Chip ─────────────────────────────── */
@keyframes pin-chip-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.pin-action-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid;
  animation: pin-chip-in 150ms ease-out both;
  user-select: none;
  margin-top: 2px;
}

.pin-action-chip.hidden {
  display: none;
}

/* Wholesale / Price Override — Blue */
.pin-action-chip.chip-blue {
  background: rgba(14, 165, 233, 0.14);
  color: #38bdf8;
  border-color: rgba(14, 165, 233, 0.35);
}
body.light-theme .pin-action-chip.chip-blue {
  background: #e0f2fe;
  color: #0284c7;
  border-color: #bae6fd;
}

/* Order Discount — Purple */
.pin-action-chip.chip-purple {
  background: rgba(168, 85, 247, 0.14);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.35);
}
body.light-theme .pin-action-chip.chip-purple {
  background: #f3e8ff;
  color: #7c3aed;
  border-color: #d8b4fe;
}

/* Price Edit / Custom Price — Orange/Amber */
.pin-action-chip.chip-orange {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}
body.light-theme .pin-action-chip.chip-orange {
  background: #fef3c7;
  color: #d97706;
  border-color: #fcd34d;
}

/* Item Return / Refund — Red */
.pin-action-chip.chip-red {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}
body.light-theme .pin-action-chip.chip-red {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* Quick Restock — Green */
.pin-action-chip.chip-green {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.35);
}
body.light-theme .pin-action-chip.chip-green {
  background: #dcfce7;
  color: #16a34a;
  border-color: #bbf7d0;
}

/* Shift Close / Neutral — Slate */
.pin-action-chip.chip-slate {
  background: rgba(100, 116, 139, 0.14);
  color: #94a3b8;
  border-color: rgba(100, 116, 139, 0.35);
}
body.light-theme .pin-action-chip.chip-slate {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

/* Day Close — Rose/Red */
.pin-action-chip.chip-rose {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}
body.light-theme .pin-action-chip.chip-rose {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* Dots Display Box */
.pin-dots-container {
  background: var(--pos-pin-dots-bg, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--pos-pin-dots-border, rgba(255, 255, 255, 0.08));
  padding: 16px 24px;
  border-radius: 16px;
  display: flex;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

body.light-theme .pin-dots-container {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

.pin-dots {
  display: flex;
  gap: 18px;
  justify-content: center;
  align-items: center;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--pos-pin-dot-empty-border, rgba(255, 255, 255, 0.2));
  background: transparent;
  transition: background-color 0.08s ease, border-color 0.08s ease, transform 0.08s ease;
}

body.light-theme .pin-dot {
  border-color: #cbd5e1 !important;
}

.pin-dot.filled {
  background: var(--pos-primary, #6366f1);
  border-color: var(--pos-primary, #6366f1);
  transform: scale(1.15);
}

body.light-theme .pin-dot.filled {
  background: #4f46e5 !important;
  border-color: #4f46e5 !important;
}

/* Error Field */
.pin-error {
  color: var(--pos-accent, #ef4444);
  font-size: 14px;
  font-weight: 600;
  min-height: 20px;
  text-align: center;
}

/* Interactive Numpad keys */
.pin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.pin-btn {
  min-height: 56px;
  background: var(--pos-pin-btn-bg, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--pos-pin-btn-border, rgba(255, 255, 255, 0.08));
  border-radius: 14px;
  color: var(--pos-text, #f8fafc);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, background-color 0.08s ease, border-color 0.08s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.light-theme .pin-btn {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
}

.pin-btn:hover {
  background: var(--pos-pin-btn-hover-bg, rgba(255, 255, 255, 0.1));
  border-color: var(--pos-pin-btn-hover-border, rgba(99, 102, 241, 0.4));
  transform: translateY(-1px);
}

body.light-theme .pin-btn:hover {
  background: #f8fafc !important;
  border-color: #6366f1 !important;
  color: #4f46e5 !important;
}

.pin-btn:focus {
  outline: none;
}

.pin-btn:active {
  transform: scale(0.96);
  box-shadow: none;
}

.pin-btn.clear-btn,
.pin-btn.back-btn {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--pos-text-muted);
}

body.light-theme .pin-btn.clear-btn,
body.light-theme .pin-btn.back-btn {
  color: #64748b !important;
}

.pin-actions {
  margin-top: 8px;
  width: 100%;
}

.pin-actions .cancel-btn {
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  background: var(--pos-pin-cancel-bg);
  border: 1px solid var(--pos-pin-cancel-border);
  color: var(--pos-pin-cancel-text);
  transition: all 0.15s ease;
}

body.light-theme .pin-actions .cancel-btn {
  background: transparent !important;
  border-color: #cbd5e1 !important;
  color: #64748b !important;
}

.pin-actions .cancel-btn:hover {
  background: rgba(99, 102, 241, 0.08);
  color: var(--pos-primary);
  border-color: var(--pos-primary);
}

body.light-theme .pin-actions .cancel-btn:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

/* Animations */
@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-8px);
  }

  40%,
  80% {
    transform: translateX(8px);
  }
}

.shake {
  animation: shake 0.35s ease-in-out;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.loading-pulse {
  animation: pulse 1s infinite ease-in-out;
}

/* Cash received modal */
.smart-cash-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.smart-cash-btn {
  flex: 1 1 calc(50% - 4px);
  min-height: var(--min-touch);
  background: var(--pos-primary);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}

.smart-cash-btn:active {
  background: #1558b0;
}

.change-display {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  color: var(--pos-success);
  margin: 12px 0;
  font-variant-numeric: tabular-nums;
}

/* ================================================================
   TOAST NOTIFICATIONS (Bottom-Right Dock)
   ================================================================ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  max-width: 380px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  animation: toastSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-sizing: border-box;
}

@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast.success {
  background: #059669;
  color: #ffffff;
}

.toast.warning {
  background: #d97706;
  color: #ffffff;
}

.toast.error,
.toast.danger {
  background: #dc2626;
  color: #ffffff;
}

.toast.info {
  background: #4f46e5;
  color: #ffffff;
}

.toast.fade-out {
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transition: all 0.25s ease;
}

/* ================================================================
   COMMON BUTTONS
   ================================================================ */
.btn-pos {
  min-height: var(--min-touch);
  padding: 0 16px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-main);
  white-space: nowrap;
}

.btn-pos:active {
  transform: scale(0.97);
}

.btn-pos:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4);
}

.btn-pos.primary {
  background: var(--pos-primary);
  color: white;
}

.btn-pos.danger {
  background: var(--pos-accent);
  color: white;
}

.btn-pos.success {
  background: var(--pos-success);
  color: white;
}

.btn-pos.warning {
  background: #d97706;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
  transition: all 0.15s ease;
}

.btn-pos.warning:hover {
  background: #b45309;
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.45);
  transform: translateY(-1px);
}

.btn-pos.warning:active {
  transform: scale(0.98);
}

.btn-pos.neutral {
  background: transparent;
  color: var(--pos-text-muted);
  border: 1px solid transparent;
}

.btn-pos.neutral:hover {
  background: rgba(148, 163, 184, 0.1);
  color: var(--pos-text);
}

/* Modal-scoped neutral buttons: always show clearly, no hover required */
.pos-modal .btn-pos.neutral,
.pos-modal-footer-bar .btn-pos.neutral,
.pos-cust-form-footer .btn-pos.neutral,
.pos-customer-dialog .btn-pos.neutral {
  background: var(--pos-card, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--pos-border, rgba(255, 255, 255, 0.12));
  color: var(--pos-text, #f8fafc);
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.pos-modal .btn-pos.neutral:hover,
.pos-modal-footer-bar .btn-pos.neutral:hover,
.pos-cust-form-footer .btn-pos.neutral:hover,
.pos-customer-dialog .btn-pos.neutral:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

body.light-theme .pos-modal .btn-pos.neutral,
body.light-theme .pos-modal-footer-bar .btn-pos.neutral,
body.light-theme .pos-cust-form-footer .btn-pos.neutral,
body.light-theme .pos-customer-dialog .btn-pos.neutral {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
}

body.light-theme .pos-modal .btn-pos.neutral:hover,
body.light-theme .pos-modal-footer-bar .btn-pos.neutral:hover,
body.light-theme .pos-cust-form-footer .btn-pos.neutral:hover,
body.light-theme .pos-customer-dialog .btn-pos.neutral:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-pos.new-sale {
  background: transparent;
  color: var(--pos-text-muted);
  border: 1px solid transparent;
  font-size: 16px;
}

.btn-pos.new-sale:hover {
  background: rgba(148, 163, 184, 0.1);
  color: var(--pos-text);
}

/* Wholesale Mode toggle button */
.ws-toggle-btn {
  background: var(--pos-bg-secondary, #f3f4f6);
  border: 1px solid var(--pos-border, #d1d5db);
  color: var(--pos-text-muted, #6b7280);
  transition: all 0.2s ease;
}
.ws-toggle-btn:hover {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.3);
  color: #d97706;
}
.ws-toggle-btn.ws-toggle-active {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.45);
  color: #10b981;
  font-weight: 600;
}
.ws-toggle-btn.ws-toggle-active:hover {
  background: rgba(16, 185, 129, 0.25);
}

/* Spinner for loading states */
.btn-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ================================================================
   LOGIN & PIN PAD STYLINGS (UI/UX Pro Max)
   ================================================================ */

/* Premium Radial Background for Login Shell */
#login-page {
  min-height: 100vh;
  background: radial-gradient(circle at 50% 50%, #151d38 0%, #080a14 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 32px 16px;
}

/* Frosted Glass Container */
.login-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  padding: 40px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Logo & Header Styling */
.login-card-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.logo-wrapper {
  background: linear-gradient(135deg, var(--pos-primary) 0%, #4d7cff 100%);
  color: white;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
}

.login-logo {
  font-size: 30px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin: 0;
}

.login-subtitle {
  font-size: 15px;
  color: #94a3b8;
  /* slate-400 */
  margin: 0;
}

/* Light Theme Overrides for Login Page */
body.light-theme #login-page {
  background: var(--pos-bg);
}

body.light-theme .login-card {
  background: var(--pos-card);
  border: 1px solid var(--pos-border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

body.light-theme .login-logo {
  color: var(--pos-text);
}

body.light-theme .login-subtitle {
  color: var(--pos-text-muted);
}

body.light-theme .pin-title-styled {
  color: var(--pos-text);
}

body.light-theme .pin-dot {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.2);
}

body.light-theme .pin-dot.filled {
  background: var(--pos-primary);
  border-color: var(--pos-primary);
}

body.light-theme .pin-btn {
  color: var(--pos-text);
}

/* Error Banner in Login */
.login-error-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(233, 69, 96, 0.15);
  border: 1px solid rgba(233, 69, 96, 0.3);
  color: var(--pos-accent);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
}

/* Register input styling */
.register-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.register-input-wrap label {
  font-size: 14px;
  font-weight: 600;
  color: #cbd5e1;
  /* slate-300 */
}

.register-input {
  width: 100%;
  min-height: 52px;
  padding: 8px 16px;
  background: var(--pos-tile-bg);
  border: 1px solid var(--pos-border);
  border-radius: 10px;
  color: var(--pos-text);
  font-size: 20px;
  text-align: center;
  transition: all 0.2s ease;
  font-family: inherit;
}

.register-input:focus {
  outline: none;
  border-color: var(--pos-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  background: var(--pos-tile-hover);
}

/* Staff selection list */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: 100%;
}

.staff-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 100px;
}

/* Hover, Active, and Focus states */
.staff-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

.staff-btn:focus {
  outline: none;
  border-color: var(--pos-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.staff-btn:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.04);
}

.staff-avatar-wrapper {
  background: rgba(255, 255, 255, 0.04);
  padding: 3px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.staff-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pos-primary) 0%, #1f51ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
}

.staff-name {
  font-size: 16px;
  font-weight: 600;
}

.staff-tag-manager {
  font-size: 11px;
  font-weight: 700;
  color: #f59e0b;
  /* amber-500 */
  background: rgba(245, 158, 11, 0.12);
  padding: 3px 8px;
  border-radius: 6px;
}

.staff-tag-cashier {
  font-size: 11px;
  font-weight: 700;
  color: #10b981;
  /* emerald-500 */
  background: rgba(16, 185, 129, 0.12);
  padding: 3px 8px;
  border-radius: 6px;
}

/* Empty cart state */
.cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #f8fafc;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  padding: 32px 16px;
}

body.light-theme .cart-empty {
  color: #0f172a;
}

.cart-empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  margin-bottom: 4px;
}

body.light-theme .cart-empty-icon {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #94a3b8;
}

/* Holds page */
.hold-card {
  background: var(--pos-card);
  border: 1px solid var(--pos-border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hold-card .hold-info {
  flex: 1;
}

.hold-card .hold-label {
  font-size: 20px;
  font-weight: 600;
}

.hold-card .hold-time {
  font-size: 15px;
  color: var(--pos-text-muted);
}

/* ── Scrollbars ── */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--pos-border);
  border-radius: 2px;
}

/* ================================================================
   MODAL BADGES
   ================================================================ */
.location-badge {
  background: #1e293b;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #334155;
  font-weight: bold;
  color: #38bdf8;
}

.expiry-badge {
  padding: 6px 12px;
  border-radius: 12px;
  color: #fff;
  font-weight: bold;
  font-size: 13px;
}

.expiry-badge.status-expired {
  background: var(--pos-danger);
}

.expiry-badge.status-critical {
  background: #ea580c;
}

.expiry-badge.status-warning {
  background: #ca8a04;
}

.expiry-badge.status-caution {
  background: var(--pos-success);
}

.expiry-badge.status-ok {
  background: var(--pos-text-muted);
}


.cart-promo-badge {
  display: inline-block;
  background: var(--pos-accent, #3b82f6);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 12px;
  margin-top: 4px;
}

.wholesale-badge {
  display: inline-block;
  background: #6366f1;
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
}



/* Warning Modal Pulsing Red Border */
@keyframes pulse-red-border {
  0% {
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4), 0 0 0 2px rgba(239, 68, 68, 0.1);
  }

  50% {
    box-shadow: 0 0 22px rgba(239, 68, 68, 0.85), 0 0 0 4px rgba(239, 68, 68, 0.3);
  }

  100% {
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4), 0 0 0 2px rgba(239, 68, 68, 0.1);
  }
}

.pulsing-red-border {
  border: 2px solid #ef4444 !important;
  animation: pulse-red-border 2s infinite ease-in-out;
}

/* Category Navigation Scroll Buttons */
.cat-nav-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--pos-border);
  border-radius: 8px;
  color: var(--pos-text);
  transition: all 0.1s ease;
  flex-shrink: 0;
}

.cat-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.cat-nav-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
   MODERN POS MENU & AUDIO SETTINGS MODAL (UI/UX PRO MAX)
   ========================================================================== */

.pos-modal-v2 {
  max-width: 940px;
  width: 94%;
  padding: 26px 30px;
  background: var(--pos-modal-bg, #0f172a);
  border: 1px solid var(--pos-modal-border, rgba(255, 255, 255, 0.12));
  border-radius: 20px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55);
  box-sizing: border-box;
}

body.light-theme .pos-modal-v2 {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.12);
}

.pos-menu-modal-body {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 30px;
}

.pos-menu-col-left {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--pos-border, rgba(255, 255, 255, 0.08));
  padding-right: 30px;
}

body.light-theme .pos-menu-col-left {
  border-right-color: #e2e8f0;
}

.pos-menu-col-right {
  display: flex;
  flex-direction: column;
}

@media (max-width: 860px) {
  .pos-modal-v2 {
    max-width: 96%;
    padding: 20px;
  }
  .pos-menu-modal-body {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .pos-menu-col-left {
    border-right: none;
    border-bottom: 1px solid var(--pos-border, rgba(255, 255, 255, 0.08));
    padding-right: 0;
    padding-bottom: 20px;
  }
  body.light-theme .pos-menu-col-left {
    border-bottom-color: #e2e8f0;
  }
}

/* Modal Header Bar */
.pos-modal-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--pos-border, rgba(255, 255, 255, 0.08));
}

.pos-modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pos-modal-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--pos-primary, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

body.light-theme .pos-modal-icon-badge {
  background: rgba(79, 70, 229, 0.1);
  color: #4f46e5;
}

.pos-modal-heading {
  font-size: 18px;
  font-weight: 700;
  color: var(--pos-text, #f8fafc);
  margin: 0;
  letter-spacing: -0.02em;
}

.pos-modal-subtitle {
  font-size: 12px;
  color: var(--pos-text-muted, #94a3b8);
  margin-top: 2px;
}

.pos-modal-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--pos-border, rgba(255, 255, 255, 0.08));
  background: rgba(255, 255, 255, 0.04);
  color: var(--pos-text-muted, #94a3b8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  padding: 0;
}

.pos-modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

body.light-theme .pos-modal-close-btn {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #64748b;
}

/* Section Subheading Label */
.pos-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pos-text-muted, #94a3b8);
  display: block;
  margin-bottom: 10px;
}

/* POS Menu Action Grid (6 Cards + 1 Full Action) */
.menu-action-grid-v2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
}

.menu-grid-card-v2 {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--pos-border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  color: var(--pos-text, #f8fafc);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.1s ease, background-color 0.1s ease, border-color 0.1s ease;
  box-sizing: border-box;
}

body.light-theme .menu-grid-card-v2 {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}

.menu-grid-card-v2 .card-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(99, 102, 241, 0.12);
  color: var(--pos-primary, #6366f1);
}

.menu-grid-card-v2.accent-blue .card-icon-wrap { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.menu-grid-card-v2.accent-cyan .card-icon-wrap { background: rgba(6, 182, 212, 0.12); color: #06b6d4; }
.menu-grid-card-v2.accent-amber .card-icon-wrap { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.menu-grid-card-v2.accent-purple .card-icon-wrap { background: rgba(168, 85, 247, 0.12); color: #a855f7; }
.menu-grid-card-v2.accent-orange .card-icon-wrap { background: rgba(249, 115, 22, 0.12); color: #f97316; }
.menu-grid-card-v2.accent-rose .card-icon-wrap { background: rgba(244, 63, 94, 0.12); color: #f43f5e; }

.menu-grid-card-v2 .card-text-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.menu-grid-card-v2 .card-main-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--pos-text, #f8fafc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.light-theme .menu-grid-card-v2 .card-main-title {
  color: #0f172a;
}

.menu-grid-card-v2 .card-sub-hint {
  font-size: 11px;
  color: var(--pos-text-muted, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.card-status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
  flex-shrink: 0;
}

.menu-grid-card-v2:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

body.light-theme .menu-grid-card-v2:hover {
  background: #ffffff;
  border-color: #cbd5e1;
}

.menu-grid-card-v2:active {
  transform: scale(0.98);
}

/* Exit POS Full Width Action */
.menu-action-exit-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin-top: 10px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: 12px;
  color: #ef4444;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.menu-action-exit-btn:hover {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.4);
}

.menu-action-exit-btn:active {
  transform: scale(0.98);
}

.menu-action-exit-btn .exit-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
}

.menu-action-exit-btn .exit-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Live Terminal Status Bar */
.pos-status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--pos-border, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--pos-text-muted, #94a3b8);
}

body.light-theme .pos-status-bar {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}

.status-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.status-sep {
  opacity: 0.4;
}

/* ── Audio Settings Components ── */

/* iOS Style Switch Box */
.pos-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--pos-border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  margin-bottom: 12px;
}

body.light-theme .pos-toggle-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.pos-toggle-info {
  display: flex;
  flex-direction: column;
}

.pos-toggle-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--pos-text, #f8fafc);
}

body.light-theme .pos-toggle-title {
  color: #0f172a;
}

.pos-toggle-desc {
  font-size: 11px;
  color: var(--pos-text-muted, #94a3b8);
  margin-top: 1px;
}

/* Modern Switch Slider */
.pos-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.pos-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.pos-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.12);
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 24px;
}

body.light-theme .pos-slider {
  background-color: #cbd5e1;
}

.pos-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pos-switch input:checked + .pos-slider {
  background-color: var(--pos-success, #10b981);
}

.pos-switch input:checked + .pos-slider:before {
  transform: translateX(20px);
}

/* Volume Control Box */
.volume-control-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--pos-border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

body.light-theme .volume-control-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.volume-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.volume-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--pos-text, #f8fafc);
}

body.light-theme .volume-title {
  color: #0f172a;
}

.volume-badge {
  font-size: 13px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 20px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--pos-primary, #6366f1);
}

body.light-theme .volume-badge {
  background: rgba(79, 70, 229, 0.1);
  color: #4f46e5;
}

.volume-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.volume-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--pos-border, rgba(255, 255, 255, 0.08));
  background: rgba(255, 255, 255, 0.06);
  color: var(--pos-text, #f8fafc);
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.volume-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--pos-primary, #6366f1);
}

body.light-theme .volume-btn {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

.pos-range-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
}

body.light-theme .pos-range-slider {
  background: #cbd5e1;
}

.pos-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--pos-primary, #6366f1);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.pos-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Interactive Tone Cards */
.tone-select-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tone-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--pos-border, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-theme .tone-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.tone-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.3);
}

body.light-theme .tone-card:hover {
  background: #ffffff;
  border-color: #cbd5e1;
}

.tone-card.selected {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--pos-primary, #6366f1);
  box-shadow: 0 0 0 1px var(--pos-primary, #6366f1);
}

body.light-theme .tone-card.selected {
  background: rgba(79, 70, 229, 0.06);
  border-color: #4f46e5;
  box-shadow: 0 0 0 1px #4f46e5;
}

.tone-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.tone-radio-indicator {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--pos-border, rgba(255, 255, 255, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.tone-card.selected .tone-radio-indicator {
  border-color: var(--pos-primary, #6366f1);
  background: var(--pos-primary, #6366f1);
}

.tone-radio-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  display: none;
}

.tone-card.selected .tone-radio-dot {
  display: block;
}

.tone-details {
  display: flex;
  flex-direction: column;
}

.tone-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--pos-text, #f8fafc);
}

body.light-theme .tone-title {
  color: #0f172a;
}

.tone-desc {
  font-size: 11px;
  color: var(--pos-text-muted, #94a3b8);
}

.tone-test-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--pos-border, rgba(255, 255, 255, 0.1));
  background: rgba(255, 255, 255, 0.05);
  color: var(--pos-text, #f8fafc);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tone-test-btn:hover {
  background: var(--pos-primary, #6366f1);
  border-color: var(--pos-primary, #6366f1);
  color: #ffffff;
  transform: scale(1.04);
}

body.light-theme .tone-test-btn {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

/* ==========================================================================
   FIND LOCATION MODAL V2 (UI/UX PRO MAX)
   ========================================================================== */

.loc-modal-card {
  max-width: 680px;
  width: 92%;
  padding: 24px;
  background: var(--pos-modal-bg, #0f172a);
  border: 1px solid var(--pos-modal-border, rgba(255, 255, 255, 0.12));
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

body.light-theme .loc-modal-card {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.18);
}

/* Search Bar Wrapper */
.loc-search-box {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.loc-search-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--pos-text-muted, #94a3b8);
  pointer-events: none;
}

.loc-search-input {
  width: 100%;
  height: 46px;
  padding: 0 44px 0 42px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--pos-border, rgba(255, 255, 255, 0.12));
  border-radius: 12px;
  color: var(--pos-text, #f8fafc);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.loc-search-input:focus {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--pos-primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

body.light-theme .loc-search-input {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

body.light-theme .loc-search-input:focus {
  background: #ffffff;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.loc-search-clear {
  position: absolute;
  right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--pos-text-muted, #94a3b8);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.loc-search-clear:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Results Container */
.loc-results-container {
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

/* Result Item Card */
.loc-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--pos-border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 12px;
}

body.light-theme .loc-item-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.loc-item-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.light-theme .loc-item-card:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.loc-item-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.loc-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--pos-text, #f8fafc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.light-theme .loc-item-name {
  color: #0f172a;
}

.loc-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.12);
  color: var(--pos-success, #10b981);
  border: 1px solid rgba(16, 185, 129, 0.25);
  width: fit-content;
}

.loc-pill.unassigned {
  background: rgba(148, 163, 184, 0.1);
  color: var(--pos-text-muted, #94a3b8);
  border-color: rgba(148, 163, 184, 0.2);
}

.loc-item-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.loc-meta-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.loc-price-tag {
  font-size: 15px;
  font-weight: 800;
  color: var(--pos-accent, #f43f5e);
}

.loc-stock-chip {
  font-size: 11px;
  font-weight: 600;
  color: var(--pos-text-muted, #94a3b8);
}

.loc-stock-chip.high { color: var(--pos-success, #10b981); }
.loc-stock-chip.low { color: var(--pos-warning, #f59e0b); }
.loc-stock-chip.out { color: var(--pos-danger, #ef4444); }

.loc-add-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: var(--pos-primary, #6366f1);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.loc-add-btn:hover {
  background: #4f46e5;
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
}

.loc-add-btn:active {
  transform: scale(0.96);
}

/* Modal Footer Row */
.pos-modal-footer-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--pos-border, rgba(255, 255, 255, 0.08));
}



/* ==========================================================================
   QUICK RESTOCK & APPLY DISCOUNT MODAL STYLES (SINGLE-COLUMN ZERO-SCROLL)
   ========================================================================== */

/* ── 1. Quick Restock Modal ── */
.qr-modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--pos-modal-bg, #1e293b);
  border: 1px solid var(--pos-border, #334155);
  border-radius: 20px;
  padding: 16px 20px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
  color: var(--pos-text, #f8fafc);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body.light-theme .qr-modal-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.15);
}

.qr-product-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--pos-border, #334155);
  border-radius: 12px;
  padding: 10px 12px;
}

body.light-theme .qr-product-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.qr-product-img-wrap {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.qr-product-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--pos-text, #f8fafc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.qr-stock-badges {
  display: flex;
  gap: 6px;
  font-size: 11px;
}

.qr-stock-badge {
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--pos-border, #334155);
  color: var(--pos-text-muted, #94a3b8);
}

body.light-theme .qr-stock-badge {
  background: #ffffff;
  border-color: #cbd5e1;
}

.qr-stock-badge strong {
  color: var(--pos-text, #0f172a);
  margin-left: 2px;
}

.qr-unit-pills {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.2);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--pos-border, #334155);
}

body.light-theme .qr-unit-pills {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.qr-unit-btn {
  flex: 1;
  padding: 5px 8px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--pos-text-muted, #94a3b8);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.qr-unit-btn.active {
  background: var(--pos-primary, #3b82f6);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35);
}

.qr-stepper-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--pos-border, #334155);
  border-radius: 14px;
  padding: 4px 6px;
}

body.light-theme .qr-stepper-box {
  background: #ffffff;
  border-color: #cbd5e1;
}

.qr-stepper-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--pos-border, #334155);
  background: var(--pos-tile-bg, #1e293b);
  color: var(--pos-text, #f8fafc);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}

body.light-theme .qr-stepper-btn {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}

.qr-stepper-btn:active {
  transform: scale(0.94);
  background: var(--pos-primary, #3b82f6);
  color: #ffffff;
}

.qr-qty-input {
  flex: 1;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--pos-text, #f8fafc);
  outline: none;
  font-variant-numeric: tabular-nums;
}

body.light-theme .qr-qty-input {
  color: #0f172a;
}

.qr-conv-hint {
  font-size: 11px;
  color: var(--pos-text-muted, #94a3b8);
  text-align: center;
  min-height: 14px;
}

.qr-preset-chip {
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--pos-border, #334155);
  background: rgba(255, 255, 255, 0.05);
  color: var(--pos-text, #f8fafc);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}

body.light-theme .qr-preset-chip {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

.qr-preset-chip:active {
  background: var(--pos-primary, #3b82f6);
  color: #ffffff;
}

.qr-numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.qr-pad-btn {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--pos-border, #334155);
  background: rgba(255, 255, 255, 0.05);
  color: var(--pos-text, #f8fafc);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
}

body.light-theme .qr-pad-btn {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}

.qr-pad-btn:active {
  background: var(--pos-primary, #3b82f6);
  color: #ffffff;
  transform: scale(0.96);
}

.qr-btn-clear {
  color: #ef4444 !important;
}

.qr-btn-back {
  color: #f59e0b !important;
}

.qr-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.qr-btn-cancel {
  flex: 1;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid var(--pos-border, #334155);
  background: transparent;
  color: var(--pos-text-muted, #94a3b8);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.qr-btn-confirm {
  flex: 1.5;
  min-height: 40px;
  border-radius: 10px;
  border: none;
  background: var(--pos-primary, #3b82f6);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

/* ── 2. Apply Discount Modal ── */
.disc-modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--pos-modal-bg, #1e293b);
  border: 1px solid var(--pos-border, #334155);
  border-radius: 20px;
  padding: 16px 20px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
  color: var(--pos-text, #f8fafc);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body.light-theme .disc-modal-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.15);
}

.disc-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.disc-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.disc-header-icon-mini {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--pos-primary, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.disc-header-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--pos-text, #f8fafc);
}

body.light-theme .disc-header-title {
  color: #0f172a;
}

.disc-header-subtitle {
  margin: 0;
  font-size: 11px;
  color: var(--pos-text-muted, #94a3b8);
}

.disc-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--pos-text-muted, #94a3b8);
  font-size: 15px;
  cursor: pointer;
}

.disc-type-pills {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.2);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--pos-border, #334155);
}

body.light-theme .disc-type-pills {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.disc-type-btn {
  flex: 1;
  padding: 6px 10px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--pos-text-muted, #94a3b8);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}

.disc-type-btn.active {
  background: var(--pos-primary, #6366f1);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
}

.disc-presets-row {
  display: flex;
  gap: 5px;
  justify-content: center;
  flex-wrap: wrap;
}

.disc-preset-chip {
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--pos-border, #334155);
  background: rgba(255, 255, 255, 0.05);
  color: var(--pos-text, #f8fafc);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}

body.light-theme .disc-preset-chip {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

.disc-preset-chip.active,
.disc-preset-chip:active {
  background: var(--pos-primary, #6366f1);
  color: #ffffff;
  border-color: var(--pos-primary, #6366f1);
}

.disc-stepper-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--pos-border, #334155);
  border-radius: 14px;
  padding: 4px 6px;
}

body.light-theme .disc-stepper-box {
  background: #ffffff;
  border-color: #cbd5e1;
}

.disc-stepper-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--pos-border, #334155);
  background: var(--pos-tile-bg, #1e293b);
  color: var(--pos-text, #f8fafc);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.light-theme .disc-stepper-btn {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}

.disc-display-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.disc-qty-input {
  width: 120px;
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--pos-text, #f8fafc);
  outline: none;
  font-variant-numeric: tabular-nums;
}

body.light-theme .disc-qty-input {
  color: #0f172a;
}

.disc-unit-prefix,
.disc-unit-suffix {
  font-size: 18px;
  font-weight: 700;
  color: var(--pos-text-muted, #94a3b8);
}

.disc-calc-preview {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--pos-border, #334155);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--pos-text-muted, #94a3b8);
}

body.light-theme .disc-calc-preview {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.disc-calc-arrow {
  opacity: 0.4;
  font-size: 10px;
}

.disc-numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.disc-numpad-btn {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--pos-border, #334155);
  background: rgba(255, 255, 255, 0.05);
  color: var(--pos-text, #f8fafc);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
}

body.light-theme .disc-numpad-btn {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}

.disc-numpad-btn:active {
  background: var(--pos-primary, #6366f1);
  color: #ffffff;
  transform: scale(0.96);
}

.disc-btn-clear {
  color: #ef4444 !important;
}

.disc-btn-back {
  color: #f59e0b !important;
}

.disc-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.disc-btn-cancel {
  flex: 1;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid var(--pos-border, #334155);
  background: transparent;
  color: var(--pos-text-muted, #94a3b8);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.disc-btn-confirm {
  flex: 1.5;
  min-height: 40px;
  border-radius: 10px;
  border: none;
  background: var(--pos-primary, #6366f1);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}


/* REAL THERMAL RECEIPT SLIP STYLING */
.receipt-paper-slip {
  background: #ffffff;
  color: #111111;
  font-family: 'Courier New', Courier, monospace, 'Noto Sans Khmer', sans-serif;
  padding: 24px 20px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  border: 1px solid #e0e0e0;
  position: relative;
  font-size: 13px;
  line-height: 1.45;
}

.receipt-paper-slip .r-header {
  text-align: center;
  margin-bottom: 12px;
}

.receipt-paper-slip .r-store-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: #000000;
}

.receipt-paper-slip .r-meta-text {
  font-size: 12px;
  color: #444444;
}

.receipt-paper-slip .r-dash-divider {
  border-top: 1px dashed #666666;
  margin: 10px 0;
}

.receipt-paper-slip .r-thick-divider {
  border-top: 2px solid #111111;
  margin: 10px 0;
}

.receipt-paper-slip .r-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.receipt-paper-slip .r-line-bold {
  font-weight: 700;
}

.receipt-paper-slip .r-item-name {
  font-weight: 700;
  font-size: 13px;
  color: #000000;
  word-break: break-word;
}

.receipt-paper-slip .r-item-details {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #333333;
  margin-top: 2px;
  margin-bottom: 6px;
}

.receipt-paper-slip .r-total-row {
  font-size: 17px;
  font-weight: 800;
  color: #000000;
}

/* Opening Float Voucher Receipt Slip & Modal */
.voucher-thermal-slip {
  background: #ffffff;
  color: #111111;
  font-family: 'Courier New', Courier, monospace, 'Battambang', 'Hanuman', sans-serif;
  padding: 16px 14px;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 320px;
  box-sizing: border-box;
  text-align: left;
}
.float-voucher-paper-wrapper {
  max-height: 58vh;
  overflow-y: auto;
  margin: 12px 0;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: center;
}
body.light-theme .float-voucher-paper-wrapper {
  background: #f1f5f9;
  border-color: #e2e8f0;
}
.float-voucher-modal-card {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 18px 20px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.65);
  box-sizing: border-box;
}
body.light-theme .float-voucher-modal-card {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 20px 45px -12px rgba(15, 23, 42, 0.2);
}
.voucher-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.voucher-success-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  flex-shrink: 0;
}
.float-voucher-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.voucher-btn-print {
  flex: 1;
  height: 44px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.15);
  border: 1.5px solid rgba(59, 130, 246, 0.4);
  color: #60a5fa;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.2s ease;
}
.voucher-btn-print:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: #3b82f6;
  color: #93c5fd;
  transform: translateY(-1px);
}
body.light-theme .voucher-btn-print {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}
body.light-theme .voucher-btn-print:hover {
  background: #dbeafe;
  border-color: #3b82f6;
}
.voucher-btn-continue {
  flex: 1.3;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
}
.voucher-btn-continue:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
}
.voucher-btn-close {
  flex: 1;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--pos-text, #f8fafc);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
body.light-theme .voucher-btn-close {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

/* Print Stylesheet for Thermal Receipts */
@media print {
  @page {
    size: 80mm auto;
    margin: 0mm;
  }

  html,
  body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    display: block !important;
  }

  body>* {
    display: none !important;
  }

  #print-receipt-container {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 2mm 0 !important;
    background: #ffffff !important;
    visibility: visible !important;
  }

  #print-receipt-container * {
    visibility: visible !important;
  }

  .receipt-paper-slip {
    box-shadow: none !important;
    border: none !important;
    max-width: 76mm !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 2mm 4mm !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
  }

  .receipt-paper-slip .r-header {
    text-align: center !important;
  }

  .receipt-paper-slip .r-store-title,
  .receipt-paper-slip .r-meta-text {
    text-align: center !important;
  }
}

/* Hold Cart Modal Enhanced Styles */
.hold-preset-chip {
  background: var(--pos-card);
  border: 1px solid var(--pos-border);
  color: var(--pos-text);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hold-preset-chip:hover {
  border-color: var(--pos-warning, #f59e0b);
  color: var(--pos-warning, #f59e0b);
  background: rgba(245, 158, 11, 0.08);
  transform: translateY(-1px);
}

.hold-preset-chip:active {
  transform: scale(0.96);
}

.hold-cart-modal-card {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(245, 158, 11, 0.15);
}

body.light-theme .hold-preset-chip {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #334155;
}

body.light-theme .hold-preset-chip:hover {
  border-color: #d97706;
  color: #d97706;
  background: #fffbeb;
}

body.light-theme .hold-cart-modal-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(245, 158, 11, 0.2);
}

/* ================================================================
   RECALL HELD CARTS MODAL (IN-PAGE FULLSCREEN PRESERVING)
   ================================================================ */
.recall-modal-card {
  max-width: 860px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(245, 158, 11, 0.2);
}

.recall-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--pos-border);
  background: var(--pos-cart-footer-bg);
  flex-shrink: 0;
}

.recall-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.holds-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--pos-card, #1e293b);
  border: 1px solid var(--pos-border, #334155);
  border-radius: 14px;
  padding: 10px 16px;
  margin-bottom: 16px;
}

.holds-filter-bar .search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.holds-filter-bar .search-wrap input {
  background: transparent;
  border: none;
  color: var(--pos-text, #f8fafc);
  font-size: 14px;
  font-weight: 500;
  width: 100%;
  outline: none;
}

.holds-filter-bar .search-wrap input::placeholder {
  color: var(--pos-text-muted, #64748b);
}

.holds-count-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(37, 99, 235, 0.12);
  color: var(--pos-primary, #3b82f6);
  white-space: nowrap;
}

.hold-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modern-hold-card {
  background: var(--pos-card, #1e293b);
  border: 1px solid var(--pos-border, #334155);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.modern-hold-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, #f59e0b, #d97706);
  opacity: 0.8;
  z-index: 2;
}

.modern-hold-card:hover {
  border-color: var(--pos-primary, #3b82f6);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.modern-hold-card.expanded {
  border-color: rgba(37, 99, 235, 0.6);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.hold-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  width: 100%;
  box-sizing: border-box;
}

.hold-main-details {
  flex: 1;
  min-width: 0;
}

.hold-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.hold-badge-label {
  font-size: 16px;
  font-weight: 800;
  color: var(--pos-text, #f8fafc);
  letter-spacing: -0.3px;
}

.hold-time-pill {
  font-size: 12px;
  color: var(--pos-text-muted, #94a3b8);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.hold-items-preview {
  font-size: 13px;
  color: var(--pos-text-muted, #94a3b8);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 440px;
}

.hold-right-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hold-total-amount {
  font-size: 18px;
  font-weight: 800;
  color: var(--pos-success, #10b981);
  font-family: monospace;
  text-align: right;
  min-width: 70px;
}

.btn-resume {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff !important;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  min-height: 40px;
}

.btn-resume:hover:not(.disabled-btn) {
  background: linear-gradient(135deg, #34d399, #059669);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-resume.disabled-btn {
  background: var(--pos-card) !important;
  color: var(--pos-text-muted) !important;
  border: 1px dashed var(--pos-border);
  box-shadow: none !important;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-discard {
  background: transparent;
  border: 1px solid var(--pos-border, #334155);
  color: var(--pos-text-muted, #94a3b8);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 40px;
}

.btn-discard:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  transform: translateY(-1px);
}

.hold-chevron-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pos-text-muted, #94a3b8);
  transition: transform 0.25s ease, background 0.15s ease;
  flex-shrink: 0;
}

.modern-hold-card.expanded .hold-chevron-btn {
  transform: rotate(180deg);
  color: var(--pos-primary, #3b82f6);
  background: rgba(37, 99, 235, 0.12);
}

.hold-accordion-drawer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid transparent;
  cursor: default;
}

.modern-hold-card.expanded .hold-accordion-drawer {
  max-height: 400px;
  border-top-color: var(--pos-border, #334155);
}

.hold-drawer-content {
  padding: 14px 20px 16px 20px;
}

.hold-table-head {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--pos-text-muted, #94a3b8);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--pos-border, #334155);
  margin-bottom: 8px;
}

.hold-scrollable-items {
  max-height: 180px;
  overflow-y: auto;
  padding-right: 6px;
}

.hold-item-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  padding: 7px 0;
  font-size: 13px;
  align-items: center;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.15);
}

.hold-item-row:last-child {
  border-bottom: none;
}

.hold-item-name {
  font-weight: 600;
  color: var(--pos-text, #f8fafc);
}

.hold-item-qty-price {
  text-align: center;
  color: var(--pos-text-muted, #94a3b8);
  font-size: 12px;
}

.hold-item-line-total {
  text-align: right;
  font-weight: 700;
  color: var(--pos-text, #f8fafc);
  font-family: monospace;
}

.hold-drawer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--pos-border, #334155);
  flex-wrap: wrap;
  gap: 10px;
}

.hold-footer-info {
  font-size: 13px;
  color: var(--pos-text-muted, #94a3b8);
}

.empty-holds-view {
  text-align: center;
  padding: 48px 20px;
  background: var(--pos-card, #1e293b);
  border: 1px dashed var(--pos-border, #334155);
  border-radius: 20px;
}

.empty-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

body.light-theme .recall-modal-card {
  background: #ffffff;
}

body.light-theme .holds-filter-bar,
body.light-theme .modern-hold-card,
body.light-theme .empty-holds-view {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

body.light-theme .hold-accordion-drawer {
  background: #f8fafc;
  border-top-color: #e2e8f0;
}

body.light-theme .hold-badge-label,
body.light-theme .hold-item-name,
body.light-theme .hold-item-line-total {
  color: #0f172a;
}

body.light-theme .btn-discard {
  border-color: #cbd5e1;
  color: #64748b;
}

body.light-theme .hold-table-head,
body.light-theme .hold-drawer-footer {
  border-color: #e2e8f0;
}

/* ============================================================
   EXPIRY MONITOR MODAL — Redesign
   ============================================================ */

/* Modal shell */
.exp-modal-shell {
  max-width: 620px;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

/* Header */
.exp-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--pos-border, rgba(255,255,255,0.08));
  flex-shrink: 0;
}

.exp-modal-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.exp-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--pos-text);
  line-height: 1.2;
}

.exp-modal-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--pos-text-muted);
  line-height: 1;
}

.exp-close-btn {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--pos-border, rgba(255,255,255,0.08));
  background: var(--pos-card, rgba(255,255,255,0.04));
  color: var(--pos-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
  flex-shrink: 0;
}
.exp-close-btn:hover {
  background: var(--pos-border, rgba(255,255,255,0.12));
  border-color: rgba(255,255,255,0.2);
  color: var(--pos-text);
}

/* Filter Tab Bar */
.exp-tab-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  background: var(--pos-bg-subtle, rgba(255,255,255,0.03));
  border-bottom: 1px solid var(--pos-border, rgba(255,255,255,0.06));
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.exp-tab-bar::-webkit-scrollbar { display: none; }
.exp-tab-bar.hidden { display: none; }

.exp-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 7px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, opacity 150ms ease;
  background: transparent;
  color: var(--pos-text-muted);
}
.exp-tab-btn:hover:not(:disabled) {
  background: var(--pos-border, rgba(255,255,255,0.08));
  color: var(--pos-text);
}

/* Zero-count tabs: visible but clearly inactive */
.exp-tab-btn.exp-tab-empty {
  opacity: 0.35;
  cursor: default;
}

/* Count badge inside each tab */
.exp-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  background: var(--pos-border, rgba(255,255,255,0.1));
  color: var(--pos-text-muted);
  transition: background 150ms ease, color 150ms ease;
}

/* Active tab — "All" */
.exp-tab-btn.exp-tab-all.exp-tab-active {
  background: var(--pos-primary, #3b82f6);
  border-color: var(--pos-primary, #3b82f6);
  color: #fff;
}
.exp-tab-btn.exp-tab-all.exp-tab-active .exp-tab-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* Active — Expired (red) */
.exp-tab-btn.exp-tab-expired.exp-tab-active {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}
.exp-tab-btn.exp-tab-expired.exp-tab-active .exp-tab-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* Active — Critical (orange) */
.exp-tab-btn.exp-tab-critical.exp-tab-active {
  background: #f97316;
  border-color: #f97316;
  color: #fff;
}
.exp-tab-btn.exp-tab-critical.exp-tab-active .exp-tab-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* Active — Warning (amber) */
.exp-tab-btn.exp-tab-warning.exp-tab-active {
  background: #eab308;
  border-color: #eab308;
  color: #000;
}
.exp-tab-btn.exp-tab-warning.exp-tab-active .exp-tab-count {
  background: rgba(0,0,0,0.15);
  color: #000;
}

/* Active — Caution (lime) */
.exp-tab-btn.exp-tab-caution.exp-tab-active {
  background: #84cc16;
  border-color: #84cc16;
  color: #000;
}
.exp-tab-btn.exp-tab-caution.exp-tab-active .exp-tab-count {
  background: rgba(0,0,0,0.15);
  color: #000;
}

/* Inactive hover accent by severity */
.exp-tab-btn.exp-tab-expired:not(.exp-tab-empty):hover  { border-color: rgba(239,68,68,0.4); color: #ef4444; }
.exp-tab-btn.exp-tab-critical:not(.exp-tab-empty):hover { border-color: rgba(249,115,22,0.4); color: #f97316; }
.exp-tab-btn.exp-tab-warning:not(.exp-tab-empty):hover  { border-color: rgba(234,179,8,0.4);  color: #ca8a04; }
.exp-tab-btn.exp-tab-caution:not(.exp-tab-empty):hover  { border-color: rgba(132,204,22,0.4); color: #65a30d; }

/* Light-theme overrides for tab bar */
body.light-theme .exp-tab-bar {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}
body.light-theme .exp-tab-btn { color: #64748b; }
body.light-theme .exp-tab-btn:hover:not(:disabled) {
  background: #f1f5f9;
  color: #0f172a;
}
body.light-theme .exp-tab-count {
  background: #e2e8f0;
  color: #475569;
}
body.light-theme .exp-tab-btn.exp-tab-warning.exp-tab-active,
body.light-theme .exp-tab-btn.exp-tab-caution.exp-tab-active {
  color: #1a1a1a;
}

/* Results container */
.exp-results-container {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Product row */
.exp-product-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 9px;
  background: var(--pos-card, #1e293b);
  border: 1px solid transparent;
  transition: border-color 150ms ease;
}
.exp-product-row:hover { border-color: var(--pos-border, rgba(255,255,255,0.1)); }

/* Left-accent by severity */
.exp-row-expired  { border-left: 3px solid #ef4444; }
.exp-row-critical { border-left: 3px solid #f97316; }
.exp-row-warning  { border-left: 3px solid #eab308; }
.exp-row-caution  { border-left: 3px solid #84cc16; }
.exp-row-ok       { border-left: 3px solid #10b981; }

.exp-row-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.exp-product-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--pos-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Severity badge */
.exp-severity-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.exp-badge-expired  { background: #ef4444; color: #fff; }
.exp-badge-critical { background: #f97316; color: #fff; }
.exp-badge-warning  { background: #eab308; color: #000; }
.exp-badge-caution  { background: #84cc16; color: #000; }
.exp-badge-ok       { background: #10b981; color: #fff; }

/* Meta row */
.exp-row-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.exp-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--pos-text-muted);
  white-space: nowrap;
}

.exp-days-text {
  color: var(--pos-text-muted);
  opacity: 0.75;
}

/* Stock column */
.exp-row-stock {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 48px;
}

.exp-stock-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--pos-text-muted);
}

.exp-stock-value {
  font-size: 17px;
  font-weight: 800;
  color: var(--pos-text);
  line-height: 1.2;
}
.exp-stock-value.exp-stock-zero { color: #ef4444; }
.exp-stock-value.exp-stock-low  { color: #f97316; }

/* Footer */
.exp-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--pos-border, rgba(255,255,255,0.08));
  flex-shrink: 0;
}
.exp-close-footer-btn {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pos-card, #1e293b);
  border: 1px solid var(--pos-border, rgba(255, 255, 255, 0.14));
  color: var(--pos-text, #f8fafc);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.exp-close-footer-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.exp-close-footer-btn:active {
  transform: scale(0.99);
}

/* Skeleton */
.exp-skeleton-list { padding: 4px 0; display: flex; flex-direction: column; gap: 6px; }
.exp-skeleton-row {
  height: 58px;
  border-radius: 9px;
  background: var(--pos-card, #1e293b);
  position: relative;
  overflow: hidden;
}
.exp-skeleton-row::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.06) 50%, transparent 100%);
  animation: exp-shimmer 1.4s infinite;
}
@keyframes exp-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Empty / error states */
.exp-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--pos-success, #10b981);
  text-align: center;
}

.exp-empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--pos-text, #f8fafc);
}

body.light-theme .exp-empty-title {
  color: #0f172a;
}

.exp-empty-desc {
  font-size: 12px;
  max-width: 320px;
}

.exp-error-state {
  color: #ef4444;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 20px;
  text-align: center;
  font-size: 13px;
}

/* ---- Light theme overrides ---- */
body.light-theme .exp-modal-icon-wrap {
  background: rgba(245, 158, 11, 0.1);
}

body.light-theme .exp-product-row {
  background: #f8fafc;
  border-color: #e2e8f0;
}
body.light-theme .exp-product-row:hover { border-color: #cbd5e1; }

body.light-theme .exp-skeleton-row {
  background: #f1f5f9;
}
body.light-theme .exp-skeleton-row::after {
  background: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.04) 50%, transparent 100%);
}

body.light-theme .exp-s-warning  { color: #a16207; }
body.light-theme .exp-s-caution  { color: #4d7c0f; }
body.light-theme .exp-badge-warning { color: #422006; }
body.light-theme .exp-badge-caution { color: #14532d; }

body.light-theme .exp-modal-footer {
  border-top-color: #e2e8f0;
}
body.light-theme .exp-close-footer-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
body.light-theme .exp-close-footer-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}
body.light-theme .exp-close-btn {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #64748b;
}
body.light-theme .exp-close-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #0f172a;
}

/* ── POS Customer Management Modal (UI/UX Pro Max) ── */
.pos-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.15s ease-out;
}

.pos-customer-dialog {
  background: var(--pos-modal-bg, #0e1526);
  border: 1px solid var(--pos-modal-border, rgba(255, 255, 255, 0.14));
  border-radius: 20px;
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px -10px rgba(0, 0, 0, 0.5);
  animation: modalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  color: var(--pos-text, #f8fafc);
}

body.light-theme .pos-customer-dialog {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 24px 60px -10px rgba(15, 23, 42, 0.2);
  color: #0f172a;
}

.pos-customer-header {
  padding: 18px 24px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--pos-border, rgba(255, 255, 255, 0.08));
}
body.light-theme .pos-customer-header {
  border-bottom-color: #e2e8f0;
}

.pos-customer-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pos-customer-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--pos-primary, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(99, 102, 241, 0.25);
  flex-shrink: 0;
}
body.light-theme .pos-customer-icon-badge {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4f46e5;
}

.pos-customer-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--pos-text, #f8fafc);
}
body.light-theme .pos-customer-title {
  color: #0f172a;
}

.pos-customer-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--pos-text-muted, #94a3b8);
  font-weight: 500;
}
body.light-theme .pos-customer-sub {
  color: #64748b;
}

.pos-modal-close-btn {
  background: none;
  border: none;
  color: var(--pos-text-muted, #94a3b8);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.pos-modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--pos-text, #f8fafc);
}
body.light-theme .pos-modal-close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* Segmented Control Tabs */
.pos-customer-tabs {
  display: flex;
  padding: 12px 24px 8px;
  gap: 8px;
  background: var(--pos-controls-bg, rgba(0, 0, 0, 0.15));
  border-bottom: 1px solid var(--pos-border, rgba(255, 255, 255, 0.08));
}
body.light-theme .pos-customer-tabs {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

.pos-cust-tab-btn {
  flex: 1;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--pos-text-muted, #94a3b8);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}
.pos-cust-tab-btn:hover {
  color: var(--pos-text, #f8fafc);
  background: rgba(255, 255, 255, 0.04);
}
body.light-theme .pos-cust-tab-btn:hover {
  color: #0f172a;
  background: #f1f5f9;
}
.pos-cust-tab-btn.active {
  background: var(--pos-card, #151d33);
  color: var(--pos-primary, #6366f1);
  border-color: var(--pos-border, rgba(255, 255, 255, 0.12));
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
body.light-theme .pos-cust-tab-btn.active {
  background: #ffffff;
  color: #4f46e5;
  border-color: #cbd5e1;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06);
}

/* View Panels */
.pos-cust-view-panel {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: calc(88vh - 130px);
}

/* Search Bar */
.pos-cust-search-bar {
  padding: 16px 24px 10px;
}
.pos-cust-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.pos-cust-search-icon {
  position: absolute;
  left: 14px;
  color: var(--pos-text-muted, #94a3b8);
  pointer-events: none;
}
.pos-cust-input-wrap input {
  width: 100%;
  padding: 12px 38px 12px 42px;
  border-radius: 12px;
  border: 1px solid var(--pos-border, rgba(255, 255, 255, 0.14));
  background: var(--pos-bg, #0b0f19);
  color: var(--pos-text, #f8fafc);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.15s ease;
  box-sizing: border-box;
}
body.light-theme .pos-cust-input-wrap input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}
.pos-cust-input-wrap input:focus {
  outline: none;
  border-color: var(--pos-primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
body.light-theme .pos-cust-input-wrap input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.pos-cust-vk-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--pos-text-muted, #94a3b8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  z-index: 3;
}
.pos-cust-vk-btn:hover {
  background: rgba(99, 102, 241, 0.12);
  color: var(--pos-primary, #6366f1);
}
body.light-theme .pos-cust-vk-btn {
  color: #64748b;
}
body.light-theme .pos-cust-vk-btn:hover {
  background: #e0e7ff;
  color: #4f46e5;
}
.pos-cust-clear-btn {
  position: absolute;
  right: 44px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--pos-text-muted, #94a3b8);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}
.pos-cust-input-wrap input {
  padding-right: 76px;
}

/* Quick section (Walkin) */
.pos-cust-results-header {
  padding: 8px 24px 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pos-text-muted, #94a3b8);
}
body.light-theme .pos-cust-results-header {
  color: #64748b;
}
.pos-cust-count-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--pos-primary, #6366f1);
}

/* Customer Results List */
.pos-cust-results-list {
  padding: 6px 24px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
  max-height: 360px;
}

/* Customer Card */
.pos-cust-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--pos-border, rgba(255, 255, 255, 0.08));
  background: var(--pos-card, #151d33);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}
body.light-theme .pos-cust-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.pos-cust-card:hover {
  border-color: var(--pos-primary, #6366f1);
  background: var(--pos-tile-hover, #1e294b);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
body.light-theme .pos-cust-card:hover {
  background: #f8fafc;
  border-color: #6366f1;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}
.pos-cust-card.focused-card {
  border-color: var(--pos-primary, #6366f1);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}
body.light-theme .pos-cust-card.focused-card {
  background: #eef2ff;
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}
.pos-cust-card.is-active-customer {
  border-color: var(--pos-primary, #6366f1);
  background: rgba(99, 102, 241, 0.08);
}
body.light-theme .pos-cust-card.is-active-customer {
  border-color: #4f46e5;
  background: #eef2ff;
}

.pos-cust-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  color: #ffffff;
}
.pos-cust-avatar.walkin-avatar {
  background: rgba(100, 116, 139, 0.18);
  color: var(--pos-text-muted, #94a3b8);
  border: 1px solid rgba(100, 116, 139, 0.3);
}
body.light-theme .pos-cust-avatar.walkin-avatar {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

.pos-cust-info {
  flex: 1;
  min-width: 0;
}
.pos-cust-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pos-cust-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--pos-text, #f8fafc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.light-theme .pos-cust-name {
  color: #0f172a;
}
.pos-cust-meta {
  font-size: 12px;
  color: var(--pos-text-muted, #94a3b8);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.light-theme .pos-cust-meta {
  color: #64748b;
}

.pos-cust-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 6px;
}
.pos-cust-badge.neutral {
  background: rgba(255, 255, 255, 0.08);
  color: var(--pos-text-muted, #94a3b8);
}
body.light-theme .pos-cust-badge.neutral {
  background: #f1f5f9;
  color: #475569;
}
.pos-cust-badge.company {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
}
body.light-theme .pos-cust-badge.company {
  background: #eef2ff;
  color: #4f46e5;
}

.pos-cust-check-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--pos-success, #10b981);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Register Form Elements */
.pos-cust-form {
  padding: 16px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pos-cust-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pos-cust-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--pos-text, #f8fafc);
}
body.light-theme .pos-cust-label {
  color: #0f172a;
}
.pos-cust-label .req {
  color: #ef4444;
}
.pos-cust-input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pos-cust-field-icon,
.pos-cust-input-icon-wrap > svg:first-child {
  position: absolute;
  left: 14px;
  color: var(--pos-text-muted, #94a3b8);
  pointer-events: none;
}
.pos-cust-input-icon-wrap input {
  width: 100%;
  padding: 11px 40px 11px 42px;
  border-radius: 10px;
  border: 1px solid var(--pos-border, rgba(255, 255, 255, 0.14));
  background: var(--pos-bg, #0b0f19);
  color: var(--pos-text, #f8fafc);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.15s ease;
  box-sizing: border-box;
}
body.light-theme .pos-cust-input-icon-wrap input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}
.pos-cust-input-icon-wrap input:focus {
  outline: none;
  border-color: var(--pos-primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
body.light-theme .pos-cust-input-icon-wrap input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.pos-cust-field-vk-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--pos-text-muted, #94a3b8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  z-index: 3;
}
.pos-cust-field-vk-btn svg,
.pos-cust-vk-btn svg {
  position: static !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  pointer-events: none;
  display: block;
}
.pos-cust-field-vk-btn:hover {
  background: rgba(99, 102, 241, 0.12) !important;
  color: var(--pos-primary, #6366f1) !important;
}
body.light-theme .pos-cust-field-vk-btn {
  color: #64748b;
}
body.light-theme .pos-cust-field-vk-btn:hover {
  background: #e0e7ff !important;
  color: #4f46e5 !important;
}

.pos-cust-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) {
  .pos-cust-grid-2 {
    grid-template-columns: 1fr;
  }
}

.pos-cust-info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--pos-text-muted, #94a3b8);
  font-size: 12px;
  line-height: 1.45;
}
body.light-theme .pos-cust-info-box {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #475569;
}
.pos-cust-info-box svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--pos-primary, #6366f1);
}

.pos-cust-form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--pos-border, rgba(255, 255, 255, 0.08));
}
body.light-theme .pos-cust-form-footer {
  border-top-color: #e2e8f0;
}

/* Customer Display header toggle — active (window open) state */
#btn-customer-display.cd-on {
  color: var(--pos-success, #22c55e);
  border-color: var(--pos-success, #22c55e);
  background: rgba(34, 197, 94, 0.12);
}
#btn-customer-display[hidden] { display: none !important; }
#menu-card-customer-display[hidden] { display: none !important; }

/* Customer Display controls — dimmed + explains itself when the Backoffice
   master switch is off, instead of being invisible (no DevTools needed to diagnose). */
#btn-customer-display.cd-off,
#menu-card-customer-display.cd-off {
  opacity: 0.45;
}
#cd-menu-status { color: var(--pos-text-muted, #94a3b8); font-weight: 500; }
