* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f4f6f9;
  color: #222;
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #1f2d3d;
  color: #fff;
  padding: 12px 20px;
}
.nav .brand { font-weight: 700; font-size: 18px; margin-right: 20px; letter-spacing: 1px; }
.nav a { color: #cdd5df; text-decoration: none; padding: 6px 10px; border-radius: 4px; }
.nav a:hover { background: #2d3e54; color: #fff; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-right select { background: #2d3e54; color: #fff; border: 1px solid #455a73; padding: 4px 8px; border-radius: 4px; }
.nav-right .user-label { color: #9aa8ba; font-size: 13px; }
.nav-right .shop-label { color: #fff; font-weight: 600; }

/* Auth pages */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #1f2d3d; margin: 0; }
.auth-card { background: #fff; padding: 32px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.2); width: 100%; max-width: 380px; }
.auth-card h1 { margin: 0 0 4px; text-align: center; color: #1f2d3d; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.auth-card label { display: flex; flex-direction: column; font-size: 14px; color: #555; gap: 4px; }
.auth-card input { padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; }
.auth-card button { padding: 12px; font-size: 15px; font-weight: 600; margin-top: 8px; }

.flash { background: #fff3cd; border: 1px solid #ffeaa7; color: #856404; padding: 10px 14px; border-radius: 4px; margin-bottom: 12px; }

/* Backup page */
.backup-section { background: #fff; padding: 20px; border-radius: 8px; margin-top: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.backup-section h3 { margin-top: 0; }
.backup-section.danger-zone { border-left: 4px solid #e74c3c; }
.backup-section .warning { background: #fdecea; padding: 10px; border-radius: 4px; color: #a94442; }
.big-btn { display: inline-block; padding: 14px 24px; font-size: 16px; text-decoration: none; }
.tips { line-height: 1.8; color: #555; }

.container { padding: 20px; max-width: 1280px; margin: 0 auto; }

h2 { margin-top: 0; }
.muted { color: #888; }

/* Buttons */
button, .primary, .danger {
  cursor: pointer;
  border: 1px solid #ccc;
  background: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 14px;
}
button:hover { background: #f0f0f0; }
.primary { background: #2d7ef7; color: #fff; border-color: #2d7ef7; }
.primary:hover { background: #1c63cf; }
.danger { background: #e74c3c; color: #fff; border-color: #e74c3c; }
.danger:hover { background: #c0392b; }

/* Billing layout */
.billing-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
}
.menu-pane, .cart-pane {
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.cat { margin: 16px 0 8px; color: #555; font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.item-card {
  text-align: left;
  padding: 12px;
  border: 1px solid #e0e4ea;
  border-radius: 6px;
  background: #fafbfc;
  transition: all 0.1s;
}
.item-card:hover { background: #eaf3ff; border-color: #2d7ef7; }
.item-card .name { font-weight: 600; margin-bottom: 4px; }
.item-card .price { color: #2d7ef7; font-size: 14px; }
.item-card .unit { color: #888; font-size: 12px; font-weight: 400; }
.item-img { width: 100%; height: 80px; object-fit: cover; border-radius: 4px; margin-bottom: 6px; background: #f0f0f0; }
.item-img.placeholder { display: flex; align-items: center; justify-content: center; font-size: 28px; color: #ccc; }

.menu-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

/* Shortcut row */
.shortcut-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 16px; }
.shortcut-btn { padding: 12px 8px; border: 2px solid #d6dde7; background: #fff; border-radius: 8px; text-align: center; cursor: pointer; transition: all 0.1s; }
.shortcut-btn:hover:not(:disabled) { border-color: #2d7ef7; background: #eaf3ff; }
.shortcut-btn .lbl { font-weight: 600; font-size: 13px; color: #1f2d3d; }
.shortcut-btn .sub { font-size: 11px; color: #888; margin-top: 2px; }
.shortcut-btn.empty { background: #f4f6f9; color: #aaa; border-style: dashed; cursor: not-allowed; }
.shortcut-btn.empty .lbl, .shortcut-btn.empty .sub { color: #aaa; }
.shortcut-btn.special { border-color: #2d7ef7; background: #eaf3ff; }
.shortcut-btn.service { border-color: #e67e22; background: #fff5eb; }
.shortcut-btn.service.active { background: #e67e22; color: #fff; }
.shortcut-btn.service.active .lbl, .shortcut-btn.service.active .sub { color: #fff; }

/* Quantity popup */
.qty-presets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 10px 0; }
.qty-presets button { padding: 14px; font-size: 15px; font-weight: 600; background: #eaf3ff; border-color: #2d7ef7; color: #2d7ef7; }
.qty-presets button:hover { background: #2d7ef7; color: #fff; }

/* Service row mini button */
.mini { font-size: 11px; padding: 0 5px; margin-left: 4px; }

/* Cash received section */
.cash-section { margin-top: 16px; padding-top: 12px; border-top: 2px dashed #d6dde7; }
.cash-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.cash-preset { padding: 8px 12px; background: #eaf3ff; color: #2d7ef7; border-color: #2d7ef7; font-weight: 600; font-size: 13px; }
.cash-preset:hover { background: #2d7ef7; color: #fff; }
.cash-preset.exact { background: #d4edda; color: #155724; border-color: #28a745; }
.cash-preset.exact:hover { background: #28a745; color: #fff; }

.change-row { font-size: 16px; font-weight: 600; padding: 8px 0; }
.change-row.positive #change-amount { color: #28a745; }
.change-row.negative #change-amount { color: #e74c3c; }
.change-row.zero #change-amount { color: #155724; }
.change-row.positive { background: #d4edda; padding: 8px; border-radius: 4px; }
.change-row.negative { background: #f8d7da; padding: 8px; border-radius: 4px; }
.change-row.zero { background: #d1ecf1; padding: 8px; border-radius: 4px; }

/* GST presets */
.gst-presets { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.gst-presets .lbl { font-size: 12px; color: #888; margin-right: 4px; }
.gst-presets button { padding: 3px 10px; font-size: 12px; }
.gst-row { font-size: 13px; }

/* Cart tags */
.cart-table .tag { background: #e8f0fe; color: #2d7ef7; font-size: 10px; padding: 1px 6px; border-radius: 3px; margin-left: 4px; }
.cart-table .small { font-size: 11px; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal.hidden { display: none; }
.modal-card { background: #fff; padding: 24px; border-radius: 8px; width: 100%; max-width: 380px; }
.modal-card h3 { margin-top: 0; }
.modal-card label { display: flex; flex-direction: column; font-size: 13px; color: #555; gap: 4px; margin-bottom: 10px; }
.modal-card input, .modal-card select { padding: 8px; border: 1px solid #ccc; border-radius: 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* Profile page */
.profile-form { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.profile-grid { display: grid; grid-template-columns: 1fr 240px; gap: 24px; }
.profile-form label { display: flex; flex-direction: column; font-size: 13px; color: #555; gap: 4px; margin-bottom: 12px; }
.profile-form input, .profile-form textarea { padding: 8px; border: 1px solid #ccc; border-radius: 4px; font-family: inherit; }
.profile-form input[readonly], .profile-form textarea[readonly] { background: #f5f7fa; color: #555; }
.logo-block .logo-preview { width: 200px; height: 200px; background: #f0f0f0; border-radius: 8px; overflow: hidden; margin-bottom: 8px; }
.logo-block .logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: #aaa; }
.checkbox-row { flex-direction: row !important; align-items: center; gap: 6px; font-size: 12px; }
.warning-note { background: #fff3cd; padding: 10px 14px; border-radius: 4px; color: #856404; margin-bottom: 16px; }

.sc-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.sc-row label { margin-bottom: 0; }
.inline-radio { flex-direction: row !important; align-items: center; gap: 6px !important; font-size: 14px; color: #333 !important; }

.tile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile-grid select { padding: 8px; border: 1px solid #ccc; border-radius: 4px; }

/* Payment method buttons */
.payment-methods { display: flex; gap: 6px; margin: 12px 0; align-items: center; }
.payment-methods .lbl { font-size: 13px; color: #555; margin-right: 4px; }
.pay-btn { flex: 1; padding: 10px; font-size: 14px; font-weight: 600; background: #f4f6f9; border: 2px solid #d6dde7; color: #555; border-radius: 6px; cursor: pointer; }
.pay-btn.active { background: #2d7ef7; color: #fff; border-color: #2d7ef7; }
.pay-btn:hover:not(.active) { background: #eaf3ff; }

/* Reports page shortcuts */
.report-shortcuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 24px; }
.report-btn { display: block; padding: 16px; background: #fff; border: 2px solid #d6dde7; border-radius: 8px; text-decoration: none; color: inherit; transition: all 0.1s; }
.report-btn:hover { border-color: #2d7ef7; background: #eaf3ff; }
.report-btn .lbl { font-weight: 600; font-size: 15px; color: #1f2d3d; }
.report-btn .sub { font-size: 12px; color: #888; margin-top: 4px; }

/* Report header */
.report-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.report-actions { display: flex; gap: 8px; }
.report-actions .btn { display: inline-block; padding: 6px 12px; background: #fff; border: 1px solid #ccc; border-radius: 4px; text-decoration: none; color: #333; font-size: 14px; }
.report-actions .btn:hover { background: #f0f0f0; }
.report-footer { margin-top: 24px; text-align: center; }

/* Receipt-style table */
.receipt-style { background: #fff; padding: 24px; border-radius: 8px; max-width: 520px; margin: 0 auto; font-family: "Courier New", monospace; }
.receipt-style .rec-header { text-align: center; border-bottom: 1px dashed #000; padding-bottom: 12px; margin-bottom: 14px; }
.receipt-style .rec-header h3 { margin: 0 0 4px; }
.receipt-style .receipt-table { width: 100%; }
.receipt-style .receipt-table td { padding: 4px 0; font-size: 14px; }
.receipt-style .receipt-table td.r { text-align: right; }
.receipt-style .total-row td { border-top: 1px solid #000; padding-top: 8px; font-size: 16px; }

@media print {
  .nav, .report-shortcuts, .report-actions { display: none !important; }
}

/* Resume banner + hold modal */
.resume-banner { background: #fff3cd; padding: 8px 12px; border-radius: 4px; margin-bottom: 10px; color: #856404; font-size: 13px; }
.action-row { display: flex; gap: 8px; margin-top: 14px; }
.action-row #save-bill { flex: 1; }
.warning-btn { background: #f39c12; color: #fff; border-color: #f39c12; padding: 12px 16px; font-weight: 600; }
.warning-btn:hover { background: #d68910; }

/* Split payment */
.split-section { background: #f4f6f9; padding: 10px; border-radius: 4px; margin: 8px 0; }
.split-section .row { gap: 8px; align-items: center; }

/* Search */
.search-form { background: #fff; padding: 16px; border-radius: 8px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.search-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.search-row label { display: flex; flex-direction: column; font-size: 13px; color: #555; gap: 4px; }
.search-row input, .search-row select { padding: 6px 8px; border: 1px solid #ccc; border-radius: 4px; }

/* Badges + row states */
.badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.badge-success { background: #d4edda; color: #155724; }
.badge-danger  { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.cancelled-row { opacity: 0.55; text-decoration: line-through; }
.held-row { background: #fff8e1; }

/* Cancelled stamp on receipt */
.cancelled-stamp { color: #e74c3c; font-weight: 700; font-size: 14px; border: 2px dashed #e74c3c; padding: 4px; text-align: center; margin-top: 6px; }
.cancellation-info { font-size: 11px; color: #c0392b; border-top: 1px dashed #c0392b; margin-top: 10px; padding-top: 8px; }

/* Sales by hour bars */
.hour-table td:nth-child(3) { width: 50%; }
.hour-bar { background: linear-gradient(to right, #2d7ef7, #1c63cf); height: 18px; border-radius: 3px; }

/* ==========================================================================
   Modern POS theme — applies to billing/cart screens
   ========================================================================== */

body { background: #f5f7fa; color: #1a202c; font-size: 14px; }

/* Sticky cart + 2-column layout improvement */
.billing-layout {
  grid-template-columns: 1fr 400px;
  gap: 24px;
  align-items: start;
}
.menu-pane {
  background: #fff;
  padding: 20px 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.cart-pane {
  background: #fff;
  padding: 20px 24px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.menu-pane h2, .cart-pane h2 {
  font-size: 18px; font-weight: 700;
  color: #1a202c; margin: 0 0 12px;
}
.cat {
  margin: 18px 0 10px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Shortcut row — bigger, modern */
.shortcut-row { gap: 10px; margin-bottom: 18px; }
.shortcut-btn {
  padding: 14px 10px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  border-radius: 10px;
  transition: transform 0.05s, box-shadow 0.15s, border-color 0.15s;
}
.shortcut-btn:hover:not(:disabled) {
  border-color: #3b82f6;
  background: #f0f7ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}
.shortcut-btn .lbl { font-size: 14px; font-weight: 600; color: #1e293b; }
.shortcut-btn .sub { font-size: 11px; color: #94a3b8; margin-top: 3px; }
.shortcut-btn.special {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-color: #2563eb;
}
.shortcut-btn.special .lbl, .shortcut-btn.special .sub { color: #fff; }
.shortcut-btn.special .sub { color: #bfdbfe; }
.shortcut-btn.service {
  background: #fff;
  border-color: #f59e0b;
}
.shortcut-btn.service .lbl { color: #d97706; }
.shortcut-btn.service .sub { color: #92400e; }
.shortcut-btn.service.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.shortcut-btn.service.active .lbl, .shortcut-btn.service.active .sub { color: #fff; }

/* Menu item cards — bigger, cleaner */
.item-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.item-card {
  padding: 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  transition: transform 0.05s, box-shadow 0.15s, border-color 0.15s;
}
.item-card:hover {
  background: #fff;
  border-color: #3b82f6;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.15);
  transform: translateY(-2px);
}
.item-img { height: 90px; border-radius: 8px; }
.item-img.placeholder { font-size: 32px; color: #cbd5e1; background: #f1f5f9; }
.item-card .name { font-weight: 600; font-size: 14px; color: #1e293b; }
.item-card .price { color: #3b82f6; font-weight: 600; }
.item-card .unit { color: #94a3b8; font-weight: 400; }

/* Cart customer fields */
.cart-meta { gap: 8px; margin-bottom: 14px; }
.cart-meta input {
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.15s;
}
.cart-meta input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Cart table */
.cart-table { font-size: 13px; }
.cart-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  border-bottom: 1.5px solid #e2e8f0;
  padding: 6px 4px;
}
.cart-table td { border-bottom: 1px solid #f1f5f9; padding: 10px 4px; }
.cart-table button.qty {
  width: 26px; height: 26px; padding: 0;
  border-radius: 50%;
  font-size: 14px; font-weight: 700;
  background: #f1f5f9; border-color: #e2e8f0;
  color: #475569;
}
.cart-table button.qty:hover { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.cart-table button.remove {
  background: transparent; border-color: transparent;
  color: #cbd5e1; font-size: 18px; padding: 2px 6px;
}
.cart-table button.remove:hover { color: #ef4444; background: #fef2f2; border-radius: 4px; }
.cart-table .qty-input {
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  padding: 5px 6px;
  font-weight: 600;
  text-align: center;
}

/* Totals */
.totals { padding-top: 12px; border-top: 1.5px solid #e2e8f0; }
.totals .row {
  padding: 6px 0;
  font-size: 14px;
  color: #475569;
}
.totals .row.gst-row { font-size: 13px; color: #64748b; }
.totals .total {
  border-top: 2px solid #1e293b;
  margin-top: 10px;
  padding-top: 14px;
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
}
.totals .total span:last-child { color: #3b82f6; }

/* Payment buttons */
.payment-methods {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 14px 0 10px;
}
.payment-methods .lbl { display: none; }
.pay-btn {
  padding: 12px 4px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  color: #64748b;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}
.pay-btn:hover:not(.active) { background: #f0f7ff; border-color: #3b82f6; color: #3b82f6; }
.pay-btn.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Cash section */
.cash-section {
  margin-top: 14px;
  padding: 14px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1.5px dashed #cbd5e1;
}
.cash-section input[type="number"] {
  padding: 8px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}
.cash-presets { gap: 6px; margin: 10px 0; }
.cash-preset {
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  background: #fff;
  color: #3b82f6;
  border: 1.5px solid #bfdbfe;
}
.cash-preset:hover { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.cash-preset.exact {
  background: #d1fae5;
  color: #065f46;
  border-color: #10b981;
}
.cash-preset.exact:hover { background: #10b981; color: #fff; }
.change-row {
  margin-top: 10px;
  padding: 10px 12px !important;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
}
.change-row.positive { background: #d1fae5; color: #065f46; }
.change-row.negative { background: #fee2e2; color: #991b1b; }
.change-row.zero { background: #dbeafe; color: #1e40af; }

/* Action buttons at bottom */
.action-row { gap: 10px; margin-top: 18px; }
.action-row #save-bill {
  padding: 16px;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: 10px;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: transform 0.05s, box-shadow 0.15s;
}
.action-row #save-bill:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45); }
.warning-btn {
  padding: 16px 18px;
  border-radius: 10px;
  background: #fff;
  border: 1.5px solid #f59e0b;
  color: #d97706;
  font-weight: 600;
}
.warning-btn:hover { background: #fffbeb; }

/* Resume banner */
.resume-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1.5px solid #f59e0b;
  border-radius: 8px;
  padding: 10px 14px;
  color: #92400e;
  font-weight: 600;
  font-size: 13px;
}

/* Split section */
.split-section {
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  padding: 12px;
  border-radius: 10px;
}

/* GST preset buttons (still used in profile) */
.gst-presets button {
  background: #fff; border: 1.5px solid #e2e8f0;
  border-radius: 6px; padding: 4px 12px; font-weight: 600;
  color: #475569;
}
.gst-presets button:hover { background: #3b82f6; color: #fff; border-color: #3b82f6; }

/* Make scrollbars subtler */
.cart-pane::-webkit-scrollbar { width: 6px; }
.cart-pane::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.cart-pane::-webkit-scrollbar-track { background: transparent; }

/* ===== USA POS Layout ===== */
.pos-layout {
  display: grid;
  grid-template-columns: 200px 1fr 400px;
  gap: 16px;
  align-items: start;
}

/* Tickets sidebar */
.tickets-sidebar {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.sidebar-h { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: #64748b; font-weight: 700; margin: 0 0 12px; }
.ticket-row {
  display: block;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 6px;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
}
.ticket-row:hover { border-color: #3b82f6; background: #eff6ff; }
.ticket-row.active { background: #dbeafe; border-color: #3b82f6; }
.ticket-id { font-weight: 700; color: #1e293b; }
.ticket-info { font-size: 12px; color: #64748b; margin-top: 2px; }
.ticket-info small { display: block; color: #94a3b8; font-size: 11px; margin-top: 2px; }

/* Category tabs */
.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 14px;
  border-bottom: 1.5px solid #e2e8f0;
}
.cat-tab {
  background: transparent;
  border: none;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 14px;
  color: #64748b;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1.5px;
}
.cat-tab:hover { color: #1e293b; background: #f1f5f9; border-radius: 6px 6px 0 0; }
.cat-tab.active { color: #1e293b; border-bottom-color: #3b82f6; }

/* Colored item tiles (USA POS style) */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.pos-tile {
  aspect-ratio: 1;
  border: none;
  border-radius: 12px;
  padding: 12px;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  transition: transform 0.05s, box-shadow 0.15s;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.pos-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18); }
.pos-tile:active { transform: translateY(0); }
.pos-tile .tile-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.6;
  z-index: 0;
}
.pos-tile .tile-name {
  position: relative; z-index: 1;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}
.pos-tile .tile-price {
  position: relative; z-index: 1;
  font-weight: 600;
  font-size: 14px;
}
.pos-tile .tile-unit { font-weight: 400; opacity: 0.85; font-size: 11px; }

/* Category pill (used in category manager) */
.cat-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* Ticket header */
.ticket-header {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid #e2e8f0;
  margin-bottom: 12px;
}
.ticket-num { font-weight: 800; font-size: 18px; color: #0f172a; }

/* Action row above payment */
.action-row-top { display: flex; gap: 8px; margin-top: 8px; }
.secondary-btn {
  flex: 1;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  color: #475569;
  font-weight: 600;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
}
.secondary-btn:hover { background: #f1f5f9; border-color: #cbd5e1; }

/* Big bottom charge bar */
.charge-bar {
  display: flex; gap: 10px; margin-top: 14px;
  padding-top: 14px; border-top: 1.5px solid #e2e8f0;
  position: sticky; bottom: 0; background: #fff;
}
.charge-btn {
  flex: 1;
  padding: 18px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
  transition: transform 0.05s, box-shadow 0.15s;
}
.charge-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(16, 185, 129, 0.45); }
.charge-btn .charge-label { font-size: 12px; opacity: 0.9; text-transform: uppercase; letter-spacing: 1px; }
.charge-btn .charge-amt { font-size: 22px; font-weight: 800; }

/* Number pad */
.numpad-toggle {
  margin-left: 6px; padding: 6px 10px;
  background: #fff; border: 1.5px solid #e2e8f0;
  border-radius: 6px; cursor: pointer; font-size: 14px;
}
.numpad-toggle:hover { background: #f1f5f9; }
.numpad-card { max-width: 320px; }
.numpad-display {
  background: #0f172a; color: #10b981;
  padding: 14px 16px; border-radius: 8px;
  font-family: "Courier New", monospace;
  font-size: 28px; font-weight: 700;
  text-align: right;
  margin-bottom: 14px;
}
.numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.np {
  padding: 18px;
  font-size: 20px;
  font-weight: 700;
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  color: #1e293b;
}
.np:hover { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.np-clear { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.np-clear:hover { background: #ef4444; color: #fff; border-color: #ef4444; }

/* Discount type tabs */
.disc-type-tabs {
  display: flex; gap: 4px;
  background: #f1f5f9; border-radius: 8px; padding: 4px;
  margin-bottom: 12px;
}
.disc-type {
  flex: 1; padding: 10px;
  background: transparent; border: none;
  font-weight: 600; cursor: pointer;
  border-radius: 6px; color: #64748b;
}
.disc-type.active { background: #fff; color: #1e293b; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* Line discount button */
.line-disc {
  background: #fef3c7; color: #92400e;
  border: 1px solid #fde68a;
  font-weight: 600;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 4px;
}
.line-disc:hover { background: #f59e0b; color: #fff; border-color: #f59e0b; }

/* Drag handle */
.drag-handle {
  cursor: grab;
  width: 30px;
  text-align: center;
  font-size: 18px;
  color: #94a3b8;
  user-select: none;
}
.drag-handle:active { cursor: grabbing; }

/* Variant editor */
.variants-card { max-width: 480px; }
.variants-table { width: 100%; border-collapse: collapse; }
.variants-table th { font-size: 12px; font-weight: 600; color: #64748b; text-align: left; padding: 6px 4px; border-bottom: 1px solid #e2e8f0; }
.variants-table td { padding: 6px 4px; }
.variants-table input { padding: 6px 8px; border: 1.5px solid #e2e8f0; border-radius: 6px; width: 100px; font-size: 14px; }
.variants-table .v-del { padding: 4px 10px; font-size: 14px; }
.variants-btn { padding: 6px 10px; font-size: 13px; background: #f1f5f9; border: 1.5px solid #cbd5e1; color: #475569; border-radius: 6px; cursor: pointer; font-weight: 600; }
.variants-btn:hover { background: #3b82f6; color: #fff; border-color: #3b82f6; }

/* Variant-priced quick buttons in qty popup — show price prominently */
.qty-presets button.variant-priced {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff !important;
  border-color: #d97706;
}
.qty-presets button.variant-priced:hover { background: #d97706; }

/* Cash drawer page */
.cash-form { background: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 2px 8px rgba(15,23,42,0.05); margin: 16px 0 24px; }
.cash-form h3 { margin-top: 0; }
.cash-form label { display: flex; flex-direction: column; font-size: 13px; color: #475569; gap: 4px; margin-bottom: 12px; }
.cash-form input { padding: 10px 12px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 14px; }
.cash-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cash-type-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.cash-type { display: flex; cursor: pointer; }
.cash-type input { display: none; }
.cash-type span {
  flex: 1; padding: 14px; border: 2px solid #e2e8f0; border-radius: 10px;
  background: #fff; text-align: center; font-weight: 700;
  display: flex; flex-direction: column; gap: 4px; transition: all 0.15s;
}
.cash-type span small { font-weight: 400; font-size: 11px; color: #94a3b8; }
.cash-type input:checked + span {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff; border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.cash-type input:checked + span small { color: #bfdbfe; }

/* ===== Tablet portrait (820 × 1180) ===== */
@media (max-width: 1180px) {
  .pos-layout { grid-template-columns: 1fr 380px; gap: 12px; }
  .tickets-sidebar { display: none; }
}

@media (max-width: 900px) {
  /* Stack: menu on top, cart below */
  .pos-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .tickets-sidebar { display: none; }
  .cart-pane {
    position: static; max-height: none;
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.08);
  }
  /* Charge bar gets even bigger on tablet */
  .charge-btn { padding: 22px; font-size: 16px; }
  .charge-btn .charge-amt { font-size: 26px; }
  /* Bigger touch targets */
  .pay-btn { padding: 16px 4px; font-size: 14px; }
  .pos-tile { aspect-ratio: 1.1; }
  .pos-tile .tile-name { font-size: 16px; }
  .pos-tile .tile-price { font-size: 15px; }
  .shortcut-btn { padding: 16px 10px; }
  .shortcut-btn .lbl { font-size: 15px; }
  .cat-tab { padding: 14px 18px; font-size: 15px; }
  /* Numpad fills more on tablet */
  .numpad-card { max-width: 360px; }
  .np { padding: 22px; font-size: 22px; }
  .numpad-display { font-size: 32px; }
  /* Cart table cells bigger */
  .cart-table td { padding: 14px 4px; }
  .cart-table .qty-input { padding: 8px 6px; width: 60px; font-size: 15px; }
  /* Cash presets bigger */
  .cash-preset { padding: 12px 16px; font-size: 14px; }
  .change-row { font-size: 18px; padding: 14px !important; }
  /* Form inputs bigger */
  input[type=text], input[type=number], input[type=password], input[type=email],
  input[type=date], select, textarea { font-size: 16px; }  /* prevents iOS zoom-on-focus */
}

/* Phone portrait (narrow) */
@media (max-width: 600px) {
  .container { padding: 12px; }
  .shortcut-row { grid-template-columns: repeat(2, 1fr); }
  .payment-methods { grid-template-columns: repeat(2, 1fr); }
  .tile-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .cash-form-row { grid-template-columns: 1fr; }
  .cash-type-tabs { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* Menu table tweaks */
.add-form-grid { display: grid; grid-template-columns: 2fr 1.5fr 1fr 1fr 1fr auto; gap: 8px; align-items: center; }
.menu-table .img-cell { width: 80px; }
.menu-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; background: #f0f0f0; }
.menu-thumb.placeholder { display: flex; align-items: center; justify-content: center; color: #ccc; }
.img-input { width: 100%; font-size: 11px; margin-top: 4px; }

/* Receipt updates */
.receipt-header { text-align: center; margin-bottom: 12px; border-bottom: 1px dashed #000; padding-bottom: 10px; }
.receipt-logo { max-width: 80px; max-height: 80px; object-fit: contain; margin: 0 auto 6px; display: block; }
.receipt .shop-line { font-size: 11px; color: #333; line-height: 1.4; }

.cart-meta { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.cart-meta input { padding: 8px; border: 1px solid #ccc; border-radius: 4px; }

.cart-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cart-table th, .cart-table td { padding: 6px 4px; text-align: left; border-bottom: 1px solid #eee; }
.cart-table button.qty { padding: 2px 8px; margin: 0 2px; }
.cart-table button.remove { background: #f8d7da; border-color: #f5c6cb; color: #721c24; padding: 2px 8px; }

.totals { margin-top: 14px; }
.totals .row { display: flex; justify-content: space-between; padding: 4px 0; align-items: center; }
.totals .total { font-size: 18px; font-weight: 700; border-top: 2px solid #222; margin-top: 8px; padding-top: 8px; }

#save-bill { width: 100%; margin-top: 14px; padding: 12px; font-size: 16px; font-weight: 600; }

/* Forms / tables */
.add-form { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.add-form input { padding: 8px; border: 1px solid #ccc; border-radius: 4px; }

.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.data-table th, .data-table td { padding: 10px; border-bottom: 1px solid #eee; text-align: left; }
.data-table th { background: #f4f6f9; }
.data-table input[type="text"], .data-table input[type="number"] { padding: 4px 6px; width: 100%; border: 1px solid #ddd; border-radius: 3px; }

/* Reports */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.stat-card .label { color: #888; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .value { font-size: 28px; font-weight: 700; margin: 4px 0; color: #1f2d3d; }
.stat-card .sub { color: #555; font-size: 13px; }

/* Print receipt */
.print-body { background: #fff; }
.receipt { max-width: 320px; margin: 20px auto; padding: 16px; font-family: "Courier New", monospace; }
.receipt h1 { text-align: center; margin: 0 0 8px; font-size: 20px; }
.receipt .meta { font-size: 12px; margin-bottom: 12px; border-bottom: 1px dashed #000; padding-bottom: 8px; }
.receipt-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.receipt-table th, .receipt-table td { padding: 4px 2px; text-align: left; }
.receipt-table th { border-bottom: 1px solid #000; }
.receipt .totals { border-top: 1px dashed #000; margin-top: 8px; padding-top: 8px; font-size: 13px; }
.receipt .total { font-size: 16px; }
.thanks { text-align: center; margin-top: 14px; font-size: 12px; }
.actions { text-align: center; margin-top: 20px; display: flex; gap: 8px; justify-content: center; }

@media print {
  .no-print, .nav { display: none !important; }
  body { background: #fff; }
  .receipt { margin: 0; max-width: 100%; }
}
