:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e5e7eb;
  --orange: #f97316;
  --orange-soft: #fff5e8;
  --green: #16a34a;
  --green-strong: #099447;
  --green-soft: #eafbf0;
  --blue: #1577f2;
  --blue-strong: #0b63da;
  --blue-soft: #eaf4ff;
  --danger: #dc2626;
  --danger-soft: #fff1f2;
  --shadow: 0 4px 16px rgba(15, 23, 42, .06);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --bottom-nav: 74px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .46; cursor: not-allowed; }
.app-shell {
  width: min(100%, 880px);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  padding-bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom));
}
.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: max(18px, env(safe-area-inset-top)) 18px 14px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 1.35rem;
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.topbar h1 { margin: 0; font-size: clamp(1.45rem, 5vw, 2rem); letter-spacing: -.03em; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: .92rem; }
.connection { color: #22c55e; font-size: 1.2rem; padding: 8px; }
.connection.offline { color: #f59e0b; }
.main-content { padding: 0 14px 20px; }
.view { display: none; }
.view.active { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.sale-products-panel {
  background: linear-gradient(180deg, color-mix(in srgb, var(--orange-soft) 94%, var(--surface)), var(--orange-soft));
  border: 1px solid color-mix(in srgb, var(--orange) 24%, var(--line));
  border-radius: var(--radius-xl);
  padding: 14px;
  box-shadow: var(--shadow);
}
.panel-heading,
.section-title-row,
.page-heading,
.modal-head,
.change-row,
.pay-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.heading-group { display: flex; align-items: center; gap: 11px; min-width: 0; }
.panel-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--orange) 12%, var(--surface));
}
.panel-heading h2 { margin: 0; font-size: 1.05rem; }
.panel-heading p { margin: 3px 0 0; color: var(--muted); font-size: .78rem; }
.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  margin-left: 4px;
  background: color-mix(in srgb, var(--orange) 13%, var(--surface));
  color: var(--orange);
  font-weight: 900;
}
.ghost-danger {
  border: 0;
  background: transparent;
  color: var(--orange);
  font-weight: 800;
  padding: 10px 4px;
}
.cart-scroller {
  margin-top: 12px;
  max-height: clamp(300px, 47dvh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding-right: 2px;
}
.cart-list { display: grid; gap: 10px; }
.cart-item {
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--orange) 8%, var(--line));
  border-radius: 20px;
  padding: 13px;
}
.cart-line {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
}
.product-thumb {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 900;
  border: 1px solid var(--line);
}
.item-name { font-weight: 850; line-height: 1.25; }
.item-meta { color: var(--muted); font-size: .76rem; margin-top: 3px; }
.item-unit-price { color: var(--orange); font-weight: 900; margin-top: 4px; font-size: .9rem; }
.line-total { font-weight: 950; white-space: nowrap; font-size: 1rem; }
.cart-actions { margin-top: 10px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.qty-control {
  display: inline-grid;
  grid-template-columns: 42px 42px 42px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: var(--surface-soft);
}
.qty-btn {
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.28rem;
  font-weight: 900;
}
.qty-btn:active { background: color-mix(in srgb, var(--blue) 9%, transparent); }
.qty-value { text-align: center; font-weight: 900; }
.remove-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 18%, var(--line));
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 900;
}
.empty-state { text-align: center; padding: 36px 12px; color: var(--muted); }
.empty-state strong { display: block; color: var(--text); margin-bottom: 5px; }
.empty-state p { margin: 0; }
.empty-icon { font-size: 2rem; opacity: .65; margin-bottom: 6px; }
.empty-state.compact { padding: 18px 8px; }

.payment-panel {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr minmax(140px, 44%);
  gap: 12px;
  align-items: stretch;
  background: linear-gradient(135deg, var(--green-soft), color-mix(in srgb, var(--green-soft) 65%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--green) 18%, var(--line));
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow);
}
.total-block { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.total-block > span { font-weight: 850; color: color-mix(in srgb, var(--green) 74%, var(--text)); }
.total-block strong { display: block; margin-top: 2px; font-size: clamp(1.5rem, 6vw, 2.2rem); letter-spacing: -.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.total-block small { color: var(--muted); margin-top: 2px; }
.checkout-btn {
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--green), var(--green-strong));
  color: #fff;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 10px 24px rgba(22, 163, 74, .2);
}
.checkout-btn span { font-size: 1.35rem; }
.checkout-btn strong { font-size: 1.08rem; }

