/* ── SWICOS POS — Stylesheet ─────────────────────── */
:root {
  --bg:       #0f0f0f;
  --surface:  #161616;
  --surface2: #1e1e1e;
  --border:   #2a2a2a;
  --border2:  #333;
  --accent:   #c8a96e;
  --accent2:  #e8c98e;
  --text:     #f0ece4;
  --text2:    #a09890;
  --muted:    #8b7f71;
  --danger:   #e05c5c;
  --success:  #5cba8a;
  --warning:  #e0a050;
  --info:     #5c9ae0;
  --topbar-h: 52px;
  --bottomnav-h: 60px;
  --radius:   8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
}

/* ── TOPBAR ──────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
}
.topbar-left  { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.topbar-center { flex: 1; display: flex; justify-content: center; }
.topbar-right { display: flex; align-items: center; gap: 10px; min-width: 120px; justify-content: flex-end; }

.logo-text {
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
  color: var(--accent);
}
.branch-pill {
  background: rgba(200,169,110,0.12);
  border: 1px solid rgba(200,169,110,0.25);
  border-radius: 20px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  padding: 2px 10px;
}
.sync-dot {
  font-size: 10px;
  color: var(--success);
  cursor: help;
  transition: color .3s;
}
.sync-dot.syncing { color: var(--warning); animation: pulse .8s infinite; }
.sync-dot.offline { color: var(--danger); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* Desktop top nav */
.top-nav { display: flex; gap: 4px; }
.nav-btn {
  background: none;
  border: none;
  border-radius: var(--radius);
  color: var(--text2);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 16px;
  transition: all .15s;
}
.nav-btn:hover  { background: var(--surface2); color: var(--text); }
.nav-btn.active { background: rgba(200,169,110,0.1); color: var(--accent); }

.staff-name { font-size: 13px; color: var(--text2); }
.icon-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text2);
  cursor: pointer;
  font-size: 14px;
  padding: 5px 9px;
  transition: all .15s;
}
.icon-btn:hover { border-color: var(--danger); color: var(--danger); }

/* ── BOTTOM NAV (mobile only) ─────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottomnav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 100;
  grid-template-columns: repeat(4, 1fr);
}
.bottom-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  padding: 8px 4px;
  transition: color .15s;
}
.bottom-nav-btn .bnav-icon { font-size: 20px; }
.bottom-nav-btn.active { color: var(--accent); }

/* ── VIEWS ───────────────────────────────────────── */
.view {
  display: none;
  padding-top: var(--topbar-h);
  height: 100vh;
}
.view.active { display: flex; flex-direction: column; }

/* ── POS LAYOUT ──────────────────────────────────── */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 0;
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
}

/* ── CATALOG PANEL ───────────────────────────────── */
.catalog-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.customer-bar {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--surface);
}
.customer-search-wrap { position: relative; flex: 1; }
.customer-search {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color .2s;
}
.customer-search:focus { border-color: var(--accent); }

.customer-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  z-index: 50;
  max-height: 240px;
  overflow-y: auto;
  display: none;
}
.customer-dropdown.show { display: block; }
.cust-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.cust-item:last-child { border-bottom: none; }
.cust-item:hover { background: var(--surface); }
.cust-item .cust-name { font-weight: 500; font-size: 13px; }
.cust-item .cust-sub  { font-size: 11px; color: var(--text2); margin-top: 2px; }

.selected-customer {
  min-width: 140px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  font-size: 12px;
}
.cust-none { color: var(--muted); }
.cust-selected-name { font-weight: 500; color: var(--accent); }
.cust-selected-sub   { color: var(--text2); font-size: 11px; }

/* Category tabs */
.cat-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text2);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 14px;
  white-space: nowrap;
  transition: all .15s;
}
.cat-tab:hover  { border-color: var(--accent); color: var(--accent); }
.cat-tab.active { background: var(--accent); border-color: var(--accent); color: #0f0f0f; }

/* Product search */
.product-search-wrap { padding: 8px 16px; border-bottom: 1px solid var(--border); }
.product-search {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color .2s;
}
.product-search:focus { border-color: var(--accent); }

/* Product grid */
.product-grid {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  align-content: start;
  align-items: start;
}
.product-grid::-webkit-scrollbar { width: 4px; }
.product-grid::-webkit-scrollbar-track { background: transparent; }
.product-grid::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0;
  transition: all .15s;
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
}
.product-card:hover  { border-color: var(--accent); transform: translateY(-1px); }
.product-card:active { transform: scale(.97); }

