:root {
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --bg-color: #f0f2f8;
  --card-bg: #fff;
  --text-dark: #1e293b;
  --text-light: #64748b;
  --border-color: #e2e8f0;
  --success-color: #10b981;
  --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --header-height: 68px;
  --cart-width: 360px;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.04);
  --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.15);
  --radius: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-color);
  color: var(--text-dark);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.pos-header {
  min-height: var(--header-height);
  height: auto;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-bottom: 1px solid rgb(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.5rem;
  z-index: 10;
  box-shadow: 0 4px 20px rgb(0,0,0,0.15);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.pos-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  transform: translateX(0);
}

.pos-nav-brand-mark {
  border-radius: 10px;
  box-shadow: 0 2px 12px rgb(99, 102, 241, 0.45), 0 1px 4px rgb(245, 158, 11, 0.35);
  display: block;
  width: 40px;
  height: 40px;
}

.pos-nav-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.pos-nav-brand .erp-logo-gradient-text {
  background: linear-gradient(90deg, #38bdf8, #6366f1, #f472b6, #f59e0b, #38bdf8);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
  font-size: 1.15rem;
  line-height: 1;
  animation: brandGradientShift 4s ease-in-out infinite;
}

.erp-app-switcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgb(255,255,255,0.12);
  background: rgb(255,255,255,0.06);
  color: rgb(255,255,255,0.9);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.erp-app-switcher:hover,
.erp-app-switcher[aria-expanded="true"] {
  background: rgb(255,255,255,0.12);
  border-color: rgb(255,255,255,0.22);
  color: #fff;
}

.pos-product-label {
  color: rgb(255,255,255,0.78);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.brand-logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: rgb(255,255,255,0.85);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.brand-logo i {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.3rem;
}

.brand-gradient {
  background: linear-gradient(90deg, #38bdf8, #6366f1, #f472b6, #f59e0b, #38bdf8);
  background-size: 200% 200%;
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
          background-clip: text;
  font-weight: 900;
  filter: drop-shadow(0 2px 8px rgb(245,158,11,0.3));
  animation: brandGradientShift 4s ease-in-out infinite;
}

@keyframes brandGradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.store-selector {
  background: rgb(255,255,255,0.08);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  color: rgb(255,255,255,0.85);
  border: 1px solid rgb(255,255,255,0.1);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.store-selector:hover {
  background: rgb(255,255,255,0.14);
  border-color: rgb(255,255,255,0.2);
  color: white;
  transform: translateY(-1px);
}

/* Custom Currency Dropdown */
.currency-dropdown {
  position: relative;
  min-width: 140px;
}

.dropdown-trigger {
  background: #f8fafc;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-dark);
  border: 1px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  transition: all 0.2s;
}

.dropdown-trigger:hover {
  background: white;
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgb(99, 102, 241, 0.15);
}

.dropdown-menu {
  position: absolute;
  top: 110%;
  left: 0;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 280px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  animation: fadeIn 0.15s ease-out;
}

.dropdown-menu.active {
  display: block;
}

.dropdown-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-dark);
  transition: background 0.15s;
}

.dropdown-item:hover {
  background: #f1f5f9;
  color: var(--primary-color);
}

.dropdown-item.selected {
  background: #e0e7ff;
  color: var(--primary-color);
  font-weight: 700;
}

.dropdown-search {
  padding: 0.8rem;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
}

.dropdown-search input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.85rem;
  outline: none;
}

.dropdown-search input:focus {
  border-color: var(--primary-color);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scrollbar for dropdown */
.dropdown-menu::-webkit-scrollbar {
  width: 6px;
}

.dropdown-menu::-webkit-scrollbar-track {
  background: transparent;
}

.dropdown-menu::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.header-search {
  flex: 1;
  max-width: 640px;
  margin: 0 1.25rem;
  position: relative;
}

/* Light-surface default — currency/settings/payment/product modal fields */
.search-input {
  width: 100%;
  padding: 0.75rem 1.2rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.25s;
  color: var(--text-dark);
  caret-color: var(--text-dark);
  -webkit-text-fill-color: var(--text-dark);
  box-shadow: none;
}

.search-input::-moz-placeholder {
  color: var(--text-light);
  opacity: 1;
  -webkit-text-fill-color: var(--text-light);
}

.search-input::placeholder {
  color: var(--text-light);
  opacity: 1;
  -webkit-text-fill-color: var(--text-light);
}

.search-input:focus {
  background: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgb(99, 102, 241, 0.2);
}

/* Header product search stays white-on-dark over the POS chrome */
.header-search .search-input {
  padding: 0.75rem 1.2rem 0.75rem 2.8rem;
  border-radius: 99px;
  border: 1px solid rgb(255,255,255,0.12);
  background: rgb(255,255,255,0.1);
  color: #fff;
  caret-color: #fff;
  -webkit-text-fill-color: #fff;
}

.header-search .search-input::-moz-placeholder {
  color: rgb(255,255,255,0.4);
  -webkit-text-fill-color: rgb(255,255,255,0.4);
}

.header-search .search-input::placeholder {
  color: rgb(255,255,255,0.4);
  -webkit-text-fill-color: rgb(255,255,255,0.4);
}

.header-search .search-input:focus {
  background: rgb(255,255,255,0.12);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgb(99, 102, 241, 0.2);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgb(255,255,255,0.4);
  font-size: 0.95rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.action-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid rgb(255,255,255,0.08);
  background: rgb(255,255,255,0.05);
  color: rgb(255,255,255,0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  transition: all 0.2s;
}

.action-btn:hover {
  background: rgb(255,255,255,0.12);
  color: white;
  border-color: rgb(255,255,255,0.15);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.7rem 0.35rem 0.35rem;
  border-radius: 99px;
  cursor: pointer;
  background: rgb(255,255,255,0.06);
  border: 1px solid rgb(255,255,255,0.08);
  transition: all 0.2s;
}

.user-profile span {
  color: rgb(255,255,255,0.85);
}

.user-profile:hover {
  background: rgb(255,255,255,0.1);
  border-color: rgb(255,255,255,0.15);
}

.pos-util-bar {
  display: flex;
  align-items: center;
  margin-left: 0.25rem;
  flex-shrink: 0;
}

.pos-util-bar .util-bar-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  height: auto;
  padding: 0;
}

.pos-util-bar .util-btn,
.pos-util-bar .util-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 12px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.pos-util-bar .util-btn:hover,
.pos-util-bar .util-lang-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.pos-util-bar .lp-is-0dff8938 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 0;
}

.pos-util-bar .lp-is-1cb8fdef {
  background: transparent;
  color: #ef4444;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 0;
  font-size: 18px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  box-shadow: none;
}

.pos-util-bar .lp-is-aa714ab5,
.pos-util-bar #navUserChip.nav-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 3px 10px 3px 4px;
  flex-shrink: 0;
}

.pos-util-bar #navUserChip .nav-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.pos-util-bar #navNotifWrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.pos-util-bar #navNotifBell {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #ef4444;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.pos-util-bar #navNotifBell:hover {
  color: #f87171;
  background: rgba(255, 255, 255, 0.08);
}