.scan-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px;
  background: var(--blue-soft);
  border: 1px solid color-mix(in srgb, var(--blue) 16%, var(--line));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.scan-action {
  border-radius: 18px;
  min-height: 84px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  text-align: left;
  font-weight: 850;
}
.scan-action.secondary { background: var(--surface); color: var(--blue); }
.scan-action.primary { background: linear-gradient(135deg, var(--blue), var(--blue-strong)); color: #fff; border-color: transparent; box-shadow: 0 10px 24px rgba(21,119,242,.22); }
.scan-icon { font-size: 1.45rem; }
.feedback { min-height: 22px; margin: 8px 4px 0; color: var(--green); font-size: .86rem; font-weight: 750; text-align: center; }

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(100%, 880px);
  height: calc(var(--bottom-nav) + env(safe-area-inset-bottom));
  padding: 6px 6px env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  z-index: 30;
}
.nav-btn {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  min-width: 0;
  border-radius: 14px;
}
.nav-btn span { font-size: 1.15rem; }
.nav-btn small { font-weight: 720; font-size: .66rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.nav-btn.active { color: var(--blue); }
.nav-btn.active::before { content: ""; position: absolute; top: 0; width: 38%; height: 3px; border-radius: 999px; background: var(--blue); }

.page-heading { align-items: flex-end; padding: 12px 3px 14px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.page-heading h2 { margin: 0; font-size: 1.5rem; letter-spacing: -.03em; }
.page-heading p:not(.eyebrow) { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.eyebrow { margin: 0 0 3px; color: var(--muted); font-size: .68rem; font-weight: 900; letter-spacing: .1em; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.solid-btn, .outline-btn {
  min-height: 44px;
  border-radius: 13px;
  padding: 10px 14px;
  font-weight: 850;
}
.solid-btn { border: 1px solid var(--blue); background: var(--blue); color: #fff; }
.outline-btn { border: 1px solid var(--line); background: var(--surface-soft); color: var(--text); }
.full { width: 100%; }
.file-button { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }

.product-tools { padding: 14px; }
.search-field { display: block; font-size: .78rem; font-weight: 800; color: var(--muted); }
.search-field input { margin-top: 6px; }
.tool-actions { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }
.helper { color: var(--muted); font-size: .76rem; margin: 10px 0 0; }
.product-list-card { margin-top: 12px; padding: 8px 14px; }
.product-item { padding: 13px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.product-item:first-child { border-top: 0; }
.product-actions { display: flex; align-items: center; gap: 6px; }
.mini-btn { border: 1px solid var(--line); background: var(--surface-soft); color: var(--text); border-radius: 10px; padding: 8px 9px; font-weight: 800; }
.mini-btn.danger { color: var(--danger); background: var(--danger-soft); }
.badge { display: inline-block; padding: 3px 7px; border-radius: 999px; font-size: .65rem; font-weight: 850; margin-left: 5px; background: var(--surface-soft); color: var(--muted); }
.badge.on { color: var(--green); background: var(--green-soft); }
.low-stock { color: #d97706; font-weight: 800; }

.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 15px; box-shadow: var(--shadow); }
.metric-card span { color: var(--muted); font-size: .78rem; font-weight: 750; }
.metric-card strong { display: block; margin-top: 4px; font-size: 1.35rem; }
.recent-sales-card { margin-top: 12px; padding: 14px; }
.section-title-row h3 { margin: 0; }
.sale-item { padding: 12px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.sale-item:first-child { border-top: 0; }
.sale-amount { font-weight: 900; white-space: nowrap; }

.info-stack { display: grid; gap: 12px; }
.info-card { padding: 16px; display: grid; grid-template-columns: 46px 1fr; gap: 12px; align-items: start; }
.info-card h3 { margin: 0 0 5px; }
.info-card p { margin: 0; color: var(--muted); line-height: 1.45; font-size: .9rem; }
.info-icon { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: var(--surface-soft); border: 1px solid var(--line); }
.actions-card { grid-template-columns: 1fr; }
.backup-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.profile-card { padding: 16px; }
.logo-setting { display: grid; grid-template-columns: 82px 1fr; gap: 14px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.logo-preview { width: 82px; height: 82px; display: grid; place-items: center; overflow: hidden; border-radius: 20px; border: 1px solid var(--line); background: var(--surface-soft); font-size: 2rem; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-controls { min-width: 0; }
.logo-controls strong, .logo-controls small { display: block; }
.logo-controls small { margin-top: 4px; color: var(--muted); line-height: 1.35; }
.logo-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}
input:focus { border-color: color-mix(in srgb, var(--blue) 58%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 13%, transparent); }
.profile-card label, .modal label { display: block; font-size: .82rem; font-weight: 800; margin: 12px 0; }
.profile-card label input, .modal label input { margin-top: 7px; }

.modal {
  width: min(calc(100% - 24px), 530px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 90px rgba(0,0,0,.34);
}
.modal::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(3px); }
.modal-head { margin-bottom: 14px; }
.modal-head h2 { margin: 0; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-soft); color: var(--text); font-size: 1.45rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.switch-row { display: flex !important; align-items: center; justify-content: space-between; gap: 14px; }
.switch-row span { flex: 1; }
.switch-row strong, .switch-row small { display: block; }
.switch-row small { color: var(--muted); font-weight: 500; margin-top: 3px; }
.switch-row input { width: 22px; height: 22px; min-height: 22px; margin: 0 !important; }
.form-error { min-height: 20px; color: var(--danger); font-size: .82rem; font-weight: 750; }
.modal-intro { margin: -3px 0 10px; color: var(--muted); font-size: .88rem; }
.stock-search { position: relative; }
.stock-suggestions { top: calc(100% - 4px); }
.camera-stock-btn { margin-top: 4px; color: var(--blue); }
.stock-selected { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 13px; padding: 12px; border: 1px solid color-mix(in srgb, var(--green) 28%, var(--line)); border-radius: 14px; background: var(--green-soft); }
.stock-selected[hidden], .stock-projection[hidden] { display: none; }
.stock-selected strong, .stock-selected small { display: block; }
.stock-selected small { margin-top: 3px; color: var(--muted); }
.stock-selected > span { color: var(--green); font-weight: 900; text-align: right; }
.stock-projection { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; padding: 12px; border-radius: 13px; background: var(--blue-soft); color: var(--blue); }
.stock-projection strong { font-size: 1.15rem; }
.scanner-box { min-height: 280px; overflow: hidden; background: #000; border-radius: 16px; }
.scanner-message { color: var(--muted); text-align: center; font-size: .88rem; }
.pay-total { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 15px; padding: 14px; }
.pay-total span { color: var(--muted); }
.pay-total strong { font-size: 1.2rem; }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.pay-method { min-height: 50px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); color: var(--text); font-weight: 850; }
.pay-method.active { border-color: var(--green); background: var(--green); color: #fff; }
.change-row { padding: 12px; border: 1px solid var(--line); background: var(--surface-soft); border-radius: 13px; margin: 10px 0; }
.success-mark { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-size: 2rem; font-weight: 950; }
.receipt-modal { text-align: center; }
.receipt-summary { text-align: left; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 15px; padding: 14px; margin: 16px 0; }
.receipt-summary .row { display: flex; justify-content: space-between; gap: 10px; margin: 7px 0; }
.toast { position: fixed; left: 50%; top: max(16px, env(safe-area-inset-top)); transform: translate(-50%, -16px); opacity: 0; pointer-events: none; background: var(--text); color: var(--bg); padding: 10px 15px; border-radius: 999px; font-size: .85rem; font-weight: 850; z-index: 80; transition: .2s ease; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.quick-products { margin-top: 12px; padding: 14px; }
.quick-products-head { display: grid; grid-template-columns: 1fr minmax(150px, 230px); gap: 12px; align-items: end; }
.quick-products h2 { margin: 0; font-size: 1rem; }
.quick-products p { margin: 4px 0 0; color: var(--muted); font-size: .8rem; }
.quick-mode-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 12px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.quick-mode-btn { min-height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: .76rem; font-weight: 850; }
.quick-mode-btn.active { background: var(--surface); color: var(--blue); box-shadow: var(--shadow); }
.quick-search input { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); color: var(--text); padding: 9px 11px; outline: none; }
.quick-search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(21, 119, 242, .1); }
.quick-product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.quick-product { min-height: 92px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 5px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); text-align: left; }
.quick-product span { font-weight: 800; }
.quick-product strong { color: var(--blue); }
.quick-product small { color: var(--muted); }
.quick-product small + small { margin-top: -2px; font-size: .68rem; }
.quick-product:active { transform: scale(.985); }
.mini-btn.favorite { min-width: 38px; color: #ca8a04; font-size: 1.05rem; }

@media (max-width: 390px) {
  .main-content { padding-inline: 10px; }
  .payment-panel { grid-template-columns: 1fr 42%; }
  .total-block strong { font-size: 1.35rem; }
  .scan-action { font-size: .82rem; padding: 9px; }
  .nav-btn small { font-size: .6rem; }
  .cart-line { grid-template-columns: 40px 1fr; }
  .line-total { grid-column: 2; justify-self: end; }
  .cart-actions { justify-content: space-between; }
  .logo-setting { grid-template-columns: 68px 1fr; }
  .logo-preview { width: 68px; height: 68px; }
  .quick-products-head, .quick-product-grid { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; }
  .page-actions { width: 100%; justify-content: stretch; }
  .page-actions > * { flex: 1; }
}
@media (min-width: 720px) {
  .main-content { padding-inline: 22px; }
  .cart-scroller { max-height: 52dvh; }
  .metric-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Continuous barcode scanner feedback */
.scanner-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}
.scanner-status > div { min-width: 0; }
.scanner-status strong,
.scanner-status small { display: block; }
.scanner-status small {
  margin-top: 2px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scanner-live-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--blue) 13%, transparent);
}
.scanner-status.success {
  border-color: color-mix(in srgb, var(--green) 35%, var(--line));
  background: var(--green-soft);
}
.scanner-status.success .scanner-live-dot {
  background: var(--green);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--green) 13%, transparent);
}
.scanner-status.error {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  background: var(--danger-soft);
}
.scanner-status.error .scanner-live-dot {
  background: var(--danger);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--danger) 13%, transparent);
}
.scanner-actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 8px;
  margin-top: 10px;
}
.scanner-actions > * { width: 100%; }
#retryScannerBtn { grid-column: 1 / -1; }

/* Search suggestions, catalog reports and period analytics */
.danger-btn { min-height: 44px; border: 1px solid var(--danger); border-radius: 13px; padding: 10px 14px; background: var(--danger); color: #fff; font-weight: 850; }
.quick-search { position: relative; }
.search-suggestions {
  position: absolute;
  z-index: 25;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: min(360px, 55dvh);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(15, 23, 42, .16);
  padding: 5px;
}
.suggestion-item { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; border: 0; border-radius: 10px; padding: 10px; background: transparent; color: var(--text); text-align: left; }
.suggestion-item:hover, .suggestion-item.active { background: var(--blue-soft); }
.suggestion-item span, .suggestion-item small { display: block; }
.suggestion-item span { font-weight: 850; }
.suggestion-item small { margin-top: 2px; color: var(--muted); }
.suggestion-item strong { color: var(--blue); white-space: nowrap; }
.result-caption { min-height: 18px; margin: 10px 0 0 !important; color: var(--muted); font-size: .72rem !important; }
.import-report { display: grid; gap: 9px; margin: 2px 0 18px; }
.import-stat { display: flex; justify-content: space-between; gap: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.import-stat strong { text-align: right; }
.import-warning { margin: 0; padding: 11px 12px; border-radius: 12px; background: var(--orange-soft); color: #9a3412; font-size: .82rem; line-height: 1.42; }
.period-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-bottom: 12px; padding: 5px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); }
.period-btn { min-height: 42px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-weight: 850; }
.period-btn.active { background: var(--surface); color: var(--blue); box-shadow: var(--shadow); }
.analytics-grid { display: grid; gap: 12px; margin-top: 12px; }
.chart-card { min-width: 0; padding: 14px; overflow: hidden; }
.chart-card h3 { margin: 0; font-size: 1rem; }
.bar-chart { display: flex; align-items: stretch; gap: 8px; min-height: 190px; margin-top: 14px; padding: 8px 2px 0; overflow-x: auto; overscroll-behavior-x: contain; }
.chart-column { min-width: 42px; flex: 1 0 42px; display: grid; grid-template-rows: 26px 1fr 22px; align-items: end; gap: 5px; text-align: center; }
.chart-value { color: var(--muted); font-size: .62rem; font-weight: 800; white-space: nowrap; }
.chart-track { height: 118px; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--line); }
.chart-bar { width: min(28px, 72%); min-height: 3px; height: var(--bar-height); border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, var(--blue), var(--blue-strong)); }
.chart-label { color: var(--muted); font-size: .66rem; white-space: nowrap; }
.empty-chart { margin: auto; color: var(--muted); text-align: center; font-size: .86rem; }
.payment-chart { display: grid; gap: 12px; margin-top: 16px; }
.payment-row { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 9px; font-size: .78rem; }
.payment-row span { font-weight: 800; }
.payment-track { height: 12px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); }
.payment-fill { height: 100%; width: var(--fill-width); border-radius: inherit; background: var(--green); }
.payment-row.card-payment .payment-fill { background: var(--blue); }
.payment-row strong { white-space: nowrap; }
.top-products-list { margin-top: 8px; }
.top-product-row { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.top-product-row:first-child { border-top: 0; }
.top-product-rank { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 9px; background: var(--blue-soft); color: var(--blue); font-size: .72rem; font-weight: 900; }
.top-product-row small { color: var(--muted); }
.top-product-row > strong { color: var(--blue); white-space: nowrap; }

@media (min-width: 720px) {
  .analytics-grid { grid-template-columns: 1.45fr 1fr; }
  .top-products-card { grid-column: 1 / -1; }
}

/* POS General: product barcode lookup and additive stock intake */
.product-code-row { display: flex; align-items: end; gap: 9px; }
.product-code-row label { flex: 1; min-width: 0; margin-bottom: 0; }
.product-code-row input { min-width: 0; }
.product-scan-btn { flex-shrink: 0; min-height: 51px; font-size: .85rem; padding-inline: 13px; }
.lookup-status { font-size: .8rem; line-height: 1.4; color: var(--muted); margin: 9px 0 15px; }
.lookup-status.found { color: var(--green); font-weight: 700; }
.stock-entry { margin-top: 12px; }
.stock-entry input[readonly] { opacity: .85; background: var(--surface-soft); cursor: default; }
.stock-preview { padding: 12px; border: 1px solid var(--line); background: var(--surface-soft); border-radius: 12px; font-size: .84rem; }
@media (max-width: 400px) {
  .product-code-row { flex-wrap: wrap; }
  .product-scan-btn { width: 100%; }
}
:root .update-banner[hidden] { display: none; }
.update-banner { position: fixed; z-index: 1000; left: 1rem; right: 1rem; bottom: 5.5rem; display: flex; gap: 1rem; align-items: center; padding: 1rem; border: 1px solid #93c5fd; border-radius: 14px; background: #eff6ff; color: #172554; box-shadow: 0 6px 24px #0002; }
.update-banner button { flex: 0 0 auto; border: 0; border-radius: 8px; padding: .75rem 1rem; background: #1d4ed8; color: white; cursor: pointer; }

/* Device preference changes colors only; the approved layout stays shared. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --surface: #111c2e;
  --surface-soft: #18263b;
  --text: #eef4ff;
  --muted: #afbdd3;
  --line: #354660;
  --orange: #ffb270;
  --orange-soft: #302319;
  --green: #55d990;
  --green-strong: #32bf79;
  --green-soft: #122f26;
  --blue: #84baff;
  --blue-strong: #4f9bff;
  --blue-soft: #132a47;
  --danger: #ff919d;
  --danger-soft: #351d28;
  --shadow: 0 4px 16px rgba(0, 0, 0, .22);
  --action-blue: #155fc2;
  --action-blue-strong: #104fa1;
  --action-green: #147a44;
  --action-green-strong: #0d6637;
  --action-danger: #b42338;
  --on-action: #ffffff;
}
:root[data-theme="dark"] .solid-btn,
:root[data-theme="dark"] .update-banner button { background: var(--action-blue); border-color: var(--action-blue); color: var(--on-action); }
:root[data-theme="dark"] .scan-action.primary { background: linear-gradient(135deg, var(--action-blue), var(--action-blue-strong)); color: var(--on-action); }
:root[data-theme="dark"] .pay-method.active { background: var(--action-green); color: var(--on-action); }
:root[data-theme="dark"] .checkout-btn { background: linear-gradient(135deg, var(--action-green), var(--action-green-strong)); color: var(--on-action); }
:root[data-theme="dark"] .danger-btn { background: var(--action-danger); color: var(--on-action); }
:root[data-theme="dark"] .mini-btn.favorite { color: #facc15; }
:root[data-theme="dark"] .low-stock { color: #fbbf67; }
:root[data-theme="dark"] .import-warning { color: #ffc995; }
:root[data-theme="dark"] .update-banner { border-color: var(--line); background: var(--blue-soft); color: var(--text); }
.appearance-card { margin-top: 16px; padding: 20px; }
.appearance-card h2 { margin: 0 0 16px; font-size: 1.1rem; }
.appearance-card label { display: block; font-weight: 700; margin-bottom: 8px; }
.appearance-card select { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 13px; padding: 10px 12px; background: var(--surface-soft); color: var(--text); font: inherit; }
.appearance-card select:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.update-banner button:disabled { opacity: .5; }

/* TechPad K13 tablet layout — retain the original phone layout. */
#scanBtn[hidden] { display: none; }
.scan-actions:has(#scanBtn[hidden]) { grid-template-columns: 1fr; }
.device-card { margin-top: 16px; padding: 20px; }
.device-card h2 { margin: 0 0 16px; font-size: 1.1rem; }
.device-card label { display: block; font-weight: 700; margin-bottom: 8px; }
.device-card select { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); color: var(--text); font: inherit; }
.device-card select:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* Touchable keypad remains available with a USB-HID Zebra connected. */
.tablet-keypad { display: grid; gap: 5px; margin: 10px 0; }
.tablet-keypad.numeric-keypad { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 420px; margin-inline: auto; }
.tablet-keypad.code-keypad { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.tablet-key { border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); color: var(--text); min-height: 47px; min-width: 0; font-size: 1.05rem; font-weight: 800; touch-action: manipulation; }
.tablet-key:active { background: var(--blue-soft); }
.tablet-key:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.tablet-key.key-action { font-size: .73rem; overflow-wrap: anywhere; background: var(--blue-soft); }
#manualDialog { width: min(96vw, 720px); }
#checkoutDialog { width: min(96vw, 520px); }
@media (max-width: 600px) {
  .tablet-keypad.code-keypad { grid-template-columns: repeat(7, minmax(0,1fr)); }
  .tablet-key { min-height: 42px; }
}
@media (orientation: landscape) and (min-width: 820px) and (min-height: 430px) {
  body.sale-active { height: 100dvh; overflow: hidden; }
  body.sale-active .app-shell {
    display: grid; grid-template-rows: auto minmax(0,1fr);
    height: 100dvh; min-height: 0; width: 100%; max-width: none;
    padding-bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom));
  }
  body.sale-active .topbar { position: relative; padding: max(8px, env(safe-area-inset-top)) 16px 7px; }
  body.sale-active .topbar h1 { font-size: 1.35rem; }
  body.sale-active .brand-mark { height: 36px; width: 36px; }
  body.sale-active .main-content { min-height: 0; overflow: hidden; padding: 0 10px 8px; }
  body.sale-active #view-sale.active {
    position: relative; display: grid; height: 100%; min-height: 0;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    grid-template-rows: minmax(0,1fr) auto auto;
    gap: 8px;
  }
  body.sale-active .sale-products-panel {
    grid-column: 1; grid-row: 1 / 4; min-height: 0;
    display: flex; flex-direction: column; overflow: hidden; padding: 10px;
  }
  body.sale-active .cart-scroller { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; }
  body.sale-active .quick-products { grid-column: 2; grid-row: 1; min-height: 0; margin: 0; overflow-y: auto; padding: 10px; }
  body.sale-active .quick-products-head { grid-template-columns: 1fr; gap: 4px; }
  body.sale-active .quick-product-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
  body.sale-active .scan-actions { grid-column: 2; grid-row: 2; margin: 0; padding: 7px; }
  body.sale-active .scan-action { min-height: 51px; padding: 6px; }
  body.sale-active .payment-panel { grid-column: 2; grid-row: 3; margin: 0; padding: 9px; }
  body.sale-active .checkout-btn { min-height: 60px; }
  body.sale-active .total-block strong { font-size: clamp(1.15rem,2.8vw,1.8rem); }
  body.sale-active #scanFeedback { position: absolute; top: 0; right: 12px; margin: 0; pointer-events: none; font-size: .72rem; max-width: 40%; text-align: right; }
  body.sale-active .bottom-nav { width: 100%; max-width: none; }
}

