.pos-sales-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(46, 90, 172, 0.08), transparent 36%),
    linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
  color: #0f172a;
  font-family: 'Public Sans', sans-serif;
}

.pos-sales-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.pos-sales-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pos-sales-back-link {
  text-decoration: none;
  color: #2e5aac;
  font-weight: 700;
  font-size: 0.9rem;
}

.pos-sales-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 2px;
}

.pos-sales-header h1 {
  font-size: 1.45rem;
  line-height: 1.1;
}

.pos-sales-header-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.pos-sales-stat {
  min-width: 110px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.pos-sales-stat span {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
  margin-bottom: 4px;
}

.pos-sales-stat strong {
  font-size: 0.98rem;
}

.pos-sales-header-actions {
  display: flex;
  gap: 10px;
}

.pos-sales-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.85fr);
  gap: 20px;
  padding: 20px 24px 28px;
  align-items: start;
}

.pos-sales-catalog,
.pos-sales-checkout {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.pos-sales-catalog {
  padding: 18px;
  min-height: calc(100vh - 120px);
}

.pos-sales-checkout {
  padding: 18px;
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 110px);
  overflow: auto;
}

.pos-sales-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.pos-sales-toolbar label,
.pos-sales-checkout-form label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
}

.pos-sales-barcode-input {
  border: 2px solid rgba(46, 90, 172, 0.35);
  background: #f8fbff;
  font-size: 1rem;
  font-weight: 600;
}

.pos-sales-barcode-input:focus {
  border-color: #2e5aac;
  box-shadow: 0 0 0 3px rgba(46, 90, 172, 0.12);
}

.pos-sales-hint {
  margin-top: 6px;
  font-size: 0.72rem;
  color: #64748b;
}

.pos-sales-hint kbd,
.pos-sales-kbd {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.06);
  font-size: 0.72rem;
}

.pos-sales-category-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.pos-sales-category {
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.pos-sales-category.active {
  background: #2e5aac;
  border-color: #2e5aac;
  color: #fff;
}

.pos-sales-results-meta {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 10px;
}

.pos-sales-table-wrap,
.pos-sales-cart-wrap {
  overflow: auto;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 14px;
}

.pos-sales-table,
.pos-sales-cart-table {
  width: 100%;
  border-collapse: collapse;
}

.pos-sales-table th,
.pos-sales-cart-table th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.pos-sales-table td,
.pos-sales-cart-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  vertical-align: middle;
}

.pos-sales-product-name {
  font-weight: 700;
}

.pos-sales-product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.pos-sales-product-thumb,
.pos-sales-cart-thumb {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
}