.pos-util-bar #navNotifBadge.nav-bell-badge-hidden {
  display: none !important;
}

.pos-util-bar #navNotifPanel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgb(0, 0, 0, 0.45);
  z-index: 100010;
  overflow: hidden;
}

.pos-util-bar #navNotifPanel.nav-bell-panel-hidden,
.pos-util-bar .lp-is-cb458930 {
  display: none !important;
}

.pos-util-bar .nav-bell-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #334155;
  font-weight: 700;
  font-size: 0.82rem;
  color: #f1f5f9;
}

.pos-util-bar .nav-bell-panel-empty {
  padding: 18px 14px;
  color: #94a3b8;
  font-size: 0.78rem;
  text-align: center;
}

.pos-util-bar .lp-is-54857e94 {
  display: none !important;
}

.pos-util-bar .util-lang-wrap {
  position: relative;
  z-index: 100002;
}

.pos-util-bar .util-lang-wrap .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  min-width: 110px;
  margin-top: 4px;
  z-index: 100003;
  list-style: none;
  padding: 6px 0;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.pos-util-bar .util-lang-wrap .dropdown-menu.is-open {
  display: block;
}

.pos-util-bar .util-lang-wrap .dropdown-menu a {
  display: block;
  padding: 6px 12px;
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.78rem;
}

.pos-util-bar .util-lang-wrap .dropdown-menu a:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Atlas POS has no modules sidebar — keep Explore usable on desktop too. */
@media (min-width: 901px) {
  body.pos-terminal #erpExplorePanel:not([hidden]) {
    position: fixed !important;
    inset: 0 !important;
    z-index: 100010 !important;
    display: flex !important;
    flex-direction: column !important;
    background: #0b1120 !important;
    color: #e8edf7 !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  body.pos-terminal #erpExplorePanel[hidden] {
    display: none !important;
  }

  body.pos-terminal .erp-explore__chrome {
    flex: 0 0 auto;
    padding: 10px 16px 8px;
  }

  body.pos-terminal .erp-explore__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  body.pos-terminal .erp-explore__title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
  }

  body.pos-terminal .erp-explore__brand {
    background: linear-gradient(120deg, #38bdf8 0%, #6366f1 34%, #f472b6 67%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
  }

  body.pos-terminal .erp-explore__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
  }

  body.pos-terminal .erp-explore__search {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 8px 0 12px;
    margin: 8px 0 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.25);
  }

  body.pos-terminal .erp-explore__search input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: #e8edf7;
    font-size: 16px;
    height: 44px;
  }

  body.pos-terminal .erp-explore__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 16px 16px;
  }

  body.pos-terminal #erpExplorePanel .erp-explore__section {
    margin: 0 0 12px !important;
    padding: 0 !important;
  }

  body.pos-terminal .erp-explore__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 8px;
  }

  body.pos-terminal .erp-explore__head h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
  }

  body.pos-terminal .erp-explore__viewall {
    border: 0;
    background: transparent;
    color: #6ea8fe;
    font-weight: 600;
    cursor: pointer;
  }

  body.pos-terminal .erp-explore__grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 8px;
  }

  body.pos-terminal #erpExplorePanel.erp-explore--preview .erp-explore__tile:nth-child(n + 9) {
    display: none !important;
  }

  body.pos-terminal .erp-explore__tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 4px 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #e8edf7;
    text-decoration: none;
    text-align: center;
    min-height: 80px;
  }

  body.pos-terminal .erp-explore__tile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 1.05rem;
  }

  body.pos-terminal .erp-explore__tile-label {
    font-size: 0.72rem;
    font-weight: 600;
  }

  body.pos-terminal .erp-explore__tabs {
    display: flex;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
  }

  body.pos-terminal .erp-explore__tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-weight: 600;
  }

  body.pos-terminal .erp-explore__tab.is-active {
    color: #fff;
  }

  body.pos-terminal html.erp-explore-open #erpAppSwitcher,
  html.erp-explore-open body.pos-terminal #erpAppSwitcher {
    border-color: #8b5cf6 !important;
    color: #c4b5fd !important;
  }
}

.pos-auth-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.pos-auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgb(255,255,255,0.14);
  background: rgb(255,255,255,0.08);
  color: rgb(255,255,255,0.92);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.pos-auth-btn[hidden] {
  display: none !important;
}

.pos-auth-btn:hover {
  background: rgb(255,255,255,0.14);
  border-color: rgb(255,255,255,0.22);
  color: #fff;
}

.pos-auth-btn.pos-auth-logout {
  background: linear-gradient(135deg, #f97316, #ea580c);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgb(249, 115, 22, 0.35);
}

.pos-auth-btn.pos-auth-logout:hover {
  background: linear-gradient(135deg, #fb923c, #f97316);
  box-shadow: 0 4px 14px rgb(249, 115, 22, 0.5);
}

.pos-header-util-actions.mobile-util-actions {
  display: none !important;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 4px 10px rgb(99, 102, 241, 0.3);
}

/* Layout */
.pos-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}

/* Catalog Section (Left) */
.catalog-section {
  flex: 1;
  min-width: 0;          /* allow flex child to shrink below content size */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-color);
  position: relative;
  z-index: 1;
}

.category-tabs {
  padding: 0.35rem 1.5rem 0.75rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  background: transparent;
}

.cat-tab {
  padding: 0.6rem 1.2rem;
  border-radius: 99px;
  background: white;
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cat-tab i {
  font-size: 0.8rem;
  opacity: 0.6;
}

.cat-tab .cat-count {
  background: #f1f5f9;
  color: var(--text-light);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  min-width: 22px;
  text-align: center;
  transition: all 0.2s;
}

.cat-tab:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.cat-tab:hover i { opacity: 1; }

.cat-tab.active {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
  box-shadow: 0 6px 18px rgb(99, 102, 241, 0.35);
}

.cat-tab.active i { opacity: 1; }

.cat-tab.active .cat-count {
  background: rgb(255,255,255,0.25);
  color: white;
}

.product-grid {
  flex: 1;
  padding: 1rem 1.5rem 1.5rem;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 1.1rem;
  align-content: start;
}

/* Grouped (All Items) layout */
.product-grid.grouped {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.category-group-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--border-color);
}

.cg-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgb(99,102,241,0.25);
}

.cg-label {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-dark);
  letter-spacing: -0.2px;
}

.cg-count {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  background: #f1f5f9;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
}

.product-subgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 1.1rem;
}

/* Custom scrollbar for product grid */
.product-grid::-webkit-scrollbar { width: 6px; }
.product-grid::-webkit-scrollbar-track { background: transparent; }
.product-grid::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }

.product-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  position: relative;
  animation: cardIn 0.35s ease both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgb(99, 102, 241, 0.2);
}

.product-card:active {
  transform: translateY(-2px) scale(0.98);
}