/* Manual tablet orientation controls. No CSS rotation of the user interface. */
.topbar { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.topbar-copy { min-width: 0; }
.orientation-quick {
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 44px;
  padding: 6px 11px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: .9rem;
  font-weight: 800;
  touch-action: manipulation;
  white-space: nowrap;
}
.orientation-quick:active { background: var(--blue-soft); }
.orientation-quick:focus-visible,
.orientation-card button:focus-visible,
.orientation-card select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.orientation-card { margin-top: 16px; padding: 20px; }
.orientation-card h2 { margin: 0 0 16px; font-size: 1.1rem; }
.orientation-card label { display: block; margin-bottom: 8px; font-weight: 700; }
.orientation-card select {
  width: 100%; min-height: 48px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft);
  color: var(--text); font: inherit;
}
.orientation-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.orientation-notice {
  position: fixed; z-index: 50;
  top: max(68px, env(safe-area-inset-top)); right: 10px; left: 10px;
  width: min(600px, calc(100% - 20px)); margin: 0 auto;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--text);
  box-shadow: 0 12px 32px rgba(15,23,42,.24);
}
.orientation-notice[hidden], #orientationFullscreenBtn[hidden] { display: none; }
.orientation-notice p { margin: 0; font-size: .85rem; line-height: 1.4; }
.orientation-notice-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; flex-wrap: wrap; }
.orientation-notice-actions button { min-height: 42px; }
@media (max-width: 540px) {
  .orientation-quick { padding: 6px 10px; font-size: 1.25rem; }
  .orientation-quick span { display: none; }
  .topbar { gap: 6px; }
  .topbar h1 { font-size: 1.25rem; }
}

