:root {
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  color: #0f172a;
  background: #f1f5f9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f1f5f9;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app {
  width: 100%;
  max-width: 760px;
  min-height: 100vh;
  margin: auto;
  background: #ffffff;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding:
    calc(18px + env(safe-area-inset-top))
    18px
    18px;

  background: #0f172a;
  color: white;
}

.brand {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -.4px;
}

.tagline {
  margin-top: 2px;
  font-size: 12px;
  color: #cbd5e1;
}

.status {
  display: flex;
  align-items: center;
  gap: 6px;

  font-size: 11px;
  color: #cbd5e1;
}

.status-dot {
  width: 8px;
  height: 8px;

  border-radius: 50%;
  background: #22c55e;
}

main {
  padding: 16px;
}

.summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;

  margin-bottom: 22px;
}

.summary > div {
  padding: 14px;

  border: 1px solid #e2e8f0;
  border-radius: 14px;

  background: #f8fafc;
}

.summary span {
  display: block;
  margin-bottom: 5px;

  font-size: 11px;
  color: #64748b;
}

.summary strong {
  font-size: 18px;
}

.section-title {
  margin-bottom: 10px;

  font-size: 14px;
  font-weight: 800;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.product {
  min-height: 88px;
  padding: 12px;

  text-align: left;

  border: 1px solid #e2e8f0;
  border-radius: 14px;

  background: #fff;

  cursor: pointer;
}

.product:active {
  transform: scale(.97);
  background: #f8fafc;
}

.product-name {
  display: block;

  font-size: 15px;
  font-weight: 750;
}

.product-price {
  display: block;

  margin-top: 8px;

  color: #0f766e;

  font-size: 14px;
  font-weight: 800;
}

.cart {
  margin-top: 22px;
  padding-top: 18px;

  border-top: 1px solid #e2e8f0;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-bottom: 10px;
}

.text-button {
  padding: 8px;

  border: 0;
  background: transparent;

  color: #dc2626;
  font-size: 12px;

  cursor: pointer;
}

.cart-items {
  min-height: 50px;
}

.empty-cart {
  padding: 18px 0;

  text-align: center;

  color: #94a3b8;
  font-size: 13px;
}

.cart-item {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 12px;
  align-items: center;

  padding: 11px 0;

  border-bottom: 1px solid #f1f5f9;
}

.cart-item-name {
  font-size: 14px;
  font-weight: 700;
}

.cart-item-price {
  margin-top: 3px;

  color: #64748b;
  font-size: 12px;
}

.cart-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.cart-item-total {
  font-size: 14px;
  font-weight: 800;
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 4px;

  padding: 3px;

  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.qty-button {
  width: 34px;
  height: 34px;

  padding: 0;

  border: 0;
  border-radius: 8px;

  background: #f1f5f9;

  color: #0f172a;

  font-size: 20px;
  font-weight: 800;

  cursor: pointer;
}

.qty-button:active {
  background: #e2e8f0;
}

.qty-value {
  min-width: 32px;

  text-align: center;

  font-size: 14px;
  font-weight: 800;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-top: 16px;

  font-size: 18px;
}

.total-row strong {
  font-size: 25px;
}

.pay-button {
  width: 100%;
  min-height: 58px;

  margin-top: 14px;

  border: 0;
  border-radius: 15px;

  background: #0f766e;
  color: white;

  font-size: 17px;
  font-weight: 900;

  cursor: pointer;
}

.pay-button:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

.modal {
  position: fixed;
  z-index: 100;
  inset: 0;

  display: flex;
  align-items: flex-end;
  justify-content: center;

  padding:
    14px
    14px
    calc(14px + env(safe-area-inset-bottom));

  background: rgba(15,23,42,.58);
}

.hidden {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 520px;

  padding: 20px;

  border-radius: 20px;

  background: white;

  box-shadow:
    0 20px 60px rgba(15,23,42,.20);
}

.modal-title {
  font-size: 20px;
  font-weight: 850;
}

.payment-total {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin: 18px 0 20px;

  font-size: 16px;
}

.payment-total strong {
  font-size: 25px;
}

.payment-option {
  width: 100%;
  min-height: 56px;

  margin-bottom: 10px;

  border: 0;
  border-radius: 14px;

  background: #0f766e;
  color: white;

  font-size: 17px;
  font-weight: 850;

  cursor: pointer;
}

.payment-option.secondary {
  background: #0f172a;
}

.cancel-button {
  width: 100%;
  min-height: 48px;

  margin-top: 4px;

  border: 0;
  background: transparent;

  color: #64748b;

  cursor: pointer;
}

.field-label {
  display: block;

  margin-bottom: 7px;

  color: #475569;

  font-size: 13px;
  font-weight: 700;
}

.money-input-wrap {
  display: flex;
  align-items: center;

  min-height: 60px;

  padding: 0 15px;

  border: 2px solid #cbd5e1;
  border-radius: 14px;

  background: #fff;
}

.money-input-wrap:focus-within {
  border-color: #0f766e;
}

.money-input-wrap > span {
  margin-right: 8px;

  color: #64748b;

  font-size: 18px;
  font-weight: 700;
}

.money-input {
  width: 100%;

  border: 0;
  outline: 0;

  background: transparent;

  color: #0f172a;

  font-size: 25px;
  font-weight: 850;
}

.quick-title {
  margin: 16px 0 8px;

  color: #64748b;

  font-size: 12px;
  font-weight: 700;
}

.quick-cash {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 8px;
}

.quick-cash button {
  min-height: 44px;

  padding: 6px;

  border: 1px solid #cbd5e1;
  border-radius: 11px;

  background: #f8fafc;

  color: #0f172a;

  font-size: 13px;
  font-weight: 800;

  cursor: pointer;
}

.change-box {
  margin-top: 18px;
  padding: 15px;

  border-radius: 14px;

  background: #f8fafc;
}

.change-box span {
  display: block;

  color: #64748b;

  font-size: 12px;
}

.change-box strong {
  display: block;

  margin-top: 3px;

  font-size: 26px;
}

.change-box small {
  display: block;

  min-height: 17px;
  margin-top: 4px;

  color: #dc2626;

  font-size: 12px;
}

.success-card {
  text-align: center;
}

.success-icon {
  display: grid;
  place-items: center;

  width: 64px;
  height: 64px;

  margin: 4px auto 14px;

  border-radius: 50%;

  background: #dcfce7;
  color: #15803d;

  font-size: 34px;
  font-weight: 900;
}

.success-title {
  font-size: 21px;
  font-weight: 850;
}

.success-amount {
  margin-top: 9px;

  font-size: 30px;
  font-weight: 900;
}

.success-method {
  margin-top: 3px;

  color: #64748b;

  font-size: 12px;
  font-weight: 800;
}

.success-change {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-top: 18px;
  padding: 14px;

  border-radius: 13px;

  background: #f8fafc;
}

.success-change span {
  color: #64748b;
}

.success-change strong {
  font-size: 20px;
}

@media (min-width: 600px) {

  .product-grid {
    grid-template-columns: repeat(3,1fr);
  }

  .modal {
    align-items: center;
  }

}

/* ==========================================================
   PRODUCT MANAGER V1
   ========================================================== */

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading .section-title {
  margin-bottom: 0;
}

.manage-products-button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.manage-products-button:active {
  transform: scale(0.98);
}

.product-manager-card {
  width: min(520px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.manager-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.manager-subtitle {
  margin-top: 4px;
  color: #64748b;
  font-size: 14px;
}

.icon-close {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 0;
  border-radius: 12px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.add-product-button {
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  border: 0;
  border-radius: 14px;
  background: #0f172a;
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.product-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  overflow-y: auto;
}

.product-list-item {
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
}

.product-list-item.inactive {
  opacity: 0.58;
}

.product-manager-info {
  min-width: 0;
}

.product-manager-name {
  display: block;
  color: #0f172a;
  font-size: 16px;
}

.product-manager-meta {
  margin-top: 5px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.product-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-top: 9px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.product-status.active {
  background: #dcfce7;
  color: #166534;
}

.product-status.inactive {
  background: #f1f5f9;
  color: #64748b;
}

.product-manager-empty {
  padding: 28px 16px;
  text-align: center;
  color: #64748b;
}

@media (max-width: 480px) {

  .product-manager-card {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .manage-products-button {
    min-height: 38px;
    padding: 0 14px;
  }
}

/* ==========================================================
   PRODUCT MANAGER STEP 3 - ADD PRODUCT
   ========================================================== */

.product-form-card {
  width: min(100%, 520px);
}

.product-form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.product-field {
  display: grid;
  gap: 7px;
}

.product-field > span {
  font-size: 14px;
  font-weight: 700;
  color: #475569;
}

.product-field > input,
.product-money-input {
  width: 100%;
  min-height: 54px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #ffffff;
}

.product-field > input {
  padding: 0 16px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  outline: none;
  box-sizing: border-box;
}

.product-field > input:focus,
.product-money-input:focus-within {
  border-color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.10);
}

.product-money-input {
  display: flex;
  align-items: center;
  overflow: hidden;
  box-sizing: border-box;
}

.product-money-input > span {
  padding-left: 16px;
  color: #64748b;
  font-size: 16px;
  font-weight: 800;
}

.product-money-input input {
  flex: 1;
  min-width: 0;
  height: 52px;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0 16px 0 8px;
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}

.product-form-message {
  min-height: 20px;
  font-size: 13px;
  font-weight: 700;
  color: #dc2626;
}

/* ==========================================================
   PRODUCT MANAGER STEP 4 - EDIT PRODUCT
   ========================================================== */

.product-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.product-manager-info {
  flex: 1;
}

.product-edit-button {
  flex: 0 0 auto;
  min-width: 68px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 11px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.product-edit-button:active {
  transform: scale(0.97);
}

.product-active-control {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  cursor: pointer;
}

.product-active-control input {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  accent-color: #0f766e;
}

.product-active-control > span {
  display: grid;
  gap: 2px;
}

.product-active-control strong {
  color: #0f172a;
  font-size: 14px;
}

.product-active-control small {
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

/* ==========================================================
   FINAL BUSINESS FEATURES V1
   ========================================================== */

.business-tools {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #e2e8f0;
}

.low-stock-panel {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 14px;
  font-size: 13px;
}

.low-stock-panel.ok {
  background: #f0fdf4;
  color: #166534;
}

.low-stock-panel.warning {
  background: #fff7ed;
  color: #9a3412;
}

.low-stock-list {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

.low-stock-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.history-card {
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid #e2e8f0;
}

.history-header span {
  color: #64748b;
  font-size: 12px;
}

.transaction-history {
  max-height: 420px;
  overflow-y: auto;
}

.history-empty {
  padding: 28px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

.history-item {
  padding: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.history-item:last-child {
  border-bottom: 0;
}

.history-item-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.history-item-top > div {
  min-width: 0;
}

.history-item-top strong {
  display: block;
  font-size: 13px;
}

.history-item-top small {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
}

.history-total {
  flex: 0 0 auto;
  color: #0f766e;
}

.history-items {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.history-items > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #475569;
  font-size: 12px;
}

.history-metrics {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 480px) {
  .summary {
    grid-template-columns: 1fr 1fr;
  }

  .history-item-top {
    align-items: flex-start;
  }
}
/* ==========================================================
   BES KASIR SALE READY V1
   ========================================================== */

.history-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.history-print-button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.history-print-button:active {
  transform: scale(.97);
}

@media print {
  body {
    background: #ffffff;
  }
}

/* ==========================================================
   BES POS INTERNATIONAL UI V1
   ========================================================== */

:root {
  --bes-ink: #0b1220;
  --bes-muted: #64748b;
  --bes-line: #e2e8f0;
  --bes-surface: #ffffff;
  --bes-soft: #f8fafc;
  --bes-accent: #0f766e;
  --bes-accent-dark: #115e59;
  --bes-navy: #0f172a;
}

body {
  color: var(--bes-ink);
  background:
    linear-gradient(180deg,#eaf0f6 0,#f8fafc 320px);
}

.app {
  box-shadow: 0 0 0 1px rgba(15,23,42,.03);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background:
    linear-gradient(135deg,#0b1220 0%,#132238 100%);
  box-shadow: 0 8px 30px rgba(15,23,42,.12);
}

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

.language-toggle {
  min-width: 42px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  cursor: pointer;
}

.language-toggle:active {
  transform: scale(.96);
}

.summary > div,
.product,
.history-card,
.product-list-item {
  box-shadow:
    0 1px 2px rgba(15,23,42,.03),
    0 8px 24px rgba(15,23,42,.035);
}

.product {
  transition:
    transform .12s ease,
    border-color .12s ease,
    box-shadow .12s ease;
}

.product:hover {
  border-color: #cbd5e1;
  box-shadow: 0 10px 26px rgba(15,23,42,.07);
}

.pay-button,
.payment-option,
.add-product-button {
  transition:
    transform .12s ease,
    box-shadow .12s ease,
    background .12s ease;
}

.pay-button:not(:disabled):hover,
.payment-option:hover {
  box-shadow: 0 10px 24px rgba(15,118,110,.18);
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(15,118,110,.22);
  outline-offset: 2px;
}

.modal {
  backdrop-filter: blur(5px);
}

.modal-card {
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
}

@media (min-width: 900px) {
  .app {
    max-width: 1180px;
  }

  main {
    padding: 24px;
  }

  .summary {
    grid-template-columns: repeat(4,1fr);
  }

  .product-grid {
    grid-template-columns: repeat(4,1fr);
  }
}

@media (max-width: 480px) {
  main {
    padding: 14px;
  }

  .topbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand {
    font-size: 21px;
  }

  .status {
    font-size: 10px;
  }

  .section-heading {
    flex-wrap: wrap;
  }

  .business-tools .section-heading {
    justify-content: flex-start;
  }

  .business-tools .section-title {
    width: 100%;
  }

  .manage-products-button {
    flex: 1 1 auto;
  }
}

/* ==========================================================
   BES POS — INTERNATIONAL LIGHTWEIGHT UI V4
   DESIGN REFERENCE: 9 POS REFERENCES
   UI ONLY — FUNCTIONAL JS UNCHANGED
   ========================================================== */

:root{
  --ui-bg:#f4f6f8;
  --ui-surface:#ffffff;
  --ui-border:#e5e9ef;
  --ui-text:#101828;
  --ui-muted:#667085;
  --ui-brand:#0b172a;
  --ui-accent:#087f73;
  --ui-accent-soft:#e9f7f4;
  --ui-danger:#d92d20;
  --ui-radius:14px;
}

html{
  background:var(--ui-bg);
  -webkit-text-size-adjust:100%;
}

body{
  background:var(--ui-bg);
  color:var(--ui-text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.app{
  width:100%;
  max-width:1180px;
  min-height:100vh;
  margin:0 auto;
  background:var(--ui-surface);
  box-shadow:0 0 0 1px rgba(16,24,40,.03);
}

.topbar{
  min-height:76px;
  padding:
    calc(16px + env(safe-area-inset-top))
    24px
    16px;
  background:var(--ui-brand);
}

.brand{
  font-size:22px;
  line-height:1.1;
  letter-spacing:-.5px;
}

.tagline{
  margin-top:5px;
  color:#98a2b3;
  font-size:12px;
  font-weight:500;
}

.status{
  min-height:36px;
  padding:0 12px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:10px;
  color:#d0d5dd;
  background:rgba(255,255,255,.05);
  font-size:11px;
  font-weight:600;
}

.status-dot{
  width:7px;
  height:7px;
  background:#32d583;
}

main{
  padding:24px;
}

/* ---------- SUMMARY ---------- */

.summary{
  grid-template-columns:repeat(4,1fr);
  gap:12px;
  margin-bottom:28px;
}

.summary>div{
  min-height:92px;
  padding:16px;
  border:1px solid var(--ui-border);
  border-radius:var(--ui-radius);
  background:#fff;
  box-shadow:0 1px 2px rgba(16,24,40,.03);
}

.summary span{
  margin-bottom:8px;
  color:var(--ui-muted);
  font-size:11px;
  font-weight:600;
}

.summary strong{
  color:var(--ui-text);
  font-size:20px;
  font-weight:800;
  letter-spacing:-.3px;
}

/* ---------- SECTIONS ---------- */

.section-heading{
  min-height:40px;
  margin-bottom:12px;
}

.section-title{
  margin-bottom:0;
  color:var(--ui-text);
  font-size:14px;
  font-weight:800;
  letter-spacing:-.1px;
}

.manage-products-button{
  min-height:38px;
  padding:0 14px;
  border:1px solid #d0d5dd;
  border-radius:10px;
  background:#fff;
  color:var(--ui-text);
  font-size:12px;
  font-weight:750;
  box-shadow:0 1px 1px rgba(16,24,40,.02);
}

.manage-products-button:hover{
  border-color:#98a2b3;
  background:#f9fafb;
}

/* ---------- PRODUCT GRID ---------- */

.product-grid{
  grid-template-columns:repeat(4,1fr);
  gap:12px;
}

.product{
  min-height:96px;
  padding:15px;
  border:1px solid var(--ui-border);
  border-radius:var(--ui-radius);
  background:#fff;
  box-shadow:0 1px 2px rgba(16,24,40,.03);
  transition:
    border-color .12s ease,
    box-shadow .12s ease,
    transform .08s ease;
}

.product:hover{
  border-color:#cbd5e1;
  box-shadow:0 4px 12px rgba(16,24,40,.06);
}

.product:active{
  transform:scale(.985);
  background:#f8fafc;
}

.product-name{
  font-size:14px;
  font-weight:750;
}

.product-price{
  margin-top:9px;
  color:var(--ui-accent);
  font-size:14px;
  font-weight:800;
}

/* ---------- OPERATIONS / HISTORY ---------- */

.business-tools{
  margin-bottom:28px;
}

.low-stock-panel{
  margin-bottom:12px;
}

.history-card{
  overflow:hidden;
  border:1px solid var(--ui-border);
  border-radius:var(--ui-radius);
  background:#fff;
  box-shadow:0 1px 2px rgba(16,24,40,.03);
}

.history-header{
  min-height:50px;
  padding:0 16px;
  border-bottom:1px solid var(--ui-border);
}

.history-header strong{
  font-size:13px;
  font-weight:800;
}

.history-header span{
  color:var(--ui-muted);
  font-size:11px;
}

/* ---------- CART ---------- */

.cart{
  margin-top:28px;
  padding-top:20px;
  border-top:1px solid var(--ui-border);
}

.cart-header{
  min-height:40px;
}

.cart-header>strong{
  font-size:14px;
  font-weight:800;
}

.text-button{
  padding:8px 4px;
  color:var(--ui-danger);
  font-size:11px;
  font-weight:700;
}

.cart-items{
  min-height:54px;
}

.cart-item{
  padding:13px 0;
  border-bottom:1px solid #f0f2f5;
}

.cart-item-name{
  font-size:13px;
  font-weight:750;
}

.cart-item-price{
  color:var(--ui-muted);
  font-size:11px;
}

.cart-item-total{
  font-size:13px;
  font-weight:800;
}

.quantity-control button{
  min-width:30px;
  min-height:30px;
  border-radius:9px;
}

/* ---------- TOTAL / PAYMENT ---------- */

.total-row{
  margin-top:18px;
  padding-top:16px;
  border-top:1px solid var(--ui-border);
}

.total-row span{
  color:var(--ui-muted);
  font-size:12px;
  font-weight:600;
}

.total-row strong{
  font-size:25px;
  font-weight:850;
  letter-spacing:-.5px;
}

.pay-button{
  min-height:52px;
  margin-top:14px;
  border-radius:12px;
  font-size:14px;
  font-weight:850;
  letter-spacing:.1px;
}

/* ---------- MODALS ---------- */

.modal{
  background:rgba(15,23,42,.48);
  backdrop-filter:blur(3px);
}

.modal-card{
  border:1px solid rgba(255,255,255,.35);
  border-radius:18px;
  box-shadow:0 24px 70px rgba(15,23,42,.22);
}

/* ---------- MOBILE ---------- */

@media(max-width:800px){

  .app{
    max-width:none;
  }

  main{
    padding:18px;
  }

  .summary{
    grid-template-columns:repeat(2,1fr);
  }

  .product-grid{
    grid-template-columns:repeat(2,1fr);
  }

  .topbar{
    padding-left:18px;
    padding-right:18px;
  }
}

@media(max-width:480px){

  main{
    padding:14px;
  }

  .topbar{
    min-height:68px;
    padding:
      calc(14px + env(safe-area-inset-top))
      14px
      14px;
  }

  .brand{
    font-size:20px;
  }

  .status{
    padding:0 9px;
  }

  .summary{
    gap:8px;
    margin-bottom:22px;
  }

  .summary>div{
    min-height:82px;
    padding:13px;
    border-radius:12px;
  }

  .summary strong{
    font-size:17px;
  }

  .product-grid{
    gap:8px;
  }

  .product{
    min-height:86px;
    padding:12px;
    border-radius:12px;
  }
}

/* ==========================================================
   END INTERNATIONAL LIGHTWEIGHT UI V4
   ========================================================== */
/* ==========================================================
   BES POS — INTERNATIONAL LIGHTWEIGHT UI V5
   Visual layer only.
   Functional JS intentionally untouched.
   ========================================================== */

:root {
  --bes-ink: #0b1220;
  --bes-navy: #0f1b2d;
  --bes-muted: #64748b;
  --bes-line: #e5eaf0;
  --bes-soft: #f6f8fa;
  --bes-card: #ffffff;
  --bes-accent: #0f766e;
  --bes-accent-soft: #ecfdf5;
  --bes-danger: #dc2626;
  --bes-radius: 12px;
  --bes-shadow: 0 1px 3px rgba(15, 23, 42, .055);
}

/* ---------- FOUNDATION ---------- */

html {
  background: #eef2f6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #eef2f6;
  color: var(--bes-ink);
}

button,
input {
  font-family: inherit;
}

button {
  transition:
    transform .12s ease,
    box-shadow .12s ease,
    border-color .12s ease,
    background-color .12s ease;
}

/* ---------- APP FRAME ---------- */

.app {
  width: min(1240px, 100%);
  max-width: 1240px;
  min-height: 100vh;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15,23,42,.035);
}

/* ---------- HEADER ---------- */

.topbar {
  min-height: 72px;
  padding:
    calc(14px + env(safe-area-inset-top))
    22px
    14px;

  background:
    linear-gradient(135deg, #0b1424 0%, #122239 100%);

  border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand {
  font-size: 22px;
  line-height: 1.05;
  font-weight: 850;
  letter-spacing: -.7px;
}

.tagline {
  margin-top: 5px;
  font-size: 12px;
  color: #aebdce;
  letter-spacing: .1px;
}

.status {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: #d7e0ea;
  font-size: 11px;
  font-weight: 700;
}

.status-dot {
  width: 7px;
  height: 7px;
  box-shadow: 0 0 0 4px rgba(34,197,94,.10);
}

/* ---------- MAIN LAYOUT ---------- */

main {
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  grid-template-areas:
    "summary summary"
    "products cart"
    "tools tools";
  gap: 18px;
  align-items: start;
}

.summary {
  grid-area: summary;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0;
}

.summary > div {
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid var(--bes-line);
  border-radius: 10px;
  background: var(--bes-soft);
  box-shadow: none;
}

.summary span {
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 650;
  color: var(--bes-muted);
  letter-spacing: .1px;
}

.summary strong {
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: -.3px;
}

/* ---------- PRODUCT AREA ---------- */

main > section:not(.summary):not(.cart):not(.business-tools) {
  grid-area: products;
  min-width: 0;
}

.section-heading,
.cart-header {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.section-title,
.cart-header strong {
  margin: 0;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -.3px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.product {
  position: relative;
  min-width: 0;
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--bes-line);
  border-radius: var(--bes-radius);
  background: #fff;
  box-shadow: none;
  overflow: hidden;
}

.product::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background .12s ease;
}

.product:hover {
  border-color: #cbd5e1;
  box-shadow: var(--bes-shadow);
}

.product:hover::after {
  background: var(--bes-accent);
}

.product:active {
  transform: scale(.985);
  background: #fbfdff;
}

.product-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.2px;
}

.product-price {
  margin-top: 7px;
  font-size: 13px;
  font-weight: 850;
  color: var(--bes-accent);
}

/* ---------- CART / CHECKOUT ---------- */

main > .cart {
  grid-area: cart;
  min-width: 0;
  position: sticky;
  top: 18px;
  padding: 14px;
  border: 1px solid var(--bes-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--bes-shadow);
}

.cart-header {
  padding-bottom: 10px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--bes-line);
}

.text-button {
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: var(--bes-danger);
  font-size: 11px;
  font-weight: 750;
}

.text-button:hover {
  text-decoration: underline;
}

#cartItems {
  min-height: 148px;
  padding: 4px 0;
}

#total {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -.7px;
}

.pay-button {
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: var(--bes-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  box-shadow: none;
}

.pay-button:hover {
  background: #0d665f;
  box-shadow: 0 2px 6px rgba(15,118,110,.18);
}

.pay-button:active {
  transform: translateY(1px);
}

/* ---------- OPERATIONAL TOOLS ---------- */

main > .business-tools {
  grid-area: tools;
  min-width: 0;
}

.business-tools {
  padding-top: 2px;
}

.business-tools > .section-heading {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--bes-line);
}

.manage-products-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #d7dee7;
  border-radius: 9px;
  background: #fff;
  color: var(--bes-ink);
  font-size: 12px;
  font-weight: 800;
}

.manage-products-button:hover {
  border-color: #aeb9c7;
  background: #f8fafc;
}

.low-stock-panel {
  margin: 12px 0;
  border-radius: 13px;
}

.history-card {
  overflow: hidden;
  border: 1px solid var(--bes-line);
  border-radius: 12px;
  background: #fff;
}

.history-header {
  min-height: 50px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--bes-line);
}

.history-header strong {
  font-size: 14px;
  font-weight: 850;
}

.history-header span {
  font-size: 11px;
  color: var(--bes-muted);
}

.transaction-history {
  max-height: 300px;
}

/* ---------- FORM / MODAL POLISH ---------- */

.modal-card {
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(15,23,42,.20);
}

.manager-header {
  padding-bottom: 14px;
}

.modal-title {
  font-size: 19px;
  font-weight: 850;
  letter-spacing: -.3px;
}

.manager-subtitle {
  color: var(--bes-muted);
}

.icon-close {
  border-radius: 10px;
}

.product-field input,
.product-field select {
  min-height: 44px;
  border-radius: 11px;
  border-color: #d8e0e8;
}

.product-field input:focus,
.product-field select:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15,118,110,.10);
}

.cancel-button {
  min-height: 44px;
  border-radius: 11px;
}

/* ---------- RESPONSIVE POS WORKSPACE ---------- */

@media (min-width: 769px) and (max-width: 1000px) {
  main {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 330px);
    padding: 16px;
    gap: 14px;
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topbar {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 768px) {
  html,
  body {
    background: #fff;
  }

  .app {
    width: 100%;
    box-shadow: none;
  }

  .topbar {
    min-height: 70px;
    padding:
      calc(14px + env(safe-area-inset-top))
      16px
      14px;
  }

  .brand {
    font-size: 21px;
  }

  .tagline {
    margin-top: 3px;
    font-size: 11px;
  }

  .status {
    min-height: 32px;
    padding: 0 9px;
    font-size: 10px;
  }

  main {
    display: flex;
    flex-direction: column;
    padding:
      16px
      16px
      calc(24px + env(safe-area-inset-bottom));
    gap: 18px;
  }

  .summary {
    order: 1;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .summary > div {
    min-width: 0;
    min-height: 66px;
    padding: 11px;
    border-radius: 10px;
  }

  .summary span {
    font-size: 10px;
  }

  .summary strong {
    font-size: 16px;
    overflow-wrap: anywhere;
  }

  main > section:not(.summary):not(.cart):not(.business-tools) {
    order: 2;
    width: 100%;
    min-width: 0;
  }

  main > .cart {
    order: 3;
    position: static;
    width: 100%;
    min-width: 0;
    padding: 14px;
    border-radius: 12px;
  }

  main > .business-tools {
    order: 4;
    width: 100%;
    min-width: 0;
  }

  main > section:not(.summary):not(.cart):not(.business-tools) > .section-heading {
    flex-wrap: nowrap;
    width: 100%;
  }

  main > section:not(.summary):not(.cart):not(.business-tools) > .section-heading .section-title {
    min-width: 0;
  }

  main > section:not(.summary):not(.cart):not(.business-tools) > .section-heading .manage-products-button {
    flex: 0 0 auto;
  }

  .product-grid {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .product {
    width: 100%;
    min-width: 0;
    min-height: 88px;
    padding: 12px;
    border-radius: 12px;
    overflow: hidden;
  }

  .product-name,
  .product-price {
    overflow-wrap: anywhere;
  }

  #cartItems {
    min-height: 0;
    padding: 4px 0;
  }

  #cartItems .empty-cart {
    padding: 14px 0;
  }

  .total-row {
    margin-top: 10px;
    padding-top: 12px;
  }

  .pay-button {
    min-height: 50px;
  }

  .business-tools > .section-heading {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
  }

  .business-tools > .section-heading .section-title {
    width: 100%;
  }

  .business-tools > .section-heading .manage-products-button {
    flex: 1 1 104px;
    padding: 0 10px;
  }
}

/* ---------- ACCESSIBILITY ---------- */

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(15,118,110,.22);
  outline-offset: 2px;
}

/* ---------- REDUCE MOTION ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