/* Product image */
.pc-img {
  width: 100%;
  height: 160px;
  flex-shrink: 0;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #ffffff;
}
.pc-img-placeholder {
  width: 100%;
  height: 160px;
  flex-shrink: 0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0;
}

/* Card body below image — fixed height so image area is always same size */
.pc-body {
  padding: 8px 10px;
}

.pc-category {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.pc-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}
.pc-price { font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 2px; }
.pc-stock { font-size: 10px; color: var(--text2); }
.pc-stock.low { color: var(--danger); }

.loading-products { color: var(--muted); padding: 40px; text-align: center; width: 100%; grid-column: 1/-1; }

/* ── ORDER PANEL ─────────────────────────────────── */
.order-panel {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  overflow: hidden;
}

.served-by-row {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.field-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.served-select {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 7px 10px;
  outline: none;
}

/* Cart */
.cart-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.cart-list::-webkit-scrollbar { width: 3px; }
.cart-list::-webkit-scrollbar-thumb { background: var(--border2); }

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  color: var(--muted);
  font-size: 13px;
}
.cart-empty-icon { font-size: 32px; opacity: .4; }

.cart-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.ci-info  { flex: 1; }
.ci-name  { font-size: 13px; font-weight: 500; color: var(--text); }
.ci-meta  { font-size: 11px; color: var(--text2); margin-top: 2px; }
.ci-price { font-size: 13px; font-weight: 500; color: var(--accent); white-space: nowrap; }
.ci-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  padding: 0 2px;
  line-height: 1;
  transition: color .15s;
}
.ci-remove:hover { color: var(--danger); }

/* Voucher */
.voucher-row {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}
.voucher-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  padding: 7px 10px;
  outline: none;
}
.voucher-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text2);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  padding: 7px 14px;
  transition: all .15s;
}
.voucher-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Totals */
.totals-box { padding: 10px 16px; border-top: 1px solid var(--border); }
.total-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 13px;
  color: var(--text2);
}
.total-row.discount { color: var(--success); font-size: 12px; }
.total-row.grand {
  color: var(--text);
  font-size: 18px;
  font-weight: 500;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}
.total-row.grand span:last-child { color: var(--accent); }

/* Payment */
.payment-section { padding: 8px 12px; border-top: 1px solid var(--border); }
.payment-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.pay-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text2);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 4px;
  transition: all .15s;
  text-align: center;
}
.pay-btn:hover  { border-color: var(--accent); color: var(--accent); }
.pay-btn.active { background: rgba(200,169,110,0.12); border-color: var(--accent); color: var(--accent); }

.cash-input-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cash-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 10px;
  outline: none;
  min-width: 80px;
}
.cash-input:focus { border-color: var(--accent); }
.change-row {
  width: 100%;
  font-size: 12px;
  color: var(--success);
  margin-top: 4px;
}

/* Remarks */
.remarks-row { padding: 6px 12px; }
.remarks-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  padding: 7px 10px;
  outline: none;
}
.remarks-input:focus { border-color: var(--border2); }

/* Action buttons */
.action-btns {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 8px;
  padding: 10px 12px 14px;
}
.btn-clear {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text2);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 12px;
  transition: all .15s;
}
.btn-clear:hover { border-color: var(--danger); color: var(--danger); }
.btn-checkout {
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #0f0f0f;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  padding: 12px;
  transition: all .15s;
}
.btn-checkout:hover   { background: var(--accent2); }
.btn-checkout:active  { transform: scale(.98); }
.btn-checkout:disabled { opacity: .5; cursor: not-allowed; }

/* ── MOBILE CART TOGGLE BTN ──────────────────────── */
.cart-toggle-btn {
  display: none;
  position: fixed;
  bottom: calc(var(--bottomnav-h) + 16px);
  right: 16px;
  background: var(--accent);
  border: none;
  border-radius: 50px;
  color: #0f0f0f;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 12px 20px;
  z-index: 90;
  box-shadow: 0 4px 16px rgba(200,169,110,.3);
  gap: 8px;
  align-items: center;
}
.cart-badge {
  background: #0f0f0f;
  border-radius: 50%;
  width: 20px; height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
}