/* Bulk price directory and numeric capture on Zebra-connected tablets. */
.scan-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.scan-action.bulk-action { background: var(--surface); color: var(--green); border: 1px solid var(--line); }
.bulk-dialog { width: min(96vw, 690px); max-height: min(94dvh, 860px); overflow-y: auto; }
.bulk-search-label { display: block; margin-bottom: 14px; font-weight: 750; }
.bulk-search-label input { display: block; width: 100%; margin-top: 6px; }
.bulk-product-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; max-height: min(28dvh,230px); overflow: auto; padding: 2px; }
.bulk-product-btn { min-width: 0; min-height: 68px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); color: var(--text); padding: 10px; display: grid; gap: 4px; text-align: center; align-content: center; }
.bulk-product-btn strong { font-size: .88rem; overflow-wrap: anywhere; }
.bulk-product-btn span { color: var(--green); font-weight: 900; }
.bulk-product-btn.active, .bulk-product-btn:focus-visible { border: 2px solid var(--green); background: var(--green-soft); }
.bulk-sale-panel { padding: 12px 0; display: grid; gap: 9px; }
.bulk-sale-panel[hidden], .bulk-product-grid[hidden], #bulkEmpty[hidden], .stock-shortage-warning[hidden] { display: none; }
.bulk-sale-panel h3 { margin: 0; font-size: 1.2rem; }
.bulk-sale-panel p { margin: 0; }
.bulk-mode-buttons { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
.bulk-mode { min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); color: var(--text); font-size: .81rem; font-weight: 800; }
.bulk-mode.active { border: 2px solid var(--green); background: var(--green-soft); }
#bulkValueLabel { display: block; font-weight: 700; }
#bulkValue { display: block; margin-top: 5px; width: 100%; min-height: 46px; }
.bulk-total-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 800; }
.bulk-total-row strong { color: var(--green); font-size: 1.35rem; }
.bulk-cart-tag { font-size: .75rem; font-weight: 850; color: var(--green); }
.stock-shortage-warning { padding: 12px; border: 1px solid var(--danger); border-radius: 12px; background: var(--surface-soft); margin: 10px 0; }
.stock-shortage-warning strong { color: var(--danger); }
.stock-shortage-warning p { margin: 4px 0; font-size: .82rem; }
@media (max-width: 480px) {
  .scan-actions { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .scan-actions .bulk-action { grid-column: 1 / -1; min-height: 56px; }
  .bulk-product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .bulk-mode { font-size: .71rem; }
}
@media (orientation: landscape) and (min-width: 820px) and (min-height: 430px) {
  body.sale-active .scan-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  body.sale-active .scan-action { font-size: .75rem; min-height: 50px; gap: 4px; padding: 5px 4px; }
  body.sale-active .scan-icon { font-size: 1.2rem; }
}

/* Sale history: touch-friendly, keyboard accessible, and read-only line details. */
.recent-sales-card .section-title-row { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.sale-history-helper { margin: 4px 0 0; }
.sales-history-toggle { padding: 10px 12px; font-size: .81rem; flex-shrink: 0; }
.sales-load-more { width: 100%; margin-top: 12px; }
.sales-load-more[hidden] { display: none; }
.sale-history-entry {
  width: 100%; min-height: 70px; align-items: center; text-align: left;
  background: transparent; color: var(--text); border: 0;
  border-top: 1px solid var(--line); padding: 12px 5px;
  font: inherit; cursor: pointer; border-radius: 9px; touch-action: manipulation;
}
.sale-history-entry:hover { background: var(--surface-soft); }
.sale-history-entry:active { background: var(--blue-soft); }
.sale-history-entry:focus-visible, .sales-history-toggle:focus-visible, .sales-load-more:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px;
}
.sale-history-description { min-width: 0; display: grid; gap: 4px; }
.sale-history-description .item-name { overflow-wrap: anywhere; }
.sale-history-description .item-meta { display: block; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.sale-history-summary { flex: 0 0 auto; display: grid; gap: 4px; text-align: right; }
.sale-history-hint { font-size: .72rem; color: var(--blue); font-weight: 750; }
.sale-detail-dialog { width: min(calc(100% - 20px), 670px); max-height: calc(100dvh - 20px); overflow-y: auto; }
.sale-detail-date { margin: -4px 0 16px; font-size: .84rem; color: var(--muted); }
.sale-detail-info { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-bottom: 18px; }
.sale-detail-field { background: var(--surface-soft); border-radius: 12px; padding: 10px; display: grid; gap: 5px; min-width: 0; }
.sale-detail-field span { font-size: .73rem; color: var(--muted); }
.sale-detail-field strong { font-size: .83rem; overflow-wrap: anywhere; }
.sale-detail-subtitle { font-size: 1.03rem; margin: 14px 0 8px; }
.sale-detail-items { display: grid; }
.sale-detail-product { border-top: 1px solid var(--line); padding: 12px 0; display: flex; align-items: start; gap: 12px; justify-content: space-between; }
.sale-detail-product-description { display: grid; gap: 5px; min-width: 0; }
.sale-detail-product-description strong { overflow-wrap: anywhere; }
.sale-detail-product-description small { font-size: .74rem; color: var(--muted); }
.sale-detail-product-description span { font-size: .85rem; }
.sale-detail-product-total { text-align: right; white-space: nowrap; }
.sale-detail-totals { border-top: 2px solid var(--line); padding: 12px 0; display: grid; gap: 10px; }
.sale-detail-total-row { display: flex; justify-content: space-between; gap: 15px; font-size: .88rem; }
.sale-detail-total-row.primary { font-size: 1.1rem; font-weight: 900; color: var(--green); }
.sale-detail-exceptions { border: 1px solid var(--line); border-left: 3px solid var(--orange); background: var(--surface-soft); padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; font-size: .82rem; }
.sale-detail-exceptions[hidden] { display: none; }
.sale-detail-exceptions p { margin: 6px 0 0; }
@media (max-width: 460px) {
  .sale-detail-info { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sale-detail-product { gap: 7px; }
  .sale-detail-product-total { font-size: .86rem; }
}

/* Dedicated price changes: large touch controls and keyboard-wedge input. */
.page-heading .page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-heading .page-actions button { min-height: 46px; white-space: nowrap; }
.quick-price-dialog { width: min(96vw, 670px); max-height: min(96dvh, 900px); overflow-y: auto; }
.quick-price-dialog .modal-intro { line-height: 1.5; color: var(--muted); }
.quick-price-dialog form { margin: 10px 0; }
.quick-price-dialog input { width: 100%; }
.quick-price-dialog .tablet-keypad.code-keypad { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 5px; }
.quick-price-selected { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--surface-soft); margin: 14px 0; }
.quick-price-selected[hidden] { display: none; }
.quick-price-product { display: grid; gap: 6px; }
.quick-price-product strong { font-size: 1.06rem; overflow-wrap: anywhere; }
.quick-price-product small { color: var(--muted); }
.quick-price-product span { color: var(--green); font-weight: 900; font-size: 1.08rem; }
#quickPriceStatus { min-height: 19px; font-weight: 700; }
#quickPriceError:empty { display: none; }
@media (max-width: 570px) {
  .quick-price-dialog .tablet-keypad.code-keypad { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .page-heading .page-actions button { font-size: .79rem; padding: 9px; }
}

/* Shared POS keyboard: works in dialogs and ordinary views without invoking Android Gboard. */
.pos-virtual-keyboard {
  position: fixed;
  z-index: 125;
  bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom) + 6px);
  left: max(7px, env(safe-area-inset-left));
  width: min(calc(100vw - 14px), 690px);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 35px rgba(0,0,0,.25);
  max-height: min(52dvh, 340px);
  overflow-y: auto;
  touch-action: manipulation;
  overscroll-behavior: contain;
}
.pos-virtual-keyboard[hidden] { display: none; }
dialog > .pos-virtual-keyboard { bottom: 8px; z-index: 2; }
dialog.pos-vkeyboard-host { padding-bottom: min(46dvh, 275px); }
.pos-vkeyboard-heading {
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding: 0 4px 7px;
}
.pos-vkeyboard-heading strong {
  min-width: 0; font-size: .76rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pos-vkeyboard-close {
  min-height: 30px; min-width: 36px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface-soft); color: var(--text); font-size: 1.25rem;
}
#posKeyboardRows { display: grid; gap: 5px; }
.pos-vkeyboard-row { display: flex; gap: 4px; justify-content: center; width: 100%; }
.pos-vkey {
  min-width: 0; min-height: 40px; flex: 1 1 0;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: .94rem; font-weight: 800; color: var(--text);
  background: var(--surface-soft); touch-action: manipulation;
}
.pos-vkey:active { background: var(--blue-soft); }
.pos-vkey:focus-visible, .pos-vkeyboard-close:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 1px;
}
.pos-vkey-action { background: var(--blue-soft); font-size: .74rem; }
.pos-virtual-keyboard[data-layout="numeric"] {
  width: min(calc(100vw - 14px), 440px);
}
.pos-virtual-keyboard[data-layout="numeric"] .pos-vkey { min-height: 42px; font-size: 1.07rem; }
.pos-virtual-keyboard[data-layout="numeric"] .pos-vkeyboard-controls .pos-vkey { font-size: .72rem; }
@media (max-width: 540px) {
  .pos-virtual-keyboard { padding: 6px; max-height: min(53dvh, 320px); }
  .pos-vkey { min-height: 38px; font-size: .75rem; }
  .pos-vkeyboard-controls .pos-vkey { font-size: .64rem; }
}
@media (orientation: landscape) and (max-height: 530px) {
  .pos-virtual-keyboard { max-height: 48dvh; width: min(calc(100vw - 14px), 760px); }
  .pos-vkey { min-height: 34px; }
  .pos-virtual-keyboard[data-layout="numeric"] .pos-vkey { min-height: 35px; }
  dialog.pos-vkeyboard-host { padding-bottom: min(45dvh, 235px); }
}