.card-add-btn {
  width: 100%;
  border: 0;
  border-radius: 0 0 14px 14px;
  background: var(--primary-gradient, linear-gradient(135deg, #6366f1, #4f46e5));
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
  padding: 0.7rem 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  letter-spacing: 0.3px;
  cursor: pointer;
  margin-top: auto;
}

.card-add-btn:hover:not(:disabled) {
  filter: brightness(1.05);
}

.card-add-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #94a3b8;
}

.product-card.out-of-stock {
  cursor: pointer;
}

.product-image {
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid #f1f5f9;
  overflow: hidden;
}

.product-icon {
  font-size: 2.8rem;
  opacity: 0.85;
  transition: all 0.3s;
  filter: drop-shadow(0 4px 12px rgb(0,0,0,0.08));
}

.product-card:hover .product-icon {
  transform: scale(1.12);
  opacity: 1;
}

.product-price-badge {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  background: white;
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  font-weight: 800;
  color: var(--primary-color);
  font-size: 0.85rem;
  box-shadow: 0 2px 10px rgb(0,0,0,0.06);
  border: 1px solid #f1f5f9;
}

.product-details {
  padding: 0.9rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-name {
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.4rem;
  line-height: 1.35;
  font-size: 0.92rem;
}

.product-meta {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 500;
}

.cat-label {
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0.7;
  text-transform: capitalize;
}

.cat-label i { font-size: 0.65rem; }

.stock-tag {
  color: var(--success-color);
  background: #ecfdf5;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stock-tag.low {
  color: var(--warning-color);
  background: #fffbeb;
}

/* Cart Section (Right) */
.cart-section {
  width: var(--cart-width);
  flex-shrink: 0;        /* prevent cart from shrinking into catalog area */
  background: white;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 30px rgb(0,0,0,0.04);
  border-left: 1px solid var(--border-color);
  position: relative;
  z-index: 2;            /* only needs to be above catalog (z-index:1) for shadow */
  min-height: 0;
  overflow: hidden;
}

/* Desktop/laptop: hide right cart sidebar when empty so catalog uses full width.
   Mobile (≤900px) keeps FAB + bottom sheet — do not display:none the sheet there. */
@media (width > 900px) {
  body.pos-cart-empty .cart-section,
  .cart-section.is-cart-empty {
    display: none;
  }
}

.cart-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
}

.cart-header .action-btn {
  background: #f1f5f9;
  color: var(--text-light);
  border-color: var(--border-color);
}

.cart-header .action-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.customer-select {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.9rem;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  width: 100%;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.customer-select:hover {
  background: white;
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgb(99, 102, 241, 0.1);
}

.customer-icon {
  width: 34px;
  height: 34px;
  background: #eff6ff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-size: 0.9rem;
}

.cart-items-container {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0;
  background: white;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 1;
}

.cart-items-container::-webkit-scrollbar { width: 4px; }
.cart-items-container::-webkit-scrollbar-track { background: transparent; }
.cart-items-container::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 99px; }

.cart-empty-state {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  gap: 0.8rem;
  opacity: 0.6;
}

.cart-empty-state i { font-size: 2.5rem; }
.cart-empty-state p { font-size: 0.9rem; font-weight: 500; }

.cart-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f8fafc;
  gap: 0.8rem;
  transition: background 0.2s;
  animation: slideIn 0.2s ease;
}

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

.cart-item:hover {
  background-color: #fafbfe;
}

.item-qty-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  background: #f1f5f9;
  padding: 0.2rem;
  border-radius: 99px;
  height: 90px;
  justify-content: space-between;
}

.qty-btn {
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  border: none;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-dark);
  box-shadow: 0 1px 4px rgb(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.2s;
  flex-shrink: 0;
}

.qty-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

.item-qty-input {
  width: 22px;
  text-align: center;
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-dark);
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-dark);
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-price {
  color: var(--text-light);
  font-size: 0.8rem;
  font-weight: 500;
}

.item-total {
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary-color);
  min-width: 70px;
  text-align: right;
}

.item-remove {
  color: #ef4444;
  opacity: 0.2;
  cursor: pointer;
  padding: 0.4rem;
  transition: all 0.2s;
  font-size: 0.85rem;
}

.item-remove:hover {
  opacity: 1;
  background: #fef2f2;
  border-radius: 8px;
}

.cart-summary {
  padding: 1.25rem;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-top: 1px solid var(--border-color);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 500;
}

.summary-row.total {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px dashed #cbd5e1;
  color: var(--text-dark);
  font-weight: 900;
  font-size: 1.4rem;
  align-items: flex-end;
}

.cart-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 1.25rem;
  background: white;
  border-top: 1px solid var(--border-color);
}

.cart-btn {
  padding: 0.9rem;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  letter-spacing: 0.3px;
}

.btn-suspend {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid var(--border-color);
}

.btn-suspend:hover {
  background: #e2e8f0;
  color: #334155;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-pay {
  grid-column: span 2;
  background: var(--success-gradient);
  color: white;
  box-shadow: 0 6px 20px -4px rgb(16, 185, 129, 0.4);
  font-size: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.btn-pay:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px -6px rgb(16, 185, 129, 0.5);
}

.btn-cancel {
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
}

.btn-cancel:hover {
  background: #ffe4e6;
  color: #be123c;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgb(15, 23, 42, 0.6);
  -webkit-backdrop-filter: blur(12px);
          -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-container {
  background: white;
  border-radius: 20px;
  width: 90%;
  max-width: 520px;
  padding: 2rem;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-container {
  transform: scale(1) translateY(0);
}

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--text-dark);
}

.payment-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.payment-method-card {
  padding: 1.5rem 1.2rem;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: #f8fafc;
  position: relative;
  overflow: hidden;
}

.payment-method-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.payment-method-card:hover {
  border-color: var(--primary-color);
  background: white;
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgb(99, 102, 241, 0.15);
}

.payment-method-card:hover::before {
  opacity: 0.04;
}

.payment-method-card i {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
  color: var(--text-light);
  transition: all 0.2s;
  position: relative;
}

.payment-method-card:hover i {
  color: var(--primary-color);
  transform: scale(1.1);
}

.payment-method-card span {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-dark);
  position: relative;
}

/* Currency Modal Styles */
#currencyModal .search-wrapper {
  margin-bottom: 0;
}

#currencySearchInput,
#currencyModal .search-input {
  color: var(--text-dark);
  caret-color: var(--text-dark);
  -webkit-text-fill-color: var(--text-dark);
  background: #fff;
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.2rem;
}

#currencySearchInput::-moz-placeholder,
#currencyModal .search-input::-moz-placeholder {
  color: var(--text-light);
  opacity: 1;
  -webkit-text-fill-color: var(--text-light);
}

#currencySearchInput::placeholder,
#currencyModal .search-input::placeholder {
  color: var(--text-light);
  opacity: 1;
  -webkit-text-fill-color: var(--text-light);
}

#currencySearchInput:focus,
#currencyModal .search-input:focus {
  background: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgb(99, 102, 241, 0.2);
}

.currency-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
  padding: 4px;
  margin-top: 1.5rem;
}