.pos-sales-cart-thumb {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.pos-sales-product-thumb--empty,
.pos-sales-cart-thumb--empty {
  background: linear-gradient(135deg, #eef4ff 0%, #f8fafc 100%);
}

.pos-sales-product-meta {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 3px;
}

.pos-sales-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
}

.pos-sales-stock-ok { color: #15803d; font-weight: 700; }
.pos-sales-stock-low { color: #c2410c; font-weight: 700; }
.pos-sales-stock-out { color: #b91c1c; font-weight: 700; }

.pos-sales-add-btn {
  white-space: nowrap;
}

.pos-sales-empty {
  text-align: center;
  color: #64748b;
  padding: 24px !important;
}

.pos-sales-checkout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pos-sales-checkout-head h2 {
  font-size: 1.1rem;
}

.pos-sales-qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pos-sales-qty-controls button {
  width: 28px;
  height: 28px;
  padding: 0;
}

.pos-sales-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pos-sales-field-label,
.pos-sales-payment-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
}

.pos-sales-payment-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pos-sales-payment-btn {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: #334155;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pos-sales-payment-btn.active {
  background: #2e5aac;
  border-color: #2e5aac;
  color: #fff;
}

.pos-sales-cash-panel {
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
  border: 1px solid rgba(46, 90, 172, 0.16);
}

.pos-sales-airtel-panel,
.pos-sales-bank-panel {
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff7ed 0%, #fffbeb 100%);
  border: 1px solid rgba(234, 88, 12, 0.16);
}

.pos-sales-bank-panel {
  background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
  border-color: rgba(22, 163, 74, 0.16);
}

.pos-sales-airtel-panel label,
.pos-sales-bank-panel label,
.pos-sales-cash-panel label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
}

.pos-sales-tendered-input {
  font-size: 1.35rem;
  font-weight: 800;
  text-align: right;
  border: 2px solid rgba(46, 90, 172, 0.35);
  background: #fff;
}

.pos-sales-tendered-input:focus {
  border-color: #2e5aac;
  box-shadow: 0 0 0 3px rgba(46, 90, 172, 0.12);
}

.pos-sales-quick-tender {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pos-sales-quick-btn {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.pos-sales-quick-btn:hover {
  border-color: rgba(46, 90, 172, 0.35);
  color: #2e5aac;
}

.pos-sales-change-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px dashed rgba(15, 23, 42, 0.12);
  font-size: 1.08rem !important;
}

.pos-sales-change-line strong {
  color: #64748b;
}

.pos-sales-change-line.is-ready strong {
  color: #15803d;
}

.pos-sales-change-line.is-short strong {
  color: #b91c1c;
}

.pos-sales-shortfall {
  margin: -4px 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #b91c1c;
}

.pos-sales-payment-status {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.84rem;
  font-weight: 600;
}

.pos-sales-payment-status.is-error {
  background: #fee2e2;
  color: #991b1b;
}

.pos-sales-payment-status.is-success {
  background: #ecfdf5;
  color: #047857;
}

.pos-sales-open-bank-btn {
  width: 100%;
  margin-top: 10px;
}

.pos-sales-complete-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.pos-sales-receipt-overlay[hidden] {
  display: none !important;
}

.pos-sales-receipt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: grid;
  place-items: center;
  z-index: 110;
  padding: 20px;
}

.pos-sales-receipt-modal {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 22px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}

.pos-sales-receipt-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.pos-sales-receipt-modal h3 {
  font-size: 1.35rem;
  margin-bottom: 4px;
}

.pos-sales-receipt-no {
  color: #64748b;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.pos-sales-receipt-summary {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: #f8fafc;
  margin-bottom: 12px;
  text-align: left;
}

.pos-sales-receipt-summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
}

.pos-sales-receipt-summary strong {
  color: #0f172a;
  font-weight: 800;
}

.pos-sales-receipt-summary .pos-sales-receipt-change-row strong {
  color: #15803d;
  font-size: 1.35rem;
}

.pos-sales-receipt-change-row {
  padding-top: 10px;
  border-top: 1px dashed rgba(15, 23, 42, 0.12);
  font-size: 1.15rem !important;
}

.pos-sales-receipt-method {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 16px;
}

.pos-sales-receipt-done {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
}

.pos-sales-totals {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  background: #f8fafc;
  margin: 14px 0;
}

.pos-sales-totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}

.pos-sales-total-line {
  padding-top: 8px;
  border-top: 1px dashed rgba(15, 23, 42, 0.12);
  font-size: 1.05rem !important;
}

.pos-sales-complete-btn {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pos-sales-recent {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.pos-sales-recent-head h3 {
  font-size: 0.92rem;
  margin-bottom: 10px;
}

.pos-sales-recent-list {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
}

.pos-sales-recent-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 0.82rem;
}

.pos-sales-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  padding: 12px 16px;
  border-radius: 12px;
  background: #ecfdf5;
  color: #065f46;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
  max-width: 360px;
}

.pos-sales-toast.error {
  background: #fee2e2;
  color: #991b1b;
}

.pos-sales-mobile-tabs,
.pos-sales-mobile-bar {
  display: none;
}

.pos-sales-desktop-only {
  display: inline-block;
}