/* Cash operations: three indicator tabs, large touch targets and legible reports. */
.indicator-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin:14px 0 17px; }
.indicator-tab { min-height:48px; padding:8px 5px; font-weight:800; border-radius:12px;
  background:var(--surface-soft); color:var(--text); border:1px solid var(--line); font-size:.86rem; }
.indicator-tab.active { background:var(--blue-soft); border-color:var(--blue); color:var(--blue); }
.indicator-tab:focus-visible { outline:2px solid var(--blue); outline-offset:2px; }
.indicator-panel[hidden], .cash-stage-card [hidden], .cash-workflow-dialog [hidden] { display:none!important; }
.cash-stage-card { margin:14px 0; padding:18px; }
.cash-stage-card h3 { margin:4px 0 11px; font-size:1.13rem; }
.cash-shift-badge { color:var(--muted); background:var(--surface-soft); border:1px solid var(--line);
  border-radius:22px; padding:5px 11px; font-weight:800; font-size:.79rem; white-space:nowrap; }
.cash-shift-badge.active { color:var(--green); background:var(--green-soft); }
.cash-metric-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; margin:14px 0; }
.cash-metric { border-radius:14px; border:1px solid var(--line); background:var(--surface-soft);
  padding:12px; display:grid; gap:6px; }
.cash-metric small { font-size:.77rem; color:var(--muted); }
.cash-metric strong { font-size:clamp(1.05rem,3vw,1.35rem); overflow-wrap:anywhere; }
.cash-expected { padding:15px; border-radius:14px; border:2px solid var(--line);
  display:grid; gap:8px; }