/* ── OTHER VIEWS ─────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.page-header h1 {
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
  flex: 1;
}
.date-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.date-nav button {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text2);
  cursor: pointer;
  padding: 4px 10px;
  font-size: 16px;
  transition: all .15s;
}
.date-nav button:hover { border-color: var(--accent); color: var(--accent); }

.btn-primary {
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #0f0f0f;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 18px;
  transition: background .15s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent2); }

.btn-secondary {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text2);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 18px;
  transition: all .15s;
}
.btn-secondary:hover { border-color: var(--text2); color: var(--text); }

.search-bar-wrap { padding: 14px 20px; }
.search-bar {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 9px 14px;
  outline: none;
  transition: border-color .2s;
}
.search-bar:focus { border-color: var(--accent); }

/* Table */
.table-wrap { padding: 0 20px; overflow-x: auto; flex: 1; overflow-y: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 500px; }
.data-table th {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--bg);
}
.data-table td {
  padding: 11px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.data-table tr:hover td { background: var(--surface2); }

/* Report cards */
.report-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px 20px;
}
.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.rc-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.rc-value { font-size: 22px; font-weight: 500; color: var(--accent); }

/* Appointment grid */
.appt-grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  align-content: start;
}
.appt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.appt-card.arrived   { border-left: 3px solid var(--success); }
.appt-card.cancelled { border-left: 3px solid var(--danger); opacity: .6; }
.appt-card.pending   { border-left: 3px solid var(--warning); }
.appt-time  { font-size: 18px; font-weight: 500; color: var(--accent); }
.appt-cust  { font-size: 13px; font-weight: 500; margin-top: 4px; }
.appt-staff { font-size: 11px; color: var(--text2); margin-top: 2px; }

/* ── MODALS ──────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 20px;
}
.modal-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 16px;
}
.modal-icon.success { background: rgba(92,186,138,.15); color: var(--success); }
.modal-amt { font-size: 28px; font-weight: 500; color: var(--accent); text-align: center; margin: 8px 0 20px; }
.modal p   { text-align: center; color: var(--text2); font-size: 13px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.form-group input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 9px 12px;
  outline: none;
  transition: border-color .2s;
}
.form-group input:focus { border-color: var(--accent); }

.modal-btns {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Txn list */
.txn-list { padding: 0 20px; overflow-y: auto; flex: 1; }
.txn-row {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  align-items: center;
}
.txn-row:hover { background: var(--surface2); }
.txn-invoice  { color: var(--accent); font-weight: 500; min-width: 120px; }
.txn-customer { flex: 1; color: var(--text2); }
.txn-method   { color: var(--text2); min-width: 70px; }
.txn-amount   { font-weight: 500; color: var(--text); min-width: 80px; text-align: right; }

/* ══════════════════════════════════════════════════
   TABLET — 768px to 1024px
════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .pos-layout {
    grid-template-columns: 1fr 320px;
  }
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    overflow-y: auto;
    max-height: calc(100vh - 200px);
  }
  /* Show image on 1024px, 1:1 ratio, card 180px */
  /* card auto height at 1024px */
  .pc-img, .pc-img-placeholder { display: flex; }
  .pc-body { padding: 6px 10px; height: auto; justify-content: center; }
  .pc-name { font-size: 11px; margin-bottom: 2px; }
  .pc-price { font-size: 12px; }
  .pc-category { font-size: 9px; margin-bottom: 2px; }
  .report-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .staff-name { display: none; }
}

