:root {
  --bg: #f4f4f4;
  --card: #fff;
  --muted: #666;
  --accent: #0b5;
  --danger: #c33;
  --ink: #111;
  --warning-bg: #fff3cd;
  --warning-text: #856404;
  --warning-border: #ffc107;
  --info-bg: #d1ecf1;
  --info-text: #0c5460;
  --info-border: #17a2b8;
}

/* ===== Offline Indicator for Closing ===== */
.offline-indicator {
  background: var(--warning-bg);
  color: var(--warning-text);
  border: 1px solid var(--warning-border);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 14px;
}

.offline-badge {
  display: block;
}

/* ===== Offline Status Bar (shown when in offline mode) ===== */
.offline-status-bar {
  background: var(--warning-bg);
  color: var(--warning-text);
  border: 1px solid var(--warning-border);
  border-radius: 6px;
  padding: 8px 14px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.offline-status-bar.offline {
  background: #fff3cd;
  border-color: #ffc107;
  color: #856404;
}

.offline-status-bar .status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #856404;
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

/* ===== Pending Sync Indicator (optimistic offline edits) ===== */
.pending-sync {
  background: #fff8e1 !important;
  border-left: 3px solid #ffc107;
}

.pending-sync td:first-child {
  padding-left: 8px;
}

.pending-icon {
  color: #ff9800;
  font-weight: 700;
  font-size: 16px;
}

/* ===== Closing row ownership hints ===== */
.row-std.editable {
  cursor: pointer;
}

.row-std.not-owner {
  cursor: not-allowed;
}

.row-std.not-owner td {
  opacity: 0.6;
  background: #f7f7f7;
}

/* ===== Closing Edit Modal - Full Screen for Accessibility ===== */
#closingEditOverlay {
  place-items: stretch !important;
}

#closingEditOverlay .closing-edit-modal {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  display: flex !important;
  flex-direction: column !important;
}

#closingEditOverlay .closing-edit-modal-header {
  padding: 24px 32px !important;
  flex: 0 0 auto;
}

#closingEditOverlay .closing-edit-modal-header h3 {
  font-size: 36px !important;
  font-weight: 700 !important;
}

#closingEditOverlay .closing-edit-modal-body {
  flex: 1 1 auto !important;
  padding: 32px !important;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

#closingEditOverlay .closing-edit-modal-body .stack {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
}

#closingEditOverlay .closing-edit-modal-body .form-label {
  font-size: 28px !important;
  font-weight: 600 !important;
  margin-bottom: 12px !important;
  color: #000 !important;
}

#closingEditOverlay .closing-edit-modal-body .form-control {
  font-size: 32px !important;
  font-weight: 600 !important;
  padding: 20px 16px !important;
  min-height: 70px !important;
  border: 2px solid #999 !important;
  border-radius: 12px !important;
}

#closingEditOverlay .closing-edit-modal-body .form-control:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 4px rgba(0, 187, 85, 0.3) !important;
}

/* Cash denomination display */
#closingEditOverlay #cDenomText {
  font-size: 144px !important;
  font-weight: 700 !important;
  color: var(--accent) !important;
  display: block;
  margin-bottom: 32px;
  text-align: center;
}

#closingEditOverlay .closing-edit-modal-footer {
  flex: 0 0 auto;
  padding: 24px 32px !important;
  border-top: 2px solid #ddd !important;
}

#closingEditOverlay .closing-edit-modal-footer button {
  font-size: 24px !important;
  font-weight: 700 !important;
  padding: 18px 36px !important;
  min-height: 70px !important;
  border-radius: 12px !important;
}

#closingEditOverlay .closing-btn-delete {
  background: var(--danger) !important;
  border: 2px solid var(--danger) !important;
  color: #fff !important;
}

#closingEditOverlay .closing-btn-cancel {
  background: #f0f0f0 !important;
  border: 2px solid #999 !important;
  color: #000 !important;
}

#closingEditOverlay .closing-btn-save {
  background: var(--accent) !important;
  border: 2px solid var(--accent) !important;
  color: #fff !important;
}

/* Warning/Info styles for flash messages */
#flash.warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border: 1px solid var(--warning-border);
}

#flash.info {
  background: var(--info-bg);
  color: var(--info-text);
  border: 1px solid var(--info-border);
}

* {
  box-sizing: border-box;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  margin: 0;
  padding: 20px;
  color: var(--ink);
}