.cash-expected small,.cash-expected span { color:var(--muted); font-size:.78rem; }
.cash-expected strong { color:var(--green); font-size:clamp(1.38rem,4vw,1.9rem); }
.cash-cut-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:13px 0; }
.cash-cut-actions button { min-height:52px; white-space:normal; padding:11px; line-height:1.35; }
.cash-movement-tools { margin-top:23px; border-top:1px solid var(--line); padding-top:12px; }
.cash-movement-tools h4 { margin:5px 0; }
.cash-list { display:grid; gap:2px; margin-top:12px; }
.cash-history-row { padding:11px 0; border-top:1px solid var(--line); display:flex;
  gap:12px; justify-content:space-between; align-items:center; }
.cash-history-row > div:first-child { flex:1; min-width:0; display:grid; gap:4px; }
.cash-history-row strong { overflow-wrap:anywhere; }
.cash-history-row small { color:var(--muted); font-size:.76rem; line-height:1.4; }
.cash-history-numbers { display:grid; gap:4px; text-align:right; }
.cash-history-row button { flex-shrink:0; min-height:43px; }
.cash-workflow-dialog { width:min(calc(100vw - 16px),620px); max-height:96dvh; overflow-y:auto; }
.cash-workflow-dialog label { display:grid; gap:7px; }
.cash-cut-preview { background:var(--surface-soft); border-radius:12px; padding:8px 15px; margin-bottom:14px; }
.cash-cut-expected { font-size:1.1rem; color:var(--green); }
@media (max-width:540px) {
  .indicator-tab { font-size:.74rem; }
  .cash-cut-actions { grid-template-columns:1fr; }
}

/* Cash forms have several inputs above the confirmation button. Keep the
   Aurennia keyboard IN the scrolling dialog flow, never over its submit. */
.cash-workflow-dialog.pos-vkeyboard-host { padding-bottom: 18px; }
.cash-workflow-dialog > .pos-virtual-keyboard {
  position:relative; inset:auto; left:auto; right:auto; bottom:auto;
  width:100%; max-width:100%; max-height:310px;
  margin:13px 0 0; box-shadow:none; border-color:var(--line);
}
.cash-workflow-dialog > .pos-virtual-keyboard[data-layout="numeric"] { width:100%; }
@media (orientation: landscape) and (max-height:530px) {
  .cash-workflow-dialog > .pos-virtual-keyboard { max-height:220px; }
}