.currency-option-card {
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  background: white;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.currency-option-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.currency-option-card.active {
  background: #eff6ff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgb(99, 102, 241, 0.2);
}

.currency-code {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.currency-name {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.3;
}

/* Scrollbar specific for modal grid */
.currency-grid::-webkit-scrollbar {
  width: 8px;
}

.currency-grid::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.currency-grid::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Keyboard Shortcuts Hint */
.shortcut-hint {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  font-size: 0.75rem;
  color: #94a3b8;
  background: rgb(255,255,255,0.8);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

/* Responsive adjustments */
@media (width <= 1100px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .user-profile span {
    display: none;
  }

  .brand-logo {
    font-size: 1.15rem;
  }

  .store-selector {
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
  }
}

/* Mobile cart chrome — hidden on desktop */
.pos-cart-sheet-handle,
.pos-cart-backdrop,
.pos-mobile-cart-fab {
  display: none;
}

@media (width <= 900px) {
  body.pos-terminal {
    height: 100dvh;
    max-height: 100dvh;
  }

  .pos-layout {
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .catalog-section {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }

  .category-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0.85rem 0.55rem;
    gap: 0.45rem;
  }

  .cat-tab {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.5rem 0.85rem;
    font-size: 0.78rem;
  }

  .product-grid,
  .product-grid:not(.grouped) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0.65rem 0.75rem 1rem;
    gap: 0.65rem;
  }

  .product-grid.grouped .product-subgrid,
  .product-subgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  body.pos-terminal .product-grid:not(.grouped),
  body.pos-terminal .product-subgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .header-search {
    margin: 0;
    max-width: none;
  }

  .pos-header .action-btn,
  .cart-header .action-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .pos-header-text-btn {
    width: 40px;
    padding: 0;
    font-size: 0;
    gap: 0;
  }

  .pos-header-text-btn i {
    font-size: 0.95rem;
  }

  .qty-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
  }

  /* Bottom cart sheet */
  .pos-cart-sheet-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0.55rem 0.75rem 0.25rem;
    cursor: pointer;
    color: #64748b;
    font-weight: 700;
    font-size: 0.8rem;
  }

  .pos-cart-sheet-handle-bar {
    width: 42px;
    height: 4px;
    border-radius: 99px;
    background: #cbd5e1;
  }

  .pos-cart-sheet-handle-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .pos-cart-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.pos-cart-sheet-open .pos-cart-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .cart-section {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    max-height: min(82dvh, 720px);
    border-left: none;
    border-top: 1px solid var(--border-color);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
    z-index: 60;
    transform: translateY(calc(100% - 0px));
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  body:not(.pos-cart-sheet-open) .cart-section {
    transform: translateY(100%);
    pointer-events: none;
  }

  body.pos-cart-sheet-open .cart-section {
    transform: translateY(0);
    pointer-events: auto;
  }

  .pos-mobile-cart-fab {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    position: fixed;
    left: 50%;
    bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 50;
    border: 0;
    border-radius: 999px;
    padding: 0.75rem 1.1rem;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
    cursor: pointer;
    max-width: calc(100vw - 1.5rem);
  }

  body.pos-cart-sheet-open .pos-mobile-cart-fab {
    display: none;
  }

  .pos-mobile-cart-fab-count {
    min-width: 1.4rem;
    height: 1.4rem;
    border-radius: 999px;
    background: #6366f1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
  }

  .pos-mobile-cart-fab-total {
    opacity: 0.9;
    font-size: 0.85rem;
  }

  .product-detail-modal {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
  }

  .product-detail-media {
    min-height: 220px;
    max-height: 42dvh;
  }

  #productsModal .modal-container,
  #settingsModal .modal-container,
  #currencyModal .modal-container,
  #paymentModal .modal-container,
  #customerModal .modal-container {
    width: 100vw;
    max-width: 100vw;
    max-height: min(92dvh, calc(100dvh - env(safe-area-inset-bottom, 0px)));
    height: auto;
    border-radius: 16px 16px 0 0;
    margin-top: auto;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* Payment sheet: keep all methods + Cancel reachable on short phones */
  #paymentModal.modal-overlay.active {
    align-items: flex-end;
    overflow: hidden;
  }

  #paymentModal .modal-container {
    max-height: min(90dvh, calc(100dvh - 0.5rem - env(safe-area-inset-bottom, 0px)));
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }

  /* Sticky title must be opaque so scrolled method cards do not bleed through */
  #paymentModal .modal-header {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #fff;
    margin: -0.25rem 0 0;
    padding-bottom: 0.35rem;
  }

  .modal-overlay.active {
    align-items: flex-end;
  }
}

@media (width <= 768px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .pos-header,
  .pos-topbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand actions"
      "search search";
    align-items: center;
    gap: 0.4rem 0.5rem;
    overflow: visible;
    padding: 0.45rem 0.65rem 0.5rem;
    min-height: 0;
  }

  .brand-section {
    grid-area: brand;
    display: flex !important;
    flex: 0 1 auto !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.35rem;
    min-width: 0;
    max-height: 40px;
    overflow: hidden;
  }

  .header-actions {
    grid-area: actions;
    display: flex !important;
    flex: 0 0 auto !important;
    gap: 0.25rem;
    align-items: center;
  }

  .header-search {
    grid-area: search;
    display: block !important;
    order: unset !important;
    flex: unset !important;
    width: 100%;
    max-width: none !important;
    margin: 0 !important;
  }

  .pos-nav-brand-mark {
    width: 32px !important;
    height: 32px !important;
  }

  .pos-nav-brand-text {
    display: none !important;
  }

  body.pos-terminal .pos-header a.pos-nav-brand,
  body.pos-terminal .pos-header .pos-nav-brand {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    overflow: hidden;
    padding: 0 !important;
    gap: 0 !important;
  }

  .erp-app-switcher {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
  }

  .brand-section > .store-selector {
    display: none;
  }

  .pos-currency-wrapper .store-selector {
    padding: 0.3rem 0.45rem;
    font-size: 0.72rem;
  }

  .pos-header .action-btn,
  .cart-header .action-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .pos-header-text-btn {
    width: 36px;
  }

  .header-search .search-input {
    height: 38px;
    min-height: 38px;
    font-size: 0.85rem;
  }

  .pos-util-bar {
    display: none !important;
  }

  .pos-auth-btn span {
    display: none;
  }

  .pos-auth-btn {
    padding: 0.45rem 0.65rem;
  }

  .pos-product-label {
    display: none;
  }

  .pos-header-util-actions .mobile-util-label {
    display: none;
  }

  .pos-header-util-actions .mobile-util-action {
    padding: 0.45rem 0.65rem;
  }

  .category-tabs {
    /* sticky + visible scrollbar applied in ≤1024 tablet/mobile block */
    z-index: 1;
  }

  .pos-currency-wrapper,
  .store-selector {
    min-width: 0;
  }

  .pos-layout,
  .pos-container,
  .pos-app {
    overflow-x: hidden;
    max-width: 100vw;
  }

  #ordersPanel.orders-panel:not(.open),
  .orders-panel:not(.open) {
    transform: translateX(100%);
    pointer-events: none;
  }

  .orders-panel {
    width: min(100vw, 420px);
  }

  .card-add-btn {
    font-size: 0.78rem;
    padding: 0.6rem 0.5rem;
  }

  .product-name {
    font-size: 0.85rem;
  }

  .cart-header .action-btn.lp-is-3f091f2c:last-of-type {
    display: none;
  }
}