/* Center login page when unauthenticated */
body.auth-only {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

h1,
h2,
h3 {
  margin: 0 0 12px 0;
}

.container {
  max-width: 980px;
  margin: auto;
}

.card {
  background: var(--card);
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .05);
}

.pad-small {
  padding: 0 !important;
  border-radius: 0 !important;
}

.stack {
  display: grid;
  gap: 10px;
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

input,
button,
select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 14px;
}

input,
select {
  min-width: 140px;
}

button {
  cursor: pointer;
  border: 1px solid #ccc;
  background: #fafafa;
}

button.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

button.danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

button.link {
  background: transparent;
  border: none;
  color: #06c;
  padding-left: 0;
}

/* tiny variant for inline utility buttons */
button.tiny {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.right {
  margin-left: auto;
}

.error {
  background: #ffecec;
  color: #a40000;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #ffcdcd;
  font-size: 13px;
}

.success {
  background: #ecfff1;
  color: #035c2b;
  padding: 8px 10px;
  border: 1px solid #c9f2da;
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}

/* tighter top gap */
th,
td {
  border: 1px solid #ddd;
  padding: 4px 6px;
  text-align: center;
}

/* tighter cells */
tfoot td {
  font-weight: bold;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.spacer {
  flex: 1;
}

.hidden {
  display: none !important;
}

.pill {
  padding: 4px 8px;
  border-radius: 999px;
  background: #efefef;
  font-size: 12px;
}

.kbd {
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-family: monospace;
  font-size: 12px;
  background: #fff;
}

.divider {
  height: 1px;
  background: #eee;
  margin: 6px 0;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.tiny {
  font-size: 12px;
}

.nowrap {
  white-space: nowrap;
}

/* ===== Auth (login) page polish ===== */
.auth-card {
  max-width: 520px;
  width: 100%;
  margin-inline: auto;
}

.auth-hero {
  text-align: center;
}

.auth-hero .muted {
  margin-top: -4px;
}

.input-stack input {
  font-size: 16px;
  padding: 14px 12px;
}

.password-wrap {
  position: relative;
  display: grid;
}

.password-wrap input {
  padding-right: 72px;
  /* room for toggle button */
}

.pass-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
}

.auth-controls {
  justify-content: space-between;
}

/* ===== Search table tweaks ===== */
#searchTable tbody tr {
  cursor: pointer;
}

/* Double vertical size for SEARCH ITEMS rows only (stronger & explicit) */
#searchTable tbody td {
  padding-top: 16px !important;
  padding-bottom: 16px !important;
}

#searchTable tbody tr {
  line-height: 1.7 !important;
}

/* Zebra striping for SEARCH ITEMS rows — high contrast for accessibility */
#searchTable tbody tr:nth-child(odd) td {
  background: #fff !important;
}

#searchTable tbody tr:nth-child(even) td {
  background: #f0f0f0 !important;
}

#searchTable tbody td {
  background-clip: padding-box;
}

/* Right-align numeric columns in Search Items (Price + Stock if shown) */
#searchTable thead th:nth-child(3),
#searchTable tbody td:nth-child(3),
#searchTable thead th:nth-child(4),
#searchTable tbody td:nth-child(4) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  /* steadier columns */
}

/* ===== Edit mode highlight for the list panel ===== */
.edit-on {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
  border-radius: 8px;
}

/* ===== Featured slot states ===== */
.slot-empty {
  color: var(--muted);
  font-style: italic;
}

.slot-missing {
  background: #fff5f5;
  color: #a40000;
}

/* ===== Slot Picker Overlay (purely local) ===== */
#slotPickerOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  display: grid;
  place-items: center;
  z-index: 9999;
}

#slotPickerPanel {
  background: var(--card);
  width: min(880px, 92vw);
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  display: grid;
  grid-template-rows: min-content min-content 1fr min-content;
  gap: 10px;
  padding: 14px;
}

#slotPickerList {
  overflow: auto;
  border: 1px solid #eee;
  border-radius: 8px;
}

#slotPickerList table {
  margin: 0;
}

/* ===== Single-line Flash Alert Clamp (now inline in topbar) ===== */
#flash {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  padding: 8px 12px;
  max-height: calc(1.25em + 16px);
  border-radius: 8px;
  display: inline-flex;
  /* CHANGED: inline in header */
  align-items: center;
  margin-left: 8px;
}