@media (max-width: 1100px) {
  .pos-sales-layout {
    grid-template-columns: 1fr;
  }

  .pos-sales-checkout {
    position: static;
    max-height: none;
  }

  .pos-sales-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  /* Admin dashboard mobile header glass pill — not used on POS terminal */
  .pos-sales-body::before {
    display: none !important;
    content: none !important;
  }

  .pos-sales-body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }

  .pos-sales-body .form-control {
    font-size: 16px;
  }

  .pos-sales-body.has-mobile-bar {
    padding-bottom: calc(148px + env(safe-area-inset-bottom, 0px));
  }

  .pos-sales-header {
    padding: 14px 16px;
    gap: 12px;
    align-items: flex-start;
  }

  .pos-sales-header-left {
    width: 100%;
    gap: 12px;
  }

  .pos-sales-header h1 {
    font-size: 1.2rem;
  }

  .pos-sales-header-stats {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .pos-sales-stat {
    min-width: 0;
    padding: 8px 10px;
  }

  .pos-sales-stat strong {
    font-size: 0.86rem;
    word-break: break-word;
  }

  .pos-sales-header-actions {
    width: 100%;
  }

  .pos-sales-header-actions .btn-secondary {
    width: 100%;
    min-height: 44px;
  }

  .pos-sales-layout {
    padding: 12px 12px 16px;
    gap: 12px;
  }

  .pos-sales-layout.show-catalog .pos-sales-checkout,
  .pos-sales-layout.show-checkout .pos-sales-catalog {
    display: none;
  }

  .pos-sales-catalog,
  .pos-sales-checkout {
    min-height: auto;
    padding: 14px;
    border-radius: 16px;
  }

  .pos-sales-category-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .pos-sales-category {
    flex: 0 0 auto;
    min-height: 40px;
  }

  .pos-sales-table-wrap,
  .pos-sales-cart-wrap {
    overflow: visible;
    border: none;
    background: transparent;
  }

  .pos-sales-table thead,
  .pos-sales-cart-table thead {
    display: none;
  }

  .pos-sales-table tbody,
  .pos-sales-cart-table tbody {
    display: grid;
    gap: 10px;
  }

  .pos-sales-table tr,
  .pos-sales-cart-table tr {
    display: block;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
    overflow: hidden;
  }

  .pos-sales-table td,
  .pos-sales-cart-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  }

  .pos-sales-table td:last-child,
  .pos-sales-cart-table td:last-child {
    border-bottom: none;
  }

  .pos-sales-table td::before,
  .pos-sales-cart-table td::before {
    content: attr(data-label);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    flex-shrink: 0;
  }

  .pos-sales-table td[data-label='Product'],
  .pos-sales-cart-table td[data-label='Item'] {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: #f8fafc;
  }

  .pos-sales-table td[data-label='Product'] .pos-sales-product-cell,
  .pos-sales-cart-table td[data-label='Item'] .pos-sales-product-cell {
    width: 100%;
  }

  .pos-sales-table td[data-label='Product']::before,
  .pos-sales-cart-table td[data-label='Item']::before {
    display: none;
  }

  .pos-sales-table td[data-label='Add'],
  .pos-sales-cart-table td[data-label='Remove'] {
    padding-top: 0;
  }

  .pos-sales-table td[data-label='Add']::before,
  .pos-sales-cart-table td[data-label='Remove']::before {
    display: none;
  }

  .pos-sales-add-btn,
  .pos-sales-remove-btn {
    width: 100%;
    min-height: 44px;
  }

  .pos-sales-qty-controls button {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .pos-sales-payment-methods {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .pos-sales-payment-btn {
    min-height: 48px;
    font-size: 0.8rem;
    padding: 10px 8px;
  }

  .pos-sales-quick-tender {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .pos-sales-quick-btn {
    min-height: 42px;
    padding: 10px 8px;
    text-align: center;
  }

  .pos-sales-tendered-input {
    font-size: 1.5rem;
    min-height: 52px;
  }

  .pos-sales-complete-btn {
    position: sticky;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    min-height: 52px;
    font-size: 1.05rem;
    z-index: 5;
  }

  .pos-sales-checkout {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .pos-sales-hint .pos-sales-desktop-only,
  .pos-sales-desktop-only {
    display: none;
  }

  .pos-sales-table tr.pos-sales-card-empty td,
  .pos-sales-cart-table tr.pos-sales-card-empty td {
    display: block;
    border-bottom: none;
  }

  .pos-sales-table tr.pos-sales-card-empty td::before,
  .pos-sales-cart-table tr.pos-sales-card-empty td::before {
    display: none;
  }

  .pos-sales-mobile-tabs[hidden] {
    display: none !important;
  }

  .pos-sales-mobile-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 90;
    padding: 8px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(10px);
  }

  .pos-sales-mobile-tab {
    border: none;
    background: transparent;
    color: #475569;
    border-radius: 12px;
    min-height: 48px;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .pos-sales-mobile-tab.active {
    background: #2e5aac;
    color: #fff;
  }

  .pos-sales-mobile-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    font-size: 0.72rem;
    font-weight: 800;
  }

  .pos-sales-mobile-tab.active .pos-sales-mobile-tab-badge {
    background: rgba(255, 255, 255, 0.24);
  }

  .pos-sales-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    z-index: 89;
    padding: 12px 14px;
    border-radius: 16px;
    background: #0f172a;
    color: #fff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.24);
  }

  .pos-sales-mobile-bar[hidden] {
    display: none !important;
  }

  .pos-sales-mobile-bar-total span {
    display: block;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 2px;
  }

  .pos-sales-mobile-bar-total strong {
    font-size: 1.05rem;
  }

  .pos-sales-mobile-bar .btn-primary {
    flex-shrink: 0;
    min-height: 44px;
    padding: 10px 16px;
    white-space: nowrap;
  }

  .pos-sales-toast {
    left: 12px;
    right: 12px;
    bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    max-width: none;
  }

  .pos-sales-body.has-mobile-bar .pos-sales-toast {
    bottom: calc(164px + env(safe-area-inset-bottom, 0px));
  }

  .pos-sales-receipt-overlay {
    padding: 12px;
    align-items: end;
  }

  .pos-sales-receipt-modal {
    width: 100%;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 420px) {
  .pos-sales-header-stats {
    grid-template-columns: 1fr;
  }

  .pos-sales-quick-tender {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos-sales-payment-btn {
    font-size: 0.74rem;
  }
}