@media (width <= 600px) {
  .header-search {
    display: block;
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    margin: 0;
  }
  .pos-header {
    flex-wrap: wrap;
  }
  .pos-header .action-btn[title="Fullscreen"] { display: none; }
  .user-profile span { display: none; }
  .user-profile { padding: 0.25rem; }

  .cat-tab {
    padding: 0.45rem 0.75rem;
    font-size: 0.75rem;
    min-height: 0;
    min-width: 0;
  }
  .product-grid { padding: 0.65rem 0.7rem 1rem; gap: 0.65rem; }
  .cart-item { padding: 0.8rem; }
  .item-qty-control { height: auto; flex-direction: row; gap: 8px; width: 96px; padding: 4px; }
  .cart-header { padding: 0.7rem 0.85rem; }
  .cart-summary { padding: 0.8rem; }
  .card-add-btn { font-size: 0.75rem; padding: 0.55rem; }

  .cart-actions {
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    gap: 0.5rem;
  }

  .cart-btn {
    min-height: 44px;
  }

  .product-image {
    height: 110px;
  }
}

/* Cart-header tools for Settings / Sales on narrow layouts */
.mobile-pos-tools {
  display: none;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

@media (width <= 768px) {
  .mobile-pos-tools {
    display: flex;
  }
}

.mobile-pos-tools .action-btn {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #334155;
}

/* Standalone POS: hide chat FAB so it cannot cover Pay / Clear */
body.pos-terminal #chatWidget,
body.pos-terminal #erpLiveChatGlobal + #chatWidget,
.pos-header ~ #chatWidget {
  display: none !important;
}

/* ═══ MOBILE OVERRIDES — POS-specific ═══ */
/* Beat global mobile-responsive fixed bottom-sheet rules that omit overflow */
@media (width <= 900px) {
  body.pos-terminal #paymentModal .modal-container {
    max-height: min(90dvh, calc(100dvh - 0.5rem - env(safe-area-inset-bottom, 0px))) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  body.pos-terminal #paymentModal .modal-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 3 !important;
    background: #fff !important;
  }
}

@media (width <= 480px) {
  .payment-methods {
    grid-template-columns: 1fr !important;
  }

  /* Category tabs (non-grouped) and All Items subgrids: always 2-up on phones */
  .product-grid,
  .product-grid:not(.grouped),
  .product-grid.grouped .product-subgrid,
  .product-subgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  body.pos-terminal .product-grid:not(.grouped),
  body.pos-terminal .product-subgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .pos-mobile-cart-fab-label {
    display: none;
  }

  .pos-currency-wrapper {
    display: none;
  }
}

/* Beat global mobile-responsive.css 44px touch mins inside Atlas POS chrome */
@media (width <= 900px) {
  body.pos-terminal .pos-header .action-btn,
  body.pos-terminal .pos-header .erp-app-switcher,
  body.pos-terminal .pos-header .pos-header-text-btn,
  body.pos-terminal .pos-header a.pos-nav-brand,
  body.pos-terminal .pos-header .pos-nav-brand,
  body.pos-terminal .pos-header [role="button"],
  body.pos-terminal .pos-header .store-selector,
  body.pos-terminal .cart-header .action-btn,
  body.pos-terminal .mobile-pos-tools .action-btn,
  body.pos-terminal .cat-tab,
  body.pos-terminal .qty-btn,
  body.pos-terminal .card-add-btn {
    min-height: 0 !important;
    min-width: 0 !important;
  }

  body.pos-terminal .pos-header a.pos-nav-brand,
  body.pos-terminal .pos-header .pos-nav-brand {
    width: auto !important;
    max-width: none;
    padding: 0 !important;
    gap: 0 !important;
  }

  body.pos-terminal .pos-header .pos-nav-brand-text {
    display: none !important;
  }

  body.pos-terminal .brand-section {
    flex-wrap: nowrap !important;
    align-items: center !important;
    max-width: calc(100% - 8.5rem);
  }

  body.pos-terminal .pos-header .search-input {
    min-height: 38px !important;
    height: 38px !important;
  }

  body.pos-terminal .pos-layout {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body.pos-terminal .cart-section {
    width: 100% !important;
    max-height: min(82dvh, 720px) !important;
  }
}

/* Mobile + tablet: navbar scrolls away; category tabs stick with visible scrollbar */
@media (width <= 1024px) {
  html.pos-terminal-page {
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body.pos-terminal {
    height: auto !important;
    max-height: none !important;
    min-height: 100% !important;
    overflow: visible !important;
  }

  body.pos-terminal .pos-header,
  body.pos-terminal header.pos-header {
    position: static !important;
    top: auto !important;
    flex-shrink: 0;
  }

  body.pos-terminal .pos-layout {
    overflow: visible !important;
    height: auto !important;
    flex: none !important;
    min-height: 0 !important;
  }

  body.pos-terminal .catalog-section {
    overflow: visible !important;
    height: auto !important;
    flex: none !important;
    min-height: 55vh;
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }

  body.pos-terminal .product-grid {
    overflow: visible !important;
    flex: none !important;
    height: auto !important;
    max-height: none !important;
  }

  body.pos-terminal .category-tabs-sticky {
    position: sticky !important;
    top: 0 !important;
    z-index: 45 !important;
    background: var(--bg-color) !important;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.07);
  }

  body.pos-terminal .category-tabs-sticky::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 12px;
    width: 28px;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(240, 242, 248, 0), rgba(240, 242, 248, 0.95));
    z-index: 2;
  }

  body.pos-terminal .category-tabs {
    position: relative !important;
    top: auto !important;
    flex-wrap: nowrap !important;
    overflow-x: scroll !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: auto !important;
    scrollbar-color: #475569 #dbe3ee !important;
    background: transparent !important;
    padding: 0.55rem 0.85rem 0.35rem !important;
    gap: 0.45rem !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
  }

  /* Visible horizontal scrollbar cue (WebKit) */
  body.pos-terminal .category-tabs::-webkit-scrollbar {
    display: block !important;
    height: 12px !important;
    background: #dbe3ee !important;
  }

  body.pos-terminal .category-tabs::-webkit-scrollbar-track {
    background: #dbe3ee !important;
    border-radius: 99px;
    margin: 0 0.35rem 0.15rem;
  }

  body.pos-terminal .category-tabs::-webkit-scrollbar-thumb {
    background: #475569 !important;
    border-radius: 99px;
    border: 2px solid #dbe3ee;
    min-width: 48px;
  }

  body.pos-terminal .category-tabs::-webkit-scrollbar-thumb:hover {
    background: #334155 !important;
  }

  body.pos-terminal .cat-tab {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }
}