#flash.success,
#flash.error {
  display: inline-flex;
}

/* CHANGED from block */

/* ===== POS table footer tweaks ===== */
#posTable tfoot td {
  vertical-align: middle;
}

#posTable tfoot td:last-child {
  text-align: right;
}

/* =========================================================
   Checkout table visual changes — 3 columns total
   ========================================================= */
#posTable {
  table-layout: auto;
}

/* Item column: take remaining space and align left */
#posTable thead th:nth-child(1),
#posTable tbody td:nth-child(1) {
  width: auto;
  text-align: left;
}

/* Qty column: minimal width, centered */
#posTable thead th:nth-child(2),
#posTable tbody td:nth-child(2) {
  width: 1%;
  white-space: nowrap;
  text-align: center;
}

/* Total column: minimal width, align right */
#posTable thead th:nth-child(3),
#posTable tbody td:nth-child(3) {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

/* Row hover for readability */
#posTable tbody tr {
  cursor: pointer;
}

#posTable tbody tr:hover td {
  background: #d4f0d4 !important;
}

/* Zebra striping for Cart/Checkout rows - high contrast for accessibility */
#posTable tbody tr:nth-child(odd) td {
  background: #fff;
}

#posTable tbody tr:nth-child(even) td {
  background: #f0f0f0;
}

#posTable tbody td {
  background-clip: padding-box;
  padding-top: 14px !important;
  padding-bottom: 14px !important;
}

/* =========================================================
   Qty Editor Overlay
   ========================================================= */
#qtyEditorOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  display: grid;
  place-items: center;
  z-index: 10000;
}

/* Keep panel within viewport and comfy width */
#qtyEditorPanel {
  width: min(640px, 92vw) !important;
  padding: 18px !important;
  border-radius: 10px !important;
}

#qtyHeader {
  display: flex;
  align-items: center;
  justify-content: space-between; /* Distribute buttons to corners */
  gap: 8px;
  width: 100%;
}

#btnQtyToggleDiscount {
  flex: 0 0 auto;
}

#btnQtyRemove {
  flex: 0 0 auto;
}

#qtyEditorClose {
  flex: 0 0 auto;
}

#qtyHeader button {
  white-space: nowrap;
  flex: 1; /* Allow buttons to grow and fill the space */
}

/* Qty controls */
#qtyRowControls {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  column-gap: 12px;
  align-items: center;
  width: 100%;
}

#qtyRowControls button {
  min-width: 56px;
  justify-self: center;
}

/* Input width */
#qtyEditorPanel #qtyInput {
  width: 100%;
  min-width: 160px;
  max-width: 100%;
  text-align: center;
}

/* Remove number spinners */
#qtyEditorPanel input[type="number"]::-webkit-outer-spin-button,
#qtyEditorPanel input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

#qtyEditorPanel input[type="number"] {
  -webkit-appearance: textfield !important;
  appearance: textfield !important;
  -moz-appearance: textfield !important;
}

/* Actions */
#qtyEditorPanel .stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

#qtyRowActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: auto;
}

#qtyRowActions .spacer {
  display: none !important;
}

#btnQtyCancel {
  justify-self: start;
  min-width: 120px;
}

#btnQtySave {
  justify-self: end;
  min-width: 120px;
}

/* Discount row */
#qtyRowDiscount {
  justify-content: center;
}

#qtyRowDiscount button {
  min-width: 200px;
}

/* Focus ring for accessibility */
#qtyEditorPanel:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =========================================================
   ACCESSIBILITY: Large, Easy-to-Read Qty Editor Modal
   Optimized for users with low vision / bad eyesight
   ========================================================= */

/* Modal title - large and bold */
#qtyEditorTitle {
  font-size: 28px;
  font-weight: 700;
  color: #000;
  margin: 0;
}

/* Item name - very prominent */
#qtyEditorPanel #qtyItemName {
  font-size: 26px;
  font-weight: 600;
  color: #000;
  line-height: 1.3;
}

/* Price pill - larger and more visible */
#qtyEditorPanel .pill {
  font-size: 22px;
  padding: 8px 16px;
  background: #e8e8e8;
  color: #000;
  font-weight: 600;
}

/* Quantity label */
#qtyEditorPanel label.muted.tiny {
  font-size: 20px;
  color: #333;
  font-weight: 500;
  margin-bottom: 8px;
}

