:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-strong: #fff8f3;
  --text: #1d2420;
  --muted: #66736c;
  --line: #dfe5df;
  --primary: #9f1d2a;
  --primary-strong: #74131d;
  --secondary: #1f7a4d;
  --amber: #b7791f;
  --danger: #b42318;
  --info: #2563eb;
  --radius: 8px;
  --shadow: 0 18px 40px rgba(29, 36, 32, .08);
  --focus: 0 0 0 3px rgba(159, 29, 42, .22);
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}
a { color: var(--primary); text-decoration: none; }
button, input, select { font: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: none; box-shadow: var(--focus); }

.app-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #161b18; color: white; padding: 24px; display: flex; flex-direction: column; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--radius); background: linear-gradient(135deg, var(--primary), #d64b3a); color: #fff; font-weight: 800; }
.brand small { display: block; color: #aeb9b2; margin-top: 2px; }
.nav { display: grid; gap: 6px; }
.nav a { color: #e8eee9; padding: 12px 14px; border-radius: var(--radius); }
.nav a:hover { background: rgba(255,255,255,.08); }
.main { min-width: 0; padding: 24px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.topbar h1 { margin: 0; font-size: 28px; letter-spacing: 0; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 12px; text-transform: uppercase; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.user-chip, .status-pill { border: 1px solid var(--line); background: var(--surface); padding: 9px 12px; border-radius: 999px; font-size: 13px; }
.status-pill { color: var(--secondary); font-weight: 700; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at top left, #fff3e8, #f6f7f4 42%); }
.login-panel { width: min(460px, calc(100vw - 32px)); }
.login-card { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 14px; padding: 32px; }
.login-card h1 { margin: 24px 0 8px; font-size: 30px; }
.login-card p { color: var(--muted); }
.login-brand { color: var(--text); }
.form-stack { display: grid; gap: 16px; }
label { display: grid; gap: 7px; font-weight: 700; }
input, select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fff;
}
.hint, .muted { color: var(--muted); }
.alert { border-radius: var(--radius); padding: 12px; margin: 16px 0; }
.alert-danger { background: #fff0ed; color: var(--danger); border: 1px solid #fecdc6; }

.btn, .icon-btn {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 800;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-strong); }
.btn-ghost, .icon-btn { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-block { width: 100%; }
.btn-tall { min-height: 58px; font-size: 17px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.metric-grid.compact { margin: 0; }
.metric-card, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(29, 36, 32, .04);
}
.metric-card { padding: 18px; display: grid; gap: 8px; }
.metric-card span { color: var(--muted); font-weight: 700; }
.metric-card strong { font-size: 30px; letter-spacing: 0; }
.metric-card small { color: var(--muted); }
.metric-primary { background: #1d2420; color: white; }
.metric-primary span, .metric-primary small { color: #cdd7d0; }
.metric-card.warning { border-color: #f3d29a; background: #fffaf0; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 18px; margin-bottom: 18px; }
.panel { padding: 18px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-header h2 { margin: 0; font-size: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; background: #eef2f0; color: #415047; font-weight: 800; font-size: 12px; }
.badge-success { background: #e8f7ee; color: #17663d; }
.badge-warning { background: #fff2ce; color: #815313; }
.badge-danger { background: #ffebe8; color: #9a1f16; }
.stack-list { display: grid; gap: 10px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }

.pos-grid { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 18px; align-items: start; }
.pos-workspace, .cart-panel { display: grid; gap: 18px; }
.scan-panel, .product-section, .cart-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: 0 8px 22px rgba(29, 36, 32, .04); }
.scan-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 10px; }
.scan-row input { min-height: 58px; font-size: 22px; font-weight: 800; letter-spacing: 0; }
.compact-input { max-width: 280px; }
.no-margin { margin: 0; }
.pos-ref-strip { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: var(--muted); font-size: 13px; font-weight: 800; }
.category-rail { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; }
.category-chip { min-height: 42px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 900; cursor: pointer; white-space: nowrap; }
.category-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.product-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.product-tile { min-height: 204px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 0; text-align: left; cursor: pointer; display: grid; grid-template-rows: 104px 1fr; overflow: hidden; }
.product-tile:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: 0 14px 30px rgba(29, 36, 32, .08); }
.product-thumb { display: grid; place-items: center; background: linear-gradient(135deg, #fff3ec, #edf7ef); color: var(--primary); font-size: 30px; font-weight: 900; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-meta { display: grid; gap: 5px; padding: 12px; }
.product-meta strong { font-size: 15px; line-height: 1.2; }
.product-meta small { color: var(--muted); line-height: 1.3; }
.product-meta em { color: var(--primary); font-style: normal; font-weight: 900; }
.cart-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.cart-lines { min-height: 230px; display: grid; gap: 10px; align-content: start; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.cart-line strong { display: block; }
.cart-line small { color: var(--muted); }
.line-actions { display: flex; align-items: center; gap: 8px; }
.qty-btn { width: 34px; height: 34px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); cursor: pointer; }
.remove-line { color: var(--danger); }
.empty-cart { color: var(--muted); text-align: center; padding: 48px 12px; border: 1px dashed var(--line); border-radius: var(--radius); }
.totals { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 9px; }
.totals div { display: flex; justify-content: space-between; align-items: center; }
.total-due { font-size: 24px; font-weight: 900; color: var(--primary); }
.payment-pad { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pay-button { min-height: 54px; border: 1px solid var(--line); background: var(--surface-strong); border-radius: var(--radius); cursor: pointer; font-weight: 900; }
.pay-button.active { background: var(--secondary); color: white; border-color: var(--secondary); }
.receipt-preview { border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px; background: #fbfcfb; }
.payment-summary { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: #fbfcfb; }
.payment-summary strong { font-size: 22px; color: var(--primary); }
.payment-summary.change strong { color: var(--secondary); }
.modal { border: none; border-radius: 14px; padding: 0; width: min(440px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(0,0,0,.35); }
.modal-card { padding: 22px; display: grid; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.inline-form { display: flex; gap: 10px; align-items: center; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.product-form { display: grid; gap: 18px; }
.check-row { display: flex; flex-wrap: wrap; gap: 14px; }
.check-row label { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.check-row input { width: auto; min-height: auto; }
.mini-thumb { display: grid; place-items: center; width: 54px; height: 54px; border-radius: var(--radius); background: linear-gradient(135deg, #fff3ec, #edf7ef); color: var(--primary); font-weight: 900; overflow: hidden; }
.mini-thumb.large { width: 96px; height: 96px; }
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.current-image { display: flex; align-items: center; gap: 14px; }
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.settings-grid div { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 6px; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .nav { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .pos-grid, .content-grid { grid-template-columns: 1fr; }
  .cart-panel { position: static; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .main, .sidebar { padding: 16px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .metric-grid, .settings-grid { grid-template-columns: 1fr; }
  .scan-row, .payment-pad { grid-template-columns: 1fr; }
  .product-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-tile { min-height: 176px; grid-template-rows: 86px 1fr; }
}

@media (prefers-reduced-motion: no-preference) {
  .product-tile, .btn, .pay-button { transition: transform .16s ease, border-color .16s ease, background .16s ease; }
}

.classic-pos {
  display: grid;
  grid-template-columns: 300px 1fr;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  min-height: calc(100vh - 130px);
  background: #eef1ef;
  border: 1px solid #c8d0ca;
  border-radius: 6px;
  padding: 8px;
}
.classic-pos-header {
  grid-column: 1 / -1;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background: #fff;
  border: 1px solid #cbd4cd;
  color: #2440d8;
  font-size: 22px;
  letter-spacing: 0;
}
.order-board {
  display: grid;
  grid-template-rows: auto minmax(240px, 1fr) auto auto;
  gap: 6px;
  min-width: 0;
}
.order-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #f9faf7;
  border: 1px solid #cbd4cd;
}
.order-meta div {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 54px;
  border-right: 1px solid #d7ded8;
  font-size: 12px;
}
.order-meta div:last-child { border-right: 0; }
.order-meta span { color: #59635d; font-weight: 800; }
.order-meta strong { color: var(--primary); }
.order-lines {
  background: #fff;
  border: 1px solid #cbd4cd;
  border-radius: 0;
  padding: 6px;
  overflow-y: auto;
}
.classic-totals {
  background: #fff;
  border: 1px solid #cbd4cd;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.classic-totals div {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 52px;
  border-right: 1px solid #d7ded8;
  font-size: 12px;
}
.classic-totals div:last-child { border-right: 0; }
.classic-totals strong { color: #d62027; font-size: 13px; }
.number-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.number-pad button {
  min-height: 52px;
  border: 1px solid #444;
  border-radius: 4px;
  background: #1f2224;
  color: white;
  font-size: 24px;
  font-weight: 900;
  cursor: pointer;
}
.menu-board {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  min-width: 0;
}
.compact-scan {
  grid-column: 1 / -1;
  padding: 8px;
}
.compact-scan .scan-row input { min-height: 48px; font-size: 18px; }
.category-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 6px;
}
.category-tile {
  min-height: 46px;
  border: 1px solid #d48b2c;
  border-radius: 6px;
  background: linear-gradient(#ff9a28, #ef7615);
  color: white;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.category-tile.active,
.category-tile.misc {
  background: #fff;
  color: #1d2420;
  border-color: #cbd4cd;
}
.menu-items-panel {
  min-width: 0;
  background: #fff;
  border: 1px solid #cbd4cd;
  padding: 8px;
  overflow: hidden;
}
.classic-panel-header { margin-bottom: 8px; }
.classic-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  gap: 8px;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 4px;
}
.classic-item-button {
  min-height: 130px;
  border: 1px solid #eadb9a;
  border-radius: 7px;
  background: #fff5cc;
  color: #2a2e2b;
  padding: 6px;
  display: grid;
  grid-template-rows: 54px auto auto auto;
  gap: 4px;
  cursor: pointer;
  text-align: center;
}
.classic-item-button:hover {
  border-color: #ffca2c;
  box-shadow: 0 0 0 3px rgba(255, 202, 44, .35);
}
.classic-thumb {
  display: grid;
  place-items: center;
  border-radius: 5px;
  overflow: hidden;
  background: linear-gradient(135deg, #fff, #ffe8d3);
  color: var(--primary);
  font-weight: 900;
}
.classic-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.classic-item-button strong {
  font-size: 12px;
  text-transform: uppercase;
  line-height: 1.15;
}
.classic-item-button small {
  color: #d62027;
  font-weight: 900;
}
.classic-item-button em {
  color: #5f6a63;
  font-style: normal;
  font-size: 11px;
}
.modifier-strip,
.salsa-strip {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.modifier-strip button {
  min-height: 44px;
  border: 1px solid #dc2229;
  border-radius: 6px;
  background: linear-gradient(#ff3438, #dc151a);
  color: white;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.salsa-strip button {
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  color: white;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.salsa-strip button:nth-child(1) { background: #a53428; }
.salsa-strip button:nth-child(2) { background: #237b38; }
.salsa-strip button:nth-child(3) { background: #e2251f; }
.salsa-strip button:nth-child(4) { background: #ee8523; }
.classic-action-bar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}
.classic-action-bar button {
  min-height: 52px;
  border: 1px solid #24282a;
  border-radius: 4px;
  background: #222629;
  color: white;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}
.classic-action-bar button.green { background: linear-gradient(#20b53b, #0a8e27); }
.classic-action-bar button.red { background: linear-gradient(#ff4b42, #df1d1d); }
.classic-receipt {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: min(360px, calc(100vw - 40px));
  z-index: 10;
  background: rgba(255,255,255,.96);
}

@media (max-width: 1180px) {
  .classic-pos { grid-template-columns: 1fr; }
  .menu-board { grid-template-columns: 1fr; }
  .category-matrix { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .modifier-strip, .salsa-strip { grid-column: 1; }
}

@media (max-width: 720px) {
  .classic-action-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .classic-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; }
  .classic-pos-header { font-size: 16px; }
  .order-meta, .classic-totals { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════════════════════════
   MEAT + GROCERY POS  —  g-* design system
   ═══════════════════════════════════════════════════════════════════ */

/* Layout grid */
.g-pos {
  display: grid;
  grid-template-columns: 290px 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "bar bar" "cart menu" "acts acts";
  height: calc(100vh - 148px);
  background: #f0ebe4;
  border: 1px solid #c8bfb5;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(29,36,32,.08);
}

/* Top bar */
.g-topbar {
  grid-area: bar;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  background: #1a1f1c;
  color: #fff;
}
.g-emp { display: flex; align-items: center; gap: 12px; }
.g-emp-num { font-size: 14px; font-weight: 900; color: #e8eee9; letter-spacing: .05em; }
.g-emp-name { font-size: 13px; color: #7a9484; }
.g-topbar-right { display: flex; align-items: center; gap: 12px; }
.g-sync-badge {
  font-size: 11px; font-weight: 700; color: #4ade80;
  padding: 3px 10px;
  background: rgba(74,222,128,.12);
  border: 1px solid rgba(74,222,128,.22);
  border-radius: 999px;
}
.g-sync-badge.g-sync-offline { color: #fb923c; background: rgba(251,146,60,.12); border-color: rgba(251,146,60,.22); }
.g-topbar-time { font-size: 12px; color: #7a9484; }

/* Cart panel */
.g-cart {
  grid-area: cart;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid #ddd5cb;
  overflow: hidden;
}
.g-order-meta {
  padding: 10px;
  border-bottom: 1px solid #ede8e1;
  display: grid;
  gap: 6px;
}
.g-order-select, .g-order-ref {
  width: 100%;
  min-height: 34px;
  border: 1px solid #d8cfc5;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 13px;
  background: #faf9f7;
  color: #1d2420;
}
.g-cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.g-empty-cart {
  color: #9aaba2;
  text-align: center;
  padding: 28px 12px;
  border: 1px dashed #d8cfc5;
  border-radius: 8px;
  font-size: 13px;
  margin: 0;
}

/* Cart line (rendered by JS) */
.g-cart-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid #ede8e1;
  border-radius: 7px;
  padding: 7px 10px;
  cursor: pointer;
  background: #fff;
  transition: border-color .12s, background .12s;
  text-align: left;
}
.g-cart-line:hover { border-color: #c8a58a; background: #fdf9f6; }
.g-line-selected { border-color: #9f1d2a !important; background: #fff5f4 !important; }
.g-line-info { flex: 1; min-width: 0; }
.g-line-name { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-line-sub { color: #8fa394; font-size: 11px; }
.g-line-actions { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.g-qty-ctrl {
  width: 26px; height: 26px;
  border: 1px solid #d8cfc5; border-radius: 5px;
  background: #f5f1ec; cursor: pointer;
  font-size: 15px; font-weight: 700;
  display: inline-grid; place-items: center;
  user-select: none; transition: background .1s;
}
.g-qty-ctrl:hover { background: #e4dcd3; }
.g-line-remove { color: #9f1d2a; border-color: #f0d0cd; background: #fff5f4; }
.g-line-total { font-size: 13px; font-weight: 900; color: #1d2420; white-space: nowrap; min-width: 70px; text-align: right; }

/* Totals */
.g-totals {
  padding: 8px 12px;
  border-top: 1px solid #ede8e1;
  display: grid;
  gap: 4px;
}
.g-total-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.g-total-row span { color: #66736c; }
.g-total-row strong { font-weight: 700; }
.g-txt-green { color: #1f7a4d; }
.g-total-due-row {
  padding-top: 6px; margin-top: 3px;
  border-top: 1.5px solid #ede8e1;
}
.g-total-due-row span { font-weight: 900; font-size: 13px; color: #1a1f1c; text-transform: uppercase; letter-spacing: .04em; }
.g-total-due-row strong { font-size: 22px; font-weight: 900; color: #9f1d2a; }

/* Numpad */
.g-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 7px;
  background: #2a2f2c;
  border-top: 1px solid #1a1f1c;
}
.g-key {
  min-height: 44px;
  border: 1px solid #3a413d;
  border-radius: 5px;
  background: #343b37;
  color: #e8eee9;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  transition: background .1s;
  display: grid;
  place-items: center;
}
.g-key:hover { background: #424b46; }
.g-key:active { background: #232823; }

/* Inline sale result */
.g-sale-result {
  padding: 8px 12px;
  border-top: 1px solid #ede8e1;
  background: #faf9f7;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}
.g-sale-result strong { font-size: 12px; font-weight: 700; }
.g-sale-hint { color: #9aaba2; margin: 0; font-size: 12px; flex: 1; }
.g-held-tag {
  padding: 2px 8px;
  background: #fff2ce; color: #815313;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  white-space: nowrap;
}

/* Menu panel */
.g-menu {
  grid-area: menu;
  display: flex;
  flex-direction: column;
  background: #f8f5f1;
  min-width: 0;
  overflow: hidden;
}

/* Scan / search bar */
.g-scan-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid #e8e0d5;
}
.g-scan-input {
  flex: 1;
  min-height: 46px;
  border: 1.5px solid #d8cfc5;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 17px;
  font-weight: 700;
  background: #faf9f7;
  transition: border-color .15s;
}
.g-scan-input:focus { border-color: #9f1d2a; outline: none; box-shadow: 0 0 0 3px rgba(159,29,42,.12); }
.g-scan-btn {
  min-width: 82px;
  min-height: 46px;
  background: #9f1d2a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s;
}
.g-scan-btn:hover { background: #74131d; }

/* Category tab rail */
.g-cat-rail {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  background: #fff;
  border-bottom: 1px solid #e8e0d5;
  scrollbar-width: none;
}
.g-cat-rail::-webkit-scrollbar { display: none; }
.g-cat-tab {
  min-height: 36px;
  padding: 5px 16px;
  border: 1.5px solid #d8cfc5;
  border-radius: 999px;
  background: #fff;
  color: #4a5568;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  flex-shrink: 0;
}
.g-cat-tab:hover {
  border-color: var(--tc, #9f1d2a);
  color: var(--tc, #9f1d2a);
  background: #fdf5f5;
}
.g-cat-tab.active {
  background: var(--tc, #9f1d2a);
  color: #fff;
  border-color: var(--tc, #9f1d2a);
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

/* Category label + text filter */
.g-menu-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  gap: 10px;
  border-bottom: 1px solid #ede8e0;
}
.g-cat-label {
  font-size: 13px;
  font-weight: 800;
  color: #1d2420;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.g-text-filter {
  min-height: 32px;
  max-width: 180px;
  border: 1px solid #d8cfc5;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px;
  background: #fff;
}

/* Product grid */
.g-product-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px;
  padding: 8px 12px 12px;
  overflow-y: auto;
  align-content: start;
}

/* Product card */
.g-product-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1.5px solid #e8e0d5;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  padding: 0;
  transition: transform .13s ease, border-color .13s ease, box-shadow .13s ease;
}
.g-product-card:hover {
  transform: translateY(-2px);
  border-color: #9f1d2a;
  box-shadow: 0 6px 18px rgba(159,29,42,.14);
}
.g-product-card:active { transform: translateY(0); box-shadow: none; }
.g-product-card.g-oos { opacity: .45; filter: grayscale(.5); cursor: not-allowed; }

.g-card-thumb {
  position: relative;
  display: grid;
  place-items: center;
  height: 88px;
  background: linear-gradient(135deg, #fff5f0 0%, #f2f7f2 100%);
  overflow: hidden;
}
.g-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-card-initials { font-size: 28px; font-weight: 900; color: #9f1d2a; letter-spacing: -.02em; }
.g-kg-badge {
  position: absolute;
  top: 6px; right: 6px;
  padding: 2px 6px;
  background: #9f1d2a; color: #fff;
  border-radius: 4px;
  font-size: 10px; font-weight: 900;
  text-transform: uppercase;
}

.g-card-body { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; }
.g-card-name { font-size: 11px; font-weight: 800; text-transform: uppercase; line-height: 1.2; color: #1d2420; }
.g-card-price { font-size: 14px; font-weight: 900; color: #9f1d2a; }
.g-card-stock { font-size: 11px; color: #8fa394; }
.g-oos-text { color: #b42318; font-weight: 700; }

/* Action bar */
.g-actions {
  grid-area: acts;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 5px 7px;
  background: #1a1f1c;
  border-top: 1px solid #0d110e;
}
.g-act {
  min-height: 46px;
  border: 1px solid #3a413d;
  border-radius: 6px;
  background: #2a312d;
  color: #c8d4cc;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  letter-spacing: .04em;
  transition: background .12s;
}
.g-act:hover { background: #3a413d; }
.g-act-green { background: linear-gradient(135deg,#1f7a4d,#15603b); border-color: #1a6640; color: #fff; }
.g-act-green:hover { background: linear-gradient(135deg,#27966080,#1f7a4d); }
.g-act-amber { background: linear-gradient(135deg,#b7791f,#8a5b16); border-color: #a06b18; color: #fff; }
.g-act-amber:hover { background: linear-gradient(135deg,#c98921,#b7791f); }
.g-act-red { background: linear-gradient(135deg,#9f1d2a,#74131d); border-color: #861820; color: #fff; }
.g-act-red:hover { background: linear-gradient(135deg,#b82230,#9f1d2a); }

/* ── Product Detail Modal ─────────────────────────────────── */
.g-detail-modal { width: min(420px, calc(100vw - 32px)); }
.g-detail-card { display: grid; gap: 16px; padding: 22px; }
.g-detail-hd { display: flex; gap: 14px; align-items: flex-start; }
.g-detail-thumb {
  flex-shrink: 0;
  width: 80px; height: 80px;
  border-radius: 10px;
  background: linear-gradient(135deg,#fff5f0,#f0f7f0);
  display: grid; place-items: center;
  font-size: 24px; font-weight: 900; color: #9f1d2a;
  overflow: hidden;
}
.g-detail-thumb img { width: 100%; height: 100%; object-fit: cover; }
.g-detail-meta { flex: 1; }
.g-detail-name { margin: 0 0 4px; font-size: 17px; line-height: 1.2; }
.g-detail-cat { display: block; font-size: 11px; color: #66736c; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 5px; }
.g-detail-price { display: block; font-size: 22px; font-weight: 900; color: #9f1d2a; margin-bottom: 4px; }
.g-detail-stock { display: block; font-size: 13px; color: #66736c; }
.g-stock-zero { color: #b42318 !important; font-weight: 700; }
.g-detail-lbl { display: grid; gap: 8px; font-size: 13px; font-weight: 700; color: #4a5568; }
.g-qty-row { display: flex; gap: 8px; align-items: center; }
.g-qty-btn {
  width: 40px; height: 40px;
  border: 1.5px solid #d8cfc5; border-radius: 7px;
  background: #f5f1ec; cursor: pointer;
  font-size: 22px; font-weight: 700;
  display: grid; place-items: center;
  transition: background .1s;
}
.g-qty-btn:hover { background: #e4dcd3; }
.g-qty-inp {
  width: 72px; text-align: center;
  font-size: 20px; font-weight: 700;
  border: 1.5px solid #d8cfc5; border-radius: 7px;
  padding: 6px 4px;
  min-height: 40px;
}
.g-weight-inp {
  min-height: 48px; width: 100%;
  font-size: 22px; font-weight: 700;
  border: 1.5px solid #d8cfc5; border-radius: 8px;
  padding: 8px 14px;
}
.g-weight-inp:focus, .g-qty-inp:focus { border-color: #9f1d2a; outline: none; box-shadow: 0 0 0 3px rgba(159,29,42,.12); }
.g-btn-add { flex: 1; min-height: 48px; font-size: 16px; }

/* Split payment rows */
.split-payment-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; padding: 8px 12px;
  border: 1px solid #ede8e1; border-radius: 7px;
  margin-bottom: 6px;
}

/* Responsive */
@media (max-width: 1060px) {
  .g-pos { grid-template-columns: 260px 1fr; }
  .g-product-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
@media (max-width: 860px) {
  .g-pos {
    grid-template-columns: 1fr;
    grid-template-areas: "bar" "menu" "cart" "acts";
    height: auto;
  }
  .g-cart { border-right: none; border-top: 1px solid #ddd5cb; }
  .g-keypad { display: none; }
  .g-actions { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 560px) {
  .g-product-grid { grid-template-columns: repeat(2, 1fr); }
  .g-actions { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  .g-product-card, .g-cat-tab, .g-act, .g-scan-btn, .g-key {
    transition: transform .14s ease, border-color .14s ease, background .14s ease, box-shadow .14s ease;
  }
}