/* ══════════════════════════════════════════════════
   MOBILE — below 768px
════════════════════════════════════════════════════ */
@media (max-width: 767px) {

  body { overflow: hidden; }

  /* Hide desktop top nav, show bottom nav */
  .topbar-center { display: none; }
  .bottom-nav    { display: grid; }

  /* Views take full height minus topbar + bottomnav */
  .view {
    padding-top: var(--topbar-h);
    padding-bottom: var(--bottomnav-h);
    height: 100vh;
  }

  /* POS: single column, panels slide */
  .pos-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    position: relative;
    overflow: hidden;
  }

  /* Catalog fills full width by default */
  .catalog-panel {
    position: absolute;
    inset: 0;
    border-right: none;
    transition: transform .3s ease;
    z-index: 1;
  }

  /* Order panel slides in from right */
  .order-panel {
    position: absolute;
    inset: 0;
    transition: transform .3s ease;
    transform: translateX(100%);
    z-index: 2;
  }

  /* When cart is active on mobile */
  .pos-layout.show-cart .catalog-panel { transform: translateX(-100%); }
  .pos-layout.show-cart .order-panel   { transform: translateX(0); }

  /* Show cart toggle FAB */
  .cart-toggle-btn { display: flex; }

  /* Mobile product grid */
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    padding: 10px 12px;
    overflow-y: auto;
    max-height: calc(100vh - 260px);
    -webkit-overflow-scrolling: touch;
  }
  /* No image on mobile, fixed 100px height */
  .pc-img, .pc-img-placeholder { display: none; }
  .product-card { padding: 0; height: 150px; justify-content: center; }
  .pc-body { padding: 12px 10px; height: auto; justify-content: center; }
  .pc-name { font-size: 12px; margin-bottom: 4px; }
  .pc-price { font-size: 13px; }

  /* Customer bar: stack on very small screens */
  .customer-bar { flex-wrap: wrap; gap: 8px; }
  .selected-customer { min-width: 100%; }

  /* Payment buttons: 2 columns */
  .payment-methods { grid-template-columns: repeat(2, 1fr); }

  /* Report cards: 2 columns */
  .report-cards {
    grid-template-columns: repeat(2, 1fr);
    padding: 12px;
    gap: 8px;
  }
  .rc-value { font-size: 18px; }

  /* Appointment: single column */
  .appt-grid {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  /* Form grid: single column */
  .form-grid { grid-template-columns: 1fr; }

  /* Modal full width */
  .modal { padding: 20px; border-radius: 12px; }
  .modal-amt { font-size: 24px; }

  /* Page headers smaller */
  .page-header { padding: 12px 16px; }
  .page-header h1 { font-size: 18px; }

  /* Table wrap scroll */
  .table-wrap { padding: 0 12px; }
  .search-bar-wrap { padding: 10px 12px; }
  .search-bar { max-width: 100%; }

  /* Txn list */
  .txn-list { padding: 0 12px; }
  .txn-customer { display: none; }

  /* Topbar compact */
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar-left { min-width: auto; }
  .topbar-right { min-width: auto; }
  .logo-text { font-size: 17px; }
}

/* ── Very small phones ───────────────────────────── */
@media (max-width: 380px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cat-tab { font-size: 11px; padding: 3px 10px; }
}

/* Tablet 768-1024: no image, 130px card */
@media (min-width: 768px) and (max-width: 1024px) {
  .pc-img, .pc-img-placeholder { display: none !important; }
  .product-card { height: 200px !important; justify-content: center; }
  .pc-body { display: flex; flex-direction: column; justify-content: center; padding: 12px; }
  .pc-name { font-size: 13px; margin-bottom: 4px; }
  .pc-price { font-size: 14px; }
}

/* Ensure FAB only shows on mobile */
@media (min-width: 768px) {
  .cart-toggle-btn { display: none !important; }
}

/* ── datetime icon fix — high specificity override ── */
.form-group input[type="datetime-local"],
.form-group input[type="date"],
.form-group input[type="time"],
input[type="datetime-local"],
input[type="date"],
input[type="time"] {
  color-scheme: dark;
}
.form-group input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.form-group input[type="date"]::-webkit-calendar-picker-indicator,
.form-group input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a09890' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  opacity: 1 !important;
}
.form-group input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
.form-group input[type="date"]::-webkit-calendar-picker-indicator:hover,
.form-group input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f0ece4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
}

/* ── Print Receipt ─────────────────────────────────────── */
@media print {
  /* Hide everything except the receipt */
  body > *:not(#print-receipt-wrap) { display: none !important; }
  #print-receipt-wrap { display: block !important; }

  body {
    margin: 0;
    padding: 0;
    background: #fff;
  }

  @page {
    size: 80mm auto;
    margin: 4mm;
  }
}

#print-receipt-wrap {
  display: none; /* hidden until print */
}