/* Quantity input - extra large for easy reading */
#qtyEditorPanel #qtyInput {
  font-size: 32px;
  font-weight: 700;
  padding: 16px 12px;
  min-height: 64px;
  text-align: center;
  border: 2px solid #999;
  border-radius: 10px;
  color: #000;
  background: #fff;
}

#qtyEditorPanel #qtyInput:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 187, 85, 0.3);
}

/* Quantity control buttons (-10, -1, +1, +10) - large touch targets */
#qtyRowControls button {
  font-size: 24px;
  font-weight: 700;
  min-width: 64px;
  min-height: 60px;
  padding: 14px 18px;
  border-radius: 10px;
  border: 2px solid #bbb;
  background: #f5f5f5;
  color: #000;
  cursor: pointer;
  transition: all 0.15s ease;
}

#qtyRowControls button:hover {
  background: #e0e0e0;
  border-color: #999;
}

#qtyRowControls button:active {
  background: #d0d0d0;
  transform: scale(0.97);
}

/* Header buttons (Remove Item, Close) - large and clear */
#qtyHeader button {
  font-size: 20px;
  font-weight: 600;
  padding: 12px 20px;
  min-height: 52px;
  border-radius: 10px;
}

#btnQtyRemove {
  background: var(--danger);
  color: #fff;
  border: 2px solid var(--danger);
}

#btnQtyRemove:hover {
  background: #a52a2a;
  border-color: #a52a2a;
}

#qtyEditorClose {
  background: #f0f0f0;
  color: #000;
  border: 2px solid #999;
}

#qtyEditorClose:hover {
  background: #e0e0e0;
}

/* Discount button - prominent and easy to tap */
#btnQtyToggleDiscount {
  font-size: 22px;
  font-weight: 700;
  padding: 16px 28px;
  min-height: 60px;
  min-width: 240px;
  border-radius: 10px;
  border: 2px solid var(--danger);
}

#btnQtyToggleDiscount:hover {
  background: #a52a2a;
  border-color: #a52a2a;
}

/* Action buttons (Cancel, Save) - large and clear */
#qtyRowActions button {
  font-size: 24px;
  font-weight: 700;
  padding: 16px 32px;
  min-height: 64px;
  min-width: 140px;
  border-radius: 10px;
}

#btnQtyCancel {
  background: #f0f0f0;
  color: #000;
  border: 2px solid #999;
}

#btnQtyCancel:hover {
  background: #e0e0e0;
}

#btnQtySave {
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--accent);
}

#btnQtySave:hover {
  background: #099;
  border-color: #099;
}

/* Modal panel - FULL SCREEN for maximum accessibility */
#qtyEditorPanel {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  padding: 32px !important;
  border-radius: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important; /* Move content to top */
  box-sizing: border-box !important;
}

#qtyEditorPanel .stack {
  gap: 28px;
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
  flex: 0 0 auto !important; /* Don't grow, keep at top */
}

#qtyEditorPanel .row {
  gap: 16px;
  margin-bottom: 12px;
}

/* Move Save button to bottom */
#qtyEditorPanel #qtyRowDiscount {
  margin-top: auto !important;
  width: 100%;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

#qtyEditorPanel #btnQtySave {
  width: 100% !important;
}

/* Full-screen: Even LARGER fonts */
#qtyEditorTitle {
  font-size: 36px !important;
  font-weight: 700 !important;
}

#qtyEditorPanel #qtyItemName {
  font-size: 34px !important;
  font-weight: 600 !important;
}

#qtyEditorPanel .pill {
  font-size: 28px !important;
  padding: 12px 24px !important;
}

#qtyEditorPanel label.muted.tiny {
  font-size: 26px !important;
}

/* Giant quantity input */
#qtyEditorPanel #qtyInput {
  font-size: 48px !important;
  font-weight: 700 !important;
  padding: 24px 16px !important;
  min-height: 90px !important;
}

/* Giant quantity buttons */
#qtyRowControls button {
  font-size: 32px !important;
  font-weight: 700 !important;
  min-width: 80px !important;
  min-height: 80px !important;
  padding: 20px 24px !important;
}

/* Giant header buttons */
#qtyHeader button {
  font-size: 26px !important;
  padding: 16px 28px !important;
  min-height: 70px !important;
}