.pos-status-banner {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.55rem 2.25rem 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

/* Author `display: flex` otherwise overrides UA [hidden] and leaves a top gap before the navbar */
.pos-status-banner[hidden] {
  display: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  min-height: 0 !important;
}

.pos-status-banner-text { flex: 1 1 auto; }
.pos-status-banner-action {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  white-space: nowrap;
}
.pos-status-banner-dismiss {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  opacity: 0.75;
}
.pos-status-banner-dismiss:hover { opacity: 1; }

.pos-status-warning { background: #fef3c7; color: #92400e; }
.pos-status-error { background: #fee2e2; color: #991b1b; }
.pos-status-info { background: #e0f2fe; color: #075985; }

.pos-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: #0f172a;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  z-index: 100120;
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  max-width: 90vw;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.35);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.pos-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.pos-toast-warning { background: #b45309; }
.pos-toast-info { background: #0f766e; }
.pos-toast-success { background: #047857; }

.product-card.out-of-stock { opacity: 0.55; cursor: not-allowed; }
.stock-tag.out { background: #fee2e2; color: #b91c1c; }

.cart-btn.btn-done {
  background: linear-gradient(135deg, var(--primary-color), #4f46e5);
  color: #fff;
}

.cart-btn.btn-pay.disabled,
.cart-btn.btn-pay:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.orders-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(360px, 92vw);
  height: 100vh;
  background: #fff;
  border-left: 1px solid var(--border-color);
  box-shadow: -8px 0 30px rgb(0 0 0 / 8%);
  z-index: 300;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.orders-panel.open { transform: translateX(0); }

.orders-panel:not(.open) {
  pointer-events: none;
}

.orders-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.orders-panel-body { padding: 1rem; overflow-y: auto; flex: 1; }

.orders-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.orders-total { font-weight: 700; color: #0f172a; }
.orders-empty { color: #64748b; font-size: 0.9rem; }

.customer-options { display: grid; gap: 0.5rem; max-height: 320px; overflow-y: auto; }

.customer-pick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 0.15rem;
}

.customer-pick small { font-size: 0.75rem; opacity: 0.75; font-weight: 400; }

.settings-form { display: grid; gap: 0.5rem; }
.settings-form label { font-size: 0.8rem; font-weight: 600; color: #475569; margin-top: 0.35rem; }

/* POS Settings / products admin: force readable text on light modal fields.
   These inputs reuse .search-input (header-oriented); keep dark text even if
   global/header or autofill rules try to paint white-on-white. */
#settingsModal .settings-form .search-input,
#settingsModal input.search-input,
#settingsModal select.search-input,
#productsModal .settings-form .search-input,
#customerModal .search-input,
#paymentModal .search-input,
#ordersPanel .search-input {
  color: #0f172a !important;
  caret-color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  opacity: 1 !important;
}

#settingsModal .settings-form .search-input::-moz-placeholder,
#settingsModal input.search-input::-moz-placeholder,
#productsModal .settings-form .search-input::-moz-placeholder,
#customerModal .search-input::-moz-placeholder,
#paymentModal .search-input::-moz-placeholder,
#ordersPanel .search-input::-moz-placeholder {
  color: #64748b !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #64748b !important;
}

#settingsModal .settings-form .search-input::placeholder,
#settingsModal input.search-input::placeholder,
#productsModal .settings-form .search-input::placeholder,
#customerModal .search-input::placeholder,
#paymentModal .search-input::placeholder,
#ordersPanel .search-input::placeholder {
  color: #64748b !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #64748b !important;
}

#settingsModal .settings-form .search-input:focus,
#settingsModal input.search-input:focus,
#productsModal .settings-form .search-input:focus,
#customerModal .search-input:focus,
#paymentModal .search-input:focus,
#ordersPanel .search-input:focus {
  background-color: #ffffff !important;
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgb(99, 102, 241, 0.2);
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}

#settingsModal .settings-form .search-input:-webkit-autofill,
#settingsModal .settings-form .search-input:-webkit-autofill:hover,
#settingsModal .settings-form .search-input:-webkit-autofill:focus,
#settingsModal input.search-input:-webkit-autofill,
#productsModal .settings-form .search-input:-webkit-autofill,
#customerModal .search-input:-webkit-autofill,
#paymentModal .search-input:-webkit-autofill {
  -webkit-text-fill-color: #0f172a !important;
  caret-color: #0f172a !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
  transition: background-color 99999s ease-in-out 0s;
}

.orders-panel-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0 1rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.orders-tab {
  flex: 1;
  border: none;
  background: #f1f5f9;
  color: #475569;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

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

.orders-date-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}

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

.report-summary { display: grid; gap: 0.65rem; }
.report-kpi {
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 0.9rem;
}

.report-kpi strong { color: #0f172a; }

.held-row { align-items: center; }

/* Discount row */
.summary-row-discount {
  align-items: center;
}

.discount-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.discount-input {
  width: 3.2rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.85rem;
  text-align: center;
}

.discount-pct {
  font-size: 0.8rem;
  color: var(--text-light);
}

.discount-amount {
  min-width: 4.5rem;
  text-align: right;
  font-weight: 600;
  color: var(--danger-color);
}

/* Payment tender / split */
.payment-tender-row {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.payment-tender-row label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}

.payment-field {
  width: 100%;
}

.change-due {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--success-color);
}

.payment-split-section {
  margin: 1rem 0 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-color);
}

.split-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.5rem;
}

.split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.split-select,
.split-amount {
  font-size: 0.85rem;
}

/* Receipt buttons */
.receipt-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.receipt-btn {
  font-size: 0.8rem;
  padding: 0.65rem 0.5rem;
}

/* Products modal */
.products-admin-list {
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.products-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.products-admin-table th,
.products-admin-table td {
  padding: 0.45rem 0.35rem;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
}

.products-admin-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #64748b;
}

.products-admin-table small {
  color: #94a3b8;
  font-size: 0.7rem;
}

.products-edit-btn {
  border: 1px solid var(--border-color);
  background: #f8fafc;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.products-edit-btn:hover {
  background: #e0e7ff;
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.products-admin-form {
  margin-bottom: 1rem;
}

.product-image-upload {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  background: #f8fafc;
}

.product-image-preview {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e0e7ff 0%, #f8fafc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  color: #6366f1;
  font-size: 1.6rem;
}

.product-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image-upload-fields {
  flex: 1;
  min-width: 0;
}

.product-image-upload-fields label {
  display: block;
  margin-bottom: 0.35rem;
}

.optional-tag {
  font-weight: 500;
  color: #64748b;
  font-size: 0.8em;
}

.product-image-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
}

#productFormImage {
  display: block;
  width: 100%;
  font-size: 0.85rem;
}

.product-form-status {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.product-form-status.is-success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.product-form-status.is-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.product-form-status.is-info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

#productsModal .modal-container {
  max-height: min(92vh, 900px);
  overflow-y: auto;
}

.product-image.has-photo {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.product-image.has-photo .product-icon {
  display: none;
}

.product-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 0;
}

.product-image.has-photo .product-price-badge {
  z-index: 2;
}

.product-description-input {
  resize: vertical;
  min-height: 4.5rem;
  font-family: inherit;
}

.product-detail-modal {
  max-width: 560px;
  width: min(92vw, 560px);
  max-height: min(92vh, 900px);
  overflow-y: auto;
  padding: 0;
  position: relative;
}

.product-detail-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  z-index: 3;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.product-detail-media {
  width: 100%;
  min-height: 260px;
  max-height: 360px;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-detail-photo {
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: contain;
  display: block;
  background: #0f172a;
}

.product-detail-placeholder {
  font-size: 5rem;
  opacity: 0.9;
  padding: 3rem;
}

.product-detail-body {
  padding: 1.25rem 1.4rem 1.5rem;
}

.product-detail-category {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.product-detail-title {
  margin: 0 0 0.5rem;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-dark, #0f172a);
}

.product-detail-price {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-color, #4f46e5);
}

.product-detail-stock {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #047857;
}

.product-detail-stock.is-low { color: #b45309; }
.product-detail-stock.is-out { color: #b91c1c; }

.product-detail-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 1rem;
  margin: 0 0 1rem;
  padding: 0.85rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.product-detail-meta dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin: 0;
}

.product-detail-meta dd {
  margin: 0.15rem 0 0;
  font-weight: 700;
  color: #0f172a;
  font-size: 0.9rem;
}

.product-detail-description-wrap h3 {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.product-detail-description {
  margin: 0 0 1.25rem;
  color: #334155;
  line-height: 1.55;
  white-space: pre-wrap;
}

.product-detail-description.is-empty {
  color: #94a3b8;
  font-style: italic;
}

.product-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.product-detail-edit,
.product-detail-add {
  width: 100%;
}

.product-detail-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

/* Header Products button */
.pos-header-text-btn {
  width: auto;
  min-width: 40px;
  padding: 0 0.75rem;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
}

@media (width <= 1024px) {
  body.pos-terminal .pos-header .pos-header-text-btn {
    width: 36px !important;
    min-width: 36px !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  body.pos-terminal .pos-header .pos-header-text-btn-label {
    display: none !important;
  }

  body.pos-terminal .pos-header .pos-header-text-btn i {
    font-size: 0.95rem !important;
    margin: 0 !important;
  }
}

/* Refund button in order rows */
.orders-row-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.refund-btn {
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #be123c;
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.refund-btn:hover {
  background: #ffe4e6;
}

.orders-row-refunded {
  opacity: 0.65;
}

/* ── Desktop Modules drawer (matches ERP shell sidebar) ─────────────── */
.pos-modules-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.45);
  z-index: 100040;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.pos-modules-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.pos-modules-sidebar {
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  max-width: 86vw;
  height: 100vh;
  z-index: 100050;
  background: #0b1224;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
  transition: left 0.28s ease, box-shadow 0.28s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pos-modules-sidebar.is-open {
  left: 0;
  box-shadow: 8px 0 32px rgba(2, 6, 23, 0.45);
}

.pos-modules-nav {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 1rem 0.55rem 1rem;
}

.pos-modules-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 0.35rem 0.55rem 0.85rem;
  flex-shrink: 0;
}

.pos-modules-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.05rem;
  color: #fff;
  background: linear-gradient(135deg, #38bdf8, #6366f1 40%, #f472b6 75%, #f59e0b);
}

.pos-modules-brand-text {
  font-weight: 900;
  font-size: 1.15rem;
  background: linear-gradient(90deg, #38bdf8, #6366f1, #f472b6, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pos-modules-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.35rem 0.75rem 0.85rem;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.pos-modules-list {
  list-style: none;
  margin: 0;
  padding: 0 0.2rem 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1 1 auto;
  min-height: 0;
}

.pos-modules-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.7rem 0.7rem;
  margin-bottom: 4px;
  border-radius: 12px;
  text-decoration: none;
  color: #e2e8f0;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pos-modules-link:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.06);
}

.pos-modules-link > i {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
  background: rgba(99, 102, 241, 0.16);
  color: #a5b4fc;
}

.pos-modules-link[data-tone="orange"] > i { background: rgba(249, 115, 22, 0.16); color: #fb923c; }
.pos-modules-link[data-tone="pink"] > i { background: rgba(236, 72, 153, 0.16); color: #f472b6; }
.pos-modules-link[data-tone="green"] > i { background: rgba(34, 197, 94, 0.16); color: #4ade80; }
.pos-modules-link[data-tone="cyan"] > i { background: rgba(6, 182, 212, 0.16); color: #22d3ee; }
.pos-modules-link[data-tone="teal"] > i { background: rgba(20, 184, 166, 0.16); color: #2dd4bf; }
.pos-modules-link[data-tone="rose"] > i { background: rgba(244, 63, 94, 0.16); color: #fb7185; }
.pos-modules-link[data-tone="violet"] > i { background: rgba(139, 92, 246, 0.18); color: #a78bfa; }
.pos-modules-link[data-tone="blue"] > i { background: rgba(59, 130, 246, 0.16); color: #60a5fa; }
.pos-modules-link[data-tone="emerald"] > i { background: rgba(16, 185, 129, 0.16); color: #34d399; }
.pos-modules-link[data-tone="amber"] > i { background: rgba(245, 158, 11, 0.16); color: #fbbf24; }

.pos-modules-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.pos-modules-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.2;
}

.pos-modules-sub {
  font-size: 0.72rem;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.25;
}

.pos-modules-badge {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #052e16;
  background: #4ade80;
}

/* Full shell Modules list inside POS drawer */
.pos-modules-nav-host {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 0.15rem 1rem;
}

.pos-modules-loading {
  color: #94a3b8;
  font-size: 0.85rem;
  padding: 1rem 0.75rem;
}

.pos-modules-loading a {
  color: #93c5fd;
}

.pos-modules-sidebar .sidebar-nav ul[aria-label="Modules"] {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pos-modules-sidebar .sidebar-nav .nav-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 0.72rem 0.7rem;
  margin-bottom: 2px;
  border-radius: 12px;
  text-decoration: none;
  color: #e2e8f0;
  border: 1px solid transparent;
  position: relative;
}

.pos-modules-sidebar .sidebar-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.06);
}

/* Match erp_home / site.css module icon badges (full-colour gradients). */
.pos-modules-sidebar [aria-label="Modules"] .nav-link i {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #fff !important;
  font-size: 18px;
  margin-right: 10px;
  margin-top: 0;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgb(2, 6, 23, 0.2), inset 0 -3px 8px rgb(255, 255, 255, 0.06);
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
}

.pos-modules-sidebar [aria-label="Modules"] .nav-link:hover i {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 26px rgb(2, 6, 23, 0.3);
}

.pos-modules-sidebar [aria-label="Modules"] a[href*="#accounting"] i { background: linear-gradient(135deg, #fb923c, #f59e0b) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#acquisition"] i { background: linear-gradient(135deg, #f97316, #ea580c) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#crm"] i { background: linear-gradient(135deg, #8b5cf6, #f472b6) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#agropro"] i { background: linear-gradient(135deg, #16a34a, #059669) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#carepro"] i { background: linear-gradient(135deg, #14b8a6, #0f766e) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#design-studio"] i { background: linear-gradient(135deg, #ec4899, #f59e0b) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#school"] i { background: linear-gradient(135deg, #f472b6, #db2777) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#analytics"] i { background: linear-gradient(135deg, #2563eb, #06b6d4) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#vehicle-tracker"] i { background: linear-gradient(135deg, #4f46e5, #0891b2) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#foodpro"] i { background: linear-gradient(135deg, #0ea5e9, #0284c7) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#healthcare"] i { background: linear-gradient(135deg, #ef4444, #b91c1c) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#hotel"] i { background: linear-gradient(135deg, #f97316, #c2410c) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#inventory"] i { background: linear-gradient(135deg, #10b981, #059669) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#logistics"] i { background: linear-gradient(135deg, #0891b2, #2563eb) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#marketing"] i { background: linear-gradient(135deg, #be185d, #f97316) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#payroll"] i { background: linear-gradient(135deg, #6366f1, #22d3ee) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#pos"] i,
.pos-modules-sidebar [aria-label="Modules"] a[href*="pos.html"] i,
.pos-modules-sidebar [aria-label="Modules"] a#posBtn i { background: linear-gradient(135deg, #84cc16, #3f6212) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#procurement"] i { background: linear-gradient(135deg, #0d9488, #14b8a6) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#propertypro"] i { background: linear-gradient(135deg, #4f46e5, #7c3aed) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#ngo"] i { background: linear-gradient(135deg, #7c3aed, #c084fc) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#prints"] i { background: linear-gradient(135deg, #f97316, #ec4899) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#roaster"] i { background: linear-gradient(135deg, #6366f1, #db2777) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#time-tracker"] i { background: linear-gradient(135deg, #0891b2, #22d3ee) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#ppm"] i { background: linear-gradient(135deg, #0ea5e9, #6366f1) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#operations-hub"] i { background: linear-gradient(135deg, #f59e0b, #ef4444) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#mms"] i { background: linear-gradient(135deg, #15803d, #ca8a04) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#website-builder"] i { background: linear-gradient(135deg, #c026d3, #6366f1) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#elinom-verify"] i { background: linear-gradient(135deg, #047857, #0f172a) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#hr"] i { background: linear-gradient(135deg, #06b6d4, #3b82f6) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#company-settings"] i { background: linear-gradient(135deg, #64748b, #334155) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#treasury"] i { background: linear-gradient(135deg, #0e7c61, #10b981) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#wallet"] i { background: linear-gradient(135deg, #0a7a6a, #34d399) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#marketplace"] i,
.pos-modules-sidebar [aria-label="Modules"] a[href*="elinommarketplace"] i,
.pos-modules-sidebar [aria-label="Modules"] a#marketplaceBtn i { background: linear-gradient(135deg, #22c55e, #16a34a) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#homecare"] i,
.pos-modules-sidebar [aria-label="Modules"] a[href*="#homesafe"] i { background: linear-gradient(135deg, #ea580c, #fbbf24) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="#church"] i { background: linear-gradient(135deg, #7c3aed, #c084fc) !important; }
.pos-modules-sidebar [aria-label="Modules"] a[href*="jobs.html"] i,
.pos-modules-sidebar [aria-label="Modules"] a#jobsPortalBtn i { background: linear-gradient(135deg, #2563eb, #7c3aed) !important; }

.pos-modules-sidebar .sidebar-nav .nav-link.has-submenu::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.65rem;
  opacity: 0.45;
  margin-left: auto;
  align-self: center;
  transition: transform 0.2s ease;
}

.pos-modules-sidebar .sidebar-nav .nav-link.has-submenu.open::after {
  transform: rotate(180deg);
}

.pos-modules-sidebar .lp-is-6b4bbac3 {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pos-modules-sidebar .lp-is-6b4bbac3 > span:first-child {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.2;
}

.pos-modules-sidebar .lp-is-6e6ba455,
.pos-modules-sidebar .lp-is-8ec076c9 {
  font-size: 0.65rem;
  opacity: 0.55;
  font-weight: 400;
  margin-top: 2px;
  color: #cbd5e1;
}

.pos-modules-sidebar .lp-is-3e0c4824,
.pos-modules-sidebar .lp-is-a8b06de2,
.pos-modules-sidebar .lp-is-74fc2d12,
.pos-modules-sidebar .lp-is-ca9e5228,
.pos-modules-sidebar .lp-is-6d1dc2be,
.pos-modules-sidebar .lp-is-0080ca31,
.pos-modules-sidebar .lp-is-9d827639,
.pos-modules-sidebar .lp-is-f22ca19f {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #10b981;
  color: #052e16;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  opacity: 1;
}

.pos-modules-sidebar .sidebar-nav .submenu {
  display: none;
  list-style: none;
  padding: 0.15rem 0 0.55rem 0.35rem;
  margin: 0 0 0.35rem 1.15rem;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
}

.pos-modules-sidebar .sidebar-nav .submenu.open,
.pos-modules-sidebar .sidebar-nav .submenu.pin-visible,
.pos-modules-sidebar .sidebar-nav li.open > .submenu {
  display: block;
  max-height: 4000px;
  opacity: 1;
}

.pos-modules-sidebar .sidebar-nav .submenu-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.4rem 0.55rem;
  margin: 1px 0.35rem;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  text-decoration: none;
}

.pos-modules-sidebar .sidebar-nav .submenu-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.pos-modules-sidebar .sidebar-nav .submenu-link::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--acct-dot, #64748b);
  flex-shrink: 0;
}

.pos-modules-sidebar .lp-is-0ee65c6a,
.pos-modules-sidebar .lp-is-303486a4,
.pos-modules-sidebar .lp-is-6f8ba1e7,
.pos-modules-sidebar .lp-is-6c67edbe,
.pos-modules-sidebar .lp-is-a152b4fe,
.pos-modules-sidebar .lp-is-f9401af6,
.pos-modules-sidebar .lp-is-2fcc0d07,
.pos-modules-sidebar .lp-is-bcef3c82,
.pos-modules-sidebar .lp-is-186619ef,
.pos-modules-sidebar .lp-is-bfc66ea5,
.pos-modules-sidebar .lp-is-c898fb53,
.pos-modules-sidebar .lp-is-6b680860,
.pos-modules-sidebar .lp-is-58a9c600,
.pos-modules-sidebar .lp-is-35884e2c,
.pos-modules-sidebar .lp-is-bfb9964a,
.pos-modules-sidebar .lp-is-06f4fcac,
.pos-modules-sidebar .lp-is-68999be3,
.pos-modules-sidebar .lp-is-7a6a689a,
.pos-modules-sidebar .lp-is-wallet-nav,
.pos-modules-sidebar .lp-is-055f1805 {
  padding: 0.45rem 0.75rem 0.2rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  pointer-events: none;
}