/* Giant discount button */
#btnQtyToggleDiscount {
  font-size: 28px !important;
  padding: 20px 36px !important;
  min-height: 80px !important;
  min-width: 320px !important;
}

/* Giant action buttons */
#qtyRowActions button {
  font-size: 32px !important;
  padding: 24px 48px !important;
  min-height: 90px !important;
  min-width: 180px !important;
}

/* Ensure high contrast on all text */
#qtyEditorPanel,
#qtyEditorPanel * {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =========================================================
   Payment View Layout Refinement
   ========================================================= */
.pay-left-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 85vh;
  overflow: hidden;
}

.pay-table-wrap {
  flex: 1;
  /* Occupy all free vertical space */
  overflow: auto;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 8px 8px;
  /* Rounded bottom */
  background: #fff;
}

.pay-summary-footer {
  flex: 0 0 auto;
  /* Fixed footer (now header) */
  background: #fff;
  border: 1px solid #ddd;
  border-bottom: 1px solid #eee;
  border-radius: 8px 8px 0 0;
  /* Rounded top */
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
  /* Space efficient */
}

.pay-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.2;
}

.pay-summary-row.grand {
  font-weight: 800;
  font-size: 28px;
  color: var(--accent);
  margin-top: 4px;
  padding-top: 8px;
  border-top: 2px dashed #ccc;
}

.pay-summary-row .val {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pay-summary-row.grand .val {
  color: var(--accent);
  font-size: 32px;
}

/* Discounted rows - red background for visibility */
tr.discounted td {
  color: #fff !important;
  background: #c62828 !important;
  font-weight: 600;
}

/* =========================================================
   Payment layout & controls
   ========================================================= */
#payView .grid2 {
  align-items: start;
  min-height: 0;
}

#payView .grid2>.stack {
  min-height: 0;
}

#payView .panel-left {
  display: grid;
  grid-template-rows: min-content 1fr;
  min-height: 0;
}

#payView .panel-left .scroll-y {
  overflow: auto;
  min-height: 0;
}

#payView .panel-right {
  align-content: start;
  min-height: 0;
  --pay-right-scale: 1.3;
  gap: calc(10px * var(--pay-right-scale));
}

/* NEW: segmented buttons to replace dropdown (two equal buttons) */
.pay-methods {
  width: 100%;
}

.segmented-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.segmented-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.seg-btn {
  width: 100%;
  padding: calc(10px * var(--pay-right-scale, 1)) calc(12px * var(--pay-right-scale, 1));
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #fafafa;
  font-size: 14px;
}

.seg-btn.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.change-display {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  margin-bottom: 12px;
}

.change-amount {
  font-size: 5em;
  line-height: 1.05;
  font-weight: 900;
  color: #ff0000; /* Bright Red for absolute focus */
  text-shadow:
    0 0 8px rgba(255, 0, 0, 0.4),
    0 0 24px rgba(255, 0, 0, 0.2);
  letter-spacing: 0.6px;
}

.change-display .tiny.muted {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #000;
}

.amount-wrap {
  width: 100%;
  margin-bottom: 12px;
}

.amount-wrap #payAmount {
  width: 100%;
  font-size: 24px;
  padding: calc(12px * var(--pay-right-scale, 1)) calc(14px * var(--pay-right-scale, 1));
}

/* Make GCash input match Amount Received size */
#gcashContact {
  width: 100%;
  font-size: 24px;
  padding: calc(12px * var(--pay-right-scale, 1)) calc(14px * var(--pay-right-scale, 1));
  /* keep same border/radius from base input styles */
}

/* Quick Cash Row (Restored) */
.cash-quick-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.cash-btn {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  padding: calc(10px * var(--pay-right-scale, 1)) 0;
  border-radius: 8px;
  background: #f0f0ff;
  border: 1px solid #ccd;
  cursor: pointer;
}

.cash-btn:active {
  background: #e0e0ee;
  transform: translateY(1px);
}

/* NumPad Grid */
.numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.numpad-btn {
  font-size: 22px;
  font-weight: 700;
  padding: calc(14px * var(--pay-right-scale, 1)) 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  border: 1px solid #ccc;
  cursor: pointer;
  transition: background 0.1s;
}

.numpad-btn:active {
  background: #eee;
}

.numpad-btn.danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.pay-actions {
  gap: 12px;
  margin-top: 4px;
}

.pay-actions #btnBack,
.pay-actions #btnConfirmPay {
  font-size: 24px;
  padding: calc(14px * var(--pay-right-scale, 1)) calc(20px * var(--pay-right-scale, 1));
}

@media (max-width: 420px) {
  .cash-btn {
    font-size: 18px;
    padding: 10px 14px;
  }

  .pay-actions #btnBack,
  .pay-actions #btnConfirmPay {
    font-size: 24px;
    padding: 14px 22px;
  }
}

/* ====== GCash input validation states ====== */
#gcashContact.invalid {
  border-color: #e66;
  background: #fff5f5;
}

/* ====== Transfer location input styling ====== */
#transferLocation {
  width: 100%;
  font-size: 24px;
  padding: 12px 14px;
}

#transferLocation.invalid {
  border-color: #e66;
  background: #fff5f5;
}

/* =========================================================
   ACCESSIBILITY ADD-ONS
   ========================================================= */

/* Grand Total (quoting page): bigger + green */
#grandTotal {
  font-size: 2em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Easier-to-read item rows - LARGE for low-vision accessibility */
#searchTable tbody td,
#posTable tbody td,
#summaryTable tbody td {
  font-size: 22px;
  line-height: 1.5;
  color: #000;
}

@media (max-width: 420px) {

  #searchTable tbody td,
  #posTable tbody td,
  #summaryTable tbody td {
    font-size: 18px;
  }
}

/* Payment page — Order Summary alignment: text left, numbers right */
#summaryTable thead th:nth-child(1),
#summaryTable tbody td:nth-child(1) {
  text-align: left;
}

#summaryTable thead th:nth-child(2),
#summaryTable tbody td:nth-child(2),
#summaryTable thead th:nth-child(3),
#summaryTable tbody td:nth-child(3) {
  text-align: right;
}

/* Payment page — Grand Total bigger */
#sumGrand {
  font-size: 2em;
  font-variant-numeric: tabular-nums;
}

/* Payment page — increase right panel button height */
#payView .panel-right button {
  padding-top: calc(14px * var(--pay-right-scale, 1));
  padding-bottom: calc(14px * var(--pay-right-scale, 1));
  min-height: calc(52px * var(--pay-right-scale, 1));
  line-height: 1.2;
}

/* =========================================================
   NEW: High-readability item name columns + hide subtotals in checkout
   ========================================================= */

/* Readable, left-aligned item names - accessible for low-vision */
#searchTable thead th:nth-child(2),
#searchTable tbody td:nth-child(2),
#posTable thead th:nth-child(1),
#posTable tbody td:nth-child(1),
#summaryTable thead th:nth-child(1),
#summaryTable tbody td:nth-child(1) {
  font-size: 22px;
  line-height: 1.5;
  font-weight: 500;
  text-align: left;
  white-space: normal;
  word-break: break-word;
  letter-spacing: 0.4px;
  text-transform: none;
  color: #000;
}

/* Slightly smaller on very small screens */
@media (max-width:420px) {

  #searchTable thead th:nth-child(2),
  #searchTable tbody td:nth-child(2),
  #posTable thead th:nth-child(1),
  #posTable tbody td:nth-child(1),
  #summaryTable thead th:nth-child(1),
  #summaryTable tbody td:nth-child(1) {
    font-size: 18px;
    line-height: 1.4;
  }
}

#posTable tfoot tr:nth-child(1),
#posTable tfoot tr:nth-child(2) {
  display: none;
}

/* =========================================================
   MOBILE RESPONSIVENESS FIXES
   ========================================================= */

/* Fix Top Bar Overlap and Action Button Clutter */
/* Fix Top Bar Overlap and Action Button Clutter */
@media (max-width: 600px) {
  .topbar.one-line {
    flex-wrap: wrap;
    height: auto;
    padding-bottom: 8px;
    gap: 6px;
    /* reduced gap */
  }

  /* Compact store selector */
  .store-selector .store-badge {
    padding: 6px 10px;
    font-size: 13px;
  }

  /* Force search to its own line */
  .header-search {
    order: 3;
    flex: 1 1 100%;
    min-width: 100%;
    margin-top: 4px;
  }

  /* Keep user info on the right */
  .topbar-user {
    margin-left: auto;
  }

  /* Sync button compact */
  #btnSyncAllPOS {
    min-width: auto;
    padding: 6px 10px;
  }

  /* Action buttons wrap and stretch */
  .topbar-actions {
    order: 4;
    flex: 1 1 100%;
    justify-content: space-between;
    margin-top: 8px;
    gap: 4px;
    /* Tighter gap */
  }

  .topbar-actions button {
    flex: 1;
    padding: 10px 4px;
    /* Save space */
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* POS topbar: keep buttons at content width */
  #posView .topbar-actions button {
    flex: 0 0 auto;
    width: auto;
  }
}

/* Fix Checkout Accessibility (ensure scroll on mobile) */
@media (max-width: 900px) {
  #payView {
    overflow-y: auto;
    display: block;
    /* Remove grid constraint to allow scrolling flow */
    height: 100%;
    padding-bottom: 120px;
    /* EXTRA Space for scrolling to ensure buttons clear bottom */
  }

  .pay-left-panel {
    max-height: none;
    /* Let it flow */
    height: auto;
    overflow: visible;
  }

  .pay-table-wrap {
    min-height: 150px;
    /* Ensure some visibility */
    height: auto;
    overflow: visible;
  }

  /* Sticky footer action buttons for better accessibility? 
     No, just ensure they are reachable. Sticky can block content on small screens.
     The padding-bottom: 120px on #payView helps.
  */

  .pay-actions {
    padding-bottom: 20px;
  }
}/ *   = = = = =   C o n f i r m a t i o n   O v e r l a y   = = = = =   * / 
 
 # c o n f i r m O v e r l a y   { 
 
     p o s i t i o n :   f i x e d ; 
 
     i n s e t :   0 ; 
 
     b a c k g r o u n d :   r g b a ( 0 ,   0 ,   0 ,   . 4 5 ) ; 
 
     d i s p l a y :   g r i d ; 
 
     p l a c e - i t e m s :   c e n t e r ; 
 
     z - i n d e x :   1 0 0 0 1 ; 
 
 } 
 
 
 
 # c o n f i r m P a n e l   { 
 
     b a c k g r o u n d :   v a r ( - - c a r d ,   # f f f ) ; 
 
     w i d t h :   m i n ( 4 4 0 p x ,   9 0 v w ) ; 
 
     b o r d e r - r a d i u s :   1 2 p x ; 
 
     b o x - s h a d o w :   0   1 2 p x   4 0 p x   r g b a ( 0 ,   0 ,   0 ,   . 3 5 ) ; 
 
     p a d d i n g :   2 4 p x ; 
 
     d i s p l a y :   f l e x ; 
 
     f l e x - d i r e c t i o n :   c o l u m n ; 
 
     g a p :   1 6 p x ; 
 
 } 
 
 
 
 # c o n f i r m T i t l e   { 
 
     f o n t - s i z e :   2 4 p x ; 
 
     f o n t - w e i g h t :   7 0 0 ; 
 
 } 
 
 
 
 # c o n f i r m M e s s a g e   { 
 
     f o n t - s i z e :   1 8 p x ; 
 
     c o l o r :   # 3 3 3 ; 
 
     l i n e - h e i g h t :   1 . 4 ; 
 
 } 
 
 
 
 # c o n f i r m A c t i o n s   { 
 
     d i s p l a y :   f l e x ; 
 
     j u s t i f y - c o n t e n t :   f l e x - e n d ; 
 
     g a p :   1 6 p x ; 
 
     m a r g i n - t o p :   8 p x ; 
 
 } 
 
 
 
 # c o n f i r m A c t i o n s   b u t t o n   { 
 
     f o n t - s i z e :   1 8 p x ; 
 
     f o n t - w e i g h t :   6 0 0 ; 
 
     p a d d i n g :   1 2 p x   2 4 p x ; 
 
     b o r d e r - r a d i u s :   8 p x ; 
 
     m i n - w i d t h :   1 0 0 p x ; 
 
 } 
 
 
 
 # b t n C o n f i r m C a n c e l   { 
 
     b a c k g r o u n d :   # f 0 f 0 f 0 ; 
 
     b o r d e r :   1 p x   s o l i d   # c c c ; 
 
     c o l o r :   # 3 3 3 ; 
 
 } 
 
 
 
 # b t n C o n f i r m Y e s   { 
 
     b a c k g r o u n d :   v a r ( - - d a n g e r ) ; 
 
     b o r d e r :   1 p x   s o l i d   v a r ( - - d a n g e r ) ; 
 
     c o l o r :   # f f f ; 
 
 } 
 
 