@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap");

:root {
  --bg: #2d2d2d;
  --panel: #3a3a3a;
  --ink: #111;
  --muted: #888;
  --red: #c1121f;
  --red-dark: #8b0d16;
  --cat: #4a4a4a;
  --cat-on: #9b1c1c;
  --total: #c1121f;
  --gap: 6px;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: #eee;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
button { font: inherit; cursor: pointer; border: 0; }
input, select { font: inherit; }

/* —— GİRİŞ —— */
.gate {
  height: 100%; display: grid; place-items: center;
  background: linear-gradient(160deg, #1a1a1a, #3a1014);
}
.gate-card {
  width: min(360px, 92vw); background: #fff; color: #111;
  border-radius: 14px; padding: 1.4rem;
}
.gate-logo {
  width: 52px; height: 52px; border-radius: 12px; background: var(--red);
  color: #fff; display: grid; place-items: center;
  font-family: "Barlow Condensed", sans-serif; font-size: 1.4rem; font-weight: 700;
}
.gate-card h1 { margin: .5rem 0; font-family: "Barlow Condensed", sans-serif; }
.gate-card input {
  width: 100%; padding: .75rem; font-size: 1.3rem; text-align: center;
  letter-spacing: .15em; border: 2px solid #ddd; border-radius: 8px; margin: .5rem 0;
}
#pin-btn {
  width: 100%; padding: .8rem; background: var(--red); color: #fff;
  border-radius: 8px; font-weight: 700; font-size: 1.05rem;
}
.err { color: var(--red); }

#pin-gate[hidden], #hub[hidden], #app[hidden], #panel[hidden] { display: none !important; }

/* —— HUB MENÜ —— */
.hub {
  height: 100%; height: 100dvh;
  display: flex; flex-direction: column;
  background:
    radial-gradient(ellipse at 80% 10%, rgba(193,18,31,.08), transparent 40%),
    linear-gradient(165deg, #f0eee9, #e2e0db 50%, #eceae5);
  color: #1a1a1a;
  padding: 1.25rem 1.5rem;
}
.hub-head { text-align: center; margin-bottom: 1rem; }
.hub-brand {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 2rem; font-weight: 700; letter-spacing: .06em; color: #9b1c1c;
}
.hub-head p { margin: .2rem 0 0; color: #666; font-size: .9rem; }
.hub-grid {
  flex: 1; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 168px));
  gap: 14px; align-content: center; justify-content: center;
}
.hub-tile {
  aspect-ratio: 1;
  background: #2c2c2c; color: #fff;
  border-radius: 14px; padding: 1rem .75rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .35rem; text-align: center;
  box-shadow: 0 6px 0 #141414, 0 10px 24px rgba(0,0,0,.12);
  transition: transform .1s ease, filter .15s ease;
  border: 1px solid rgba(255,255,255,.06);
}
.hub-tile strong { font-size: .95rem; font-weight: 700; }
.hub-tile small { font-size: .7rem; opacity: .65; font-weight: 500; }
.hub-tile:hover { filter: brightness(1.08); }
.hub-tile:active { transform: translateY(3px); box-shadow: 0 2px 0 #141414; }
.hub-tile .hub-ico {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,.14);
  display: grid; place-items: center;
  margin-bottom: .2rem;
  color: #fff;
}
.hub-tile .hub-ico svg {
  width: 28px; height: 28px;
  display: block;
}
.hub-tile.purple { background: linear-gradient(160deg, #7c4dff, #5e35b1); box-shadow: 0 6px 0 #3d247a, 0 10px 24px rgba(0,0,0,.12); }
.hub-tile.accent { background: linear-gradient(160deg, #e85d04, #bc4a02); box-shadow: 0 6px 0 #7c3101, 0 10px 24px rgba(0,0,0,.12); }
.hub-tile.green { background: linear-gradient(160deg, #2d6a4f, #1b4332); box-shadow: 0 6px 0 #0f2a1e, 0 10px 24px rgba(0,0,0,.12); }
.hub-tile.red { background: linear-gradient(160deg, #d00000, #9b0000); box-shadow: 0 6px 0 #5c0000, 0 10px 24px rgba(0,0,0,.12); }
.hub-foot {
  display: flex; justify-content: space-between; align-items: center;
  background: #1f1f1f; color: #ccc; padding: .55rem .85rem; border-radius: 10px;
  font-size: .8rem; margin-top: 1rem;
}
.badge {
  padding: .2rem .45rem; border-radius: 4px; font-size: .7rem; font-weight: 700;
  background: #ffe8d6; color: #9a3412;
}
.badge.online { background: #d8f3dc; color: #1b4332; }
.badge.offline { background: #ffe8d6; color: #9a3412; }
.badge.syncing { background: #dee2e6; color: #333; }

/* —— SATIŞ SHELL (FlexyPOS) —— */
.sale-shell {
  height: 100%; height: 100dvh;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) minmax(280px, 340px) 72px;
  gap: 4px;
  padding: 4px;
  background: #0d0d0d;
}

.cats {
  display: flex; flex-direction: column; gap: 4px;
  overflow: auto; scrollbar-width: thin;
}
.cat-btn {
  flex: 1 1 0;
  min-height: 56px;
  background: #3a3a3a; color: #fff;
  border-radius: 4px; font-weight: 700; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .03em;
  padding: .4rem .3rem;
  border: 1px solid #222;
}
.cat-btn.on {
  background: linear-gradient(180deg, #3a7bd5, #1e4d8c);
  box-shadow: inset 0 0 0 1px #6eb0ff55, 0 0 10px rgba(58,123,213,.35);
}

.products-zone {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background: #1a1a1a; border-radius: 4px; overflow: hidden;
}
.product-grid {
  flex: 1; min-height: 0; overflow: auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  align-content: start;
  scrollbar-width: thin;
}
.p-card {
  aspect-ratio: 1 / 1;
  width: 100%;
  min-height: 0;
  border-radius: 6px;
  padding: .4rem .3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-weight: 700;
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  gap: .25rem;
  cursor: pointer;
}
.p-card:active { filter: brightness(1.12); }
.p-card .name {
  font-size: clamp(.68rem, 1.35vw, .88rem);
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: .01em;
  max-width: 100%;
}
.p-card .price {
  font-size: clamp(.72rem, 1.4vw, .95rem);
  font-weight: 700;
  opacity: .95;
}
.p-card .pm { display: none; }
.p-card.c-blue { background: #2f5f9a; }
.p-card.c-orange { background: #6b3f2a; }
.p-card.c-green { background: #3d5c3a; }
.p-card.c-pink { background: #8a4a62; }
.p-card.c-yellow { background: #8a5a22; }
.p-card.c-cyan { background: #2a6a78; }
.p-card.c-gray { background: #4a4a4a; }
.p-card.c-red { background: #8b2e2e; }

/* —— FİŞ / SAĞ —— */
.ticket {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto auto;
  min-height: 0; background: #1e1e1e; border-radius: 4px; overflow: hidden;
}
.ticket-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: .3rem .45rem; background: #151515; gap: .4rem;
}
.mode-pill {
  background: #c1121f; color: #fff; font-weight: 800;
  padding: .3rem .65rem; border-radius: 3px;
  letter-spacing: .06em; font-size: .9rem;
}
.ticket-meta {
  display: flex; gap: .45rem; align-items: center;
  font-size: .72rem; color: #bbb;
}
.cashier-name { font-weight: 700; color: #ddd; }
.customer-bar {
  background: #111; padding: .35rem .55rem;
  font-size: .82rem; font-weight: 600; color: #ccc;
}

.note-preview {
  margin: 0; padding: .35rem .5rem;
  background: #fff8e7; color: #5c3d00;
  font-size: .75rem;
  display: flex; gap: .4rem; align-items: flex-start;
  line-height: 1.3;
}
.note-preview-label {
  flex-shrink: 0;
  background: #e85d04; color: #fff;
  font-size: .6rem; font-weight: 700;
  padding: .1rem .35rem; border-radius: 3px;
  text-transform: uppercase;
}
.note-live {
  margin-top: .5rem; padding: .55rem .65rem;
  background: #fff8e7; border: 1px dashed #e0b84e;
  border-radius: 8px; color: #5c3d00; font-size: .9rem;
}
.opt-section { margin: .75rem 0; }
.opt-label {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: #666; margin-bottom: .45rem;
}
.opt-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
}
.opt-chip {
  display: flex; align-items: center; justify-content: center;
  min-height: 56px; border-radius: 12px;
  border: 2px solid #ddd; background: #f5f5f5;
  font-weight: 800; font-size: 1.05rem; cursor: pointer;
  position: relative; padding: .5rem;
}
.opt-chip input {
  position: absolute; opacity: 0; pointer-events: none;
}
.opt-chip:has(input:checked) {
  border-color: #c1121f;
  background: #fff5f5;
  color: #9b1c1c;
  box-shadow: inset 0 0 0 1px #c1121f;
}
#dlg-ekmek { width: min(420px, 94vw); }

.cart-list {
  list-style: none; margin: 0; padding: 0;
  overflow: auto; background: #fff; color: #111;
  min-height: 0; scrollbar-width: thin;
}
.cart-list li {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: .3rem; align-items: start;
  padding: .4rem .5rem;
  border-bottom: 1px solid #e5e5e5;
  font-size: .86rem;
}
.cart-list li.sel { background: #ffe8e8; outline: 1px solid #c1121f55; }
.cart-list li.empty {
  display: block; text-align: center; color: #999;
  padding: 2rem .5rem; border: 0; font-size: .85rem;
}
.cart-list .qty { font-weight: 800; }
.cart-list .line-amt { font-weight: 700; white-space: nowrap; }
.cart-list .note { display: block; font-size: .72rem; color: #666; margin-top: 2px; }

.total-wrap {
  display: flex; justify-content: center; align-items: center;
  background: #c1121f; color: #fff;
  padding: .55rem .75rem;
  min-height: 52px;
}
.total-wrap strong {
  font-size: 1.85rem; font-weight: 800; letter-spacing: .02em;
  color: #fff;
}

.pay-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px; padding: 4px; background: #121212;
}
.pay-big {
  min-height: 48px;
  border-radius: 4px;
  font-weight: 700;
  font-size: .88rem;
  color: #fff;
  background: #3a3a3a;
  border: 1px solid #222;
}
.pay-big:active { filter: brightness(1.15); }
.pay-big.cash { background: #2d2d2d; }
.pay-big.card { background: #2d2d2d; }
.pay-big.meal { background: #2d2d2d; }
.pay-big.split { background: #2d2d2d; grid-column: 1 / -1; min-height: 42px; }

/* İnce sağ araç şeridi */
.tool-rail {
  display: flex; flex-direction: column; gap: 3px;
  overflow: auto; scrollbar-width: none;
}
.tool-rail button {
  flex: 0 0 auto;
  min-height: 52px;
  background: #2a2a2a; color: #ddd;
  border-radius: 4px; border: 1px solid #1a1a1a;
  font-size: .65rem; font-weight: 700; line-height: 1.2;
  padding: .35rem .2rem; text-align: center;
}
.tool-rail button:active { background: #444; }
#btn-qty-plus { font-size: 1.2rem; color: #7dffb3; }
#btn-qty-minus { font-size: 1.2rem; color: #ff8a8a; }
#btn-remove { color: #ffb4b4; }

.status-ok { color: #1b7f4e; font-weight: 700; }
.status-warn { color: #c1121f; font-weight: 700; }
.close-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }
.close-actions button {
  padding: .7rem 1.1rem; border-radius: 10px; font-weight: 700; border: 0; cursor: pointer;
}
.close-actions .primary { background: #c1121f; color: #fff; }
.close-actions .ghost { background: #eee; color: #333; }

.keypad-pay { display: none; }
.pay-col, .pay-btn, .total-bar { display: none; }
.ticket-tools, .cart-actions, .branch-bar { display: none !important; }

/* —— PANEL —— */
.panel-shell {
  height: 100%; height: 100dvh;
  display: flex; flex-direction: column;
  background: #e9e9e9; color: #111;
}
.panel-top {
  display: flex; justify-content: space-between; align-items: center;
  gap: .75rem; flex-wrap: wrap;
  background: #333; color: #fff; padding: .6rem .9rem;
}
.panel-top h2 { margin: 0; font-size: 1.1rem; font-family: "Barlow Condensed", sans-serif; }
.panel-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.panel-actions button, .panel-actions input {
  padding: .45rem .7rem; border-radius: 4px; border: 0;
}
.panel-actions button { background: #fff; color: #111; font-weight: 600; }
#panel-back { background: var(--red); color: #fff; }
.panel-body {
  flex: 1; min-height: 0; overflow: auto; padding: .75rem;
  display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-content: start;
}
.panel-body:has(.mgmt-wrap) {
  display: flex;
  flex-direction: column;
  grid-template-columns: none;
}
.report-box {
  background: #fff; border: 1px solid #ccc; border-radius: 4px; overflow: hidden;
}
.report-box h3 {
  margin: 0; background: var(--red); color: #fff;
  padding: .45rem .65rem; font-size: .9rem; letter-spacing: .03em;
}
.report-box .rows { padding: .35rem .65rem; }
.report-box .row {
  display: flex; justify-content: space-between; gap: .5rem;
  padding: .35rem 0; border-bottom: 1px dashed #ddd; font-size: .92rem;
}
.report-box .row.strong { font-weight: 800; border-bottom: 0; margin-top: .25rem; color: var(--red); }
.admin-list { list-style: none; margin: 0; padding: 0; }
.admin-list li {
  display: flex; justify-content: space-between; gap: .5rem; align-items: center;
  padding: .5rem; border-bottom: 1px solid #eee; background: #fff;
}
.admin-list button { padding: .3rem .5rem; background: #eee; border-radius: 4px; margin-left: .25rem; }

/* Ürün yönetimi — satış gibi kare + sürükle */
.mgmt-wrap {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; gap: .75rem;
  min-height: 0;
}
.mgmt-toolbar {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  background: #fff; border: 1px solid #ddd; border-radius: 10px; padding: .65rem .75rem;
}
.mgmt-toolbar button {
  padding: .55rem .9rem; border-radius: 8px; border: 0; font-weight: 700; cursor: pointer;
  background: #333; color: #fff;
}
.mgmt-toolbar button.primary { background: #c1121f; }
.mgmt-toolbar button.ok { background: #1b4332; }
.mgmt-toolbar select {
  padding: .5rem .65rem; border-radius: 8px; border: 1px solid #ccc; min-width: 140px;
}
.mgmt-hint { font-size: .82rem; color: #666; margin: 0; flex: 1; min-width: 180px; }
.mgmt-board {
  background: #2a2a2a;
  border-radius: 12px;
  padding: 12px;
  min-height: 320px;
}
.mgmt-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.mgmt-card {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  padding: .5rem .4rem;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center;
  cursor: grab;
  border: 2px solid rgba(255,255,255,.35);
  box-shadow: 0 4px 0 rgba(0,0,0,.25);
  color: #111;
  font-weight: 700;
  position: relative;
  user-select: none;
  touch-action: none;
}
.mgmt-card:active { cursor: grabbing; }
.mgmt-card.dragging { opacity: .45; transform: scale(.96); }
.mgmt-card.drag-over { outline: 3px dashed #fff; outline-offset: 2px; }
.mgmt-card .name {
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(.7rem, 1.4vw, .92rem);
  text-transform: uppercase;
  line-height: 1.15;
}
.mgmt-card .price { font-size: .95rem; font-weight: 800; margin-top: .3rem; }
.mgmt-card .edit-fab {
  position: absolute; top: 6px; right: 6px;
  width: 28px; height: 28px; border-radius: 8px;
  border: 0; background: rgba(0,0,0,.45); color: #fff;
  font-size: .85rem; font-weight: 700; cursor: pointer;
}
.mgmt-card.c-blue { background: #3a7bd5; color: #fff; }
.mgmt-card.c-orange { background: #6b3f2a; color: #fff; }
.mgmt-card.c-green { background: #3d5c3a; color: #fff; }
.mgmt-card.c-pink { background: #f2a7c3; color: #111; }
.mgmt-card.c-yellow { background: #c47a2c; color: #fff; }
.mgmt-card.c-cyan { background: #48cae4; color: #111; }
.mgmt-card.c-gray { background: #e8e8e8; color: #111; }
.mgmt-card.c-red { background: #e63946; color: #fff; }

@media (max-width: 900px) {
  .mgmt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.form-bar { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .5rem; }
.form-bar input, .form-bar select { padding: .45rem; border: 1px solid #ccc; border-radius: 4px; }
.form-bar button { padding: .45rem .7rem; background: var(--red); color: #fff; border-radius: 4px; font-weight: 600; }

dialog {
  border: 0; border-radius: 10px; padding: 1rem; width: min(380px, 92vw);
  box-shadow: 0 20px 50px rgba(0,0,0,.4);
}
dialog::backdrop { background: rgba(0,0,0,.55); }
dialog h3 { margin: 0 0 .6rem; }
dialog label { display: block; margin: .4rem 0; font-size: .9rem; }
dialog input, dialog select {
  width: 100%; margin-top: .2rem; padding: .5rem; border: 1px solid #ccc; border-radius: 6px;
}
.dlg-actions { display: flex; justify-content: flex-end; gap: .4rem; margin-top: .75rem; }
.dlg-actions button { padding: .5rem .8rem; border-radius: 6px; background: #eee; }
.dlg-actions .ok, dialog .ok { background: #1b4332; color: #fff; }

.print-only { display: none; }

/* —— Satışlar listesi —— */
.sales-wrap { display: flex; flex-direction: column; gap: .75rem; height: 100%; min-height: 0; }
.sales-filters {
  display: flex; flex-wrap: wrap; gap: .4rem;
}
.sales-filters button {
  padding: .45rem .85rem; border-radius: 999px; background: #ddd; color: #333;
  font-weight: 700; font-size: .82rem;
}
.sales-filters button.on { background: #c1121f; color: #fff; }
.sales-list {
  list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1;
  background: #fff; border-radius: 8px; border: 1px solid #ddd;
}
.sales-list li {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: .5rem; align-items: center;
  padding: .7rem .85rem; border-bottom: 1px solid #eee;
  cursor: pointer;
}
.sales-list li:hover { background: #f7f7f7; }
.sales-list .s-ticket { font-weight: 800; font-size: 1rem; }
.sales-list .s-meta { font-size: .78rem; color: #666; }
.sales-list .s-amt { font-weight: 800; white-space: nowrap; }
.sales-list .s-badge {
  display: inline-block; font-size: .65rem; font-weight: 800;
  padding: .15rem .4rem; border-radius: 4px; margin-left: .35rem;
  text-transform: uppercase;
}
.s-badge.open { background: #fff3cd; color: #856404; }
.s-badge.closed { background: #d8f3dc; color: #1b4332; }
.s-badge.cancelled { background: #f8d7da; color: #842029; }

.sale-detail { display: flex; flex-direction: column; gap: .75rem; }
.sale-detail .sd-head {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  justify-content: space-between;
}
.sale-detail .sd-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.sale-detail .sd-actions button {
  padding: .55rem .85rem; border-radius: 8px; font-weight: 700; background: #333; color: #fff;
}
.sale-detail .sd-actions .danger { background: #c1121f; }
.sale-detail .sd-actions .ok { background: #1b4332; }
.sale-detail .sd-actions .ghost { background: #eee; color: #333; }
.sale-detail table {
  width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden;
}
.sale-detail th, .sale-detail td {
  padding: .5rem .65rem; border-bottom: 1px solid #eee; text-align: left; font-size: .9rem;
}
.sale-detail .pay-edit {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem;
  background: #fff; padding: .75rem; border-radius: 8px;
}
.sale-detail .pay-edit label { font-size: .85rem; font-weight: 600; }
.sale-detail .pay-edit input {
  width: 100%; margin-top: .25rem; padding: .45rem; border: 1px solid #ccc; border-radius: 6px;
}

/* —— Karışık ödeme paneli —— */
.pay-split-dlg {
  width: min(960px, 96vw);
  max-width: 96vw;
  height: min(640px, 92vh);
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
}
.pay-split-dlg::backdrop { background: rgba(0,0,0,.65); }
.pay-split {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  background: #1a1a1a;
  color: #eee;
}
.pay-split-head {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem; background: #111; border-bottom: 1px solid #333;
}
.pay-split-head h3 { margin: 0; flex: 1; font-size: 1.05rem; }
.pay-split-total { font-size: .95rem; }
.ps-close {
  width: 36px; height: 36px; border-radius: 8px; background: #333; color: #fff; font-size: 1.1rem;
}
.pay-split-body {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  min-height: 0; overflow: hidden;
}
.ps-left, .ps-right {
  padding: .75rem; overflow: auto; min-height: 0;
}
.ps-right { background: #222; border-left: 1px solid #333; }
.ps-label {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: #999; margin-bottom: .5rem;
}
.ps-right label {
  display: block; margin: .5rem 0; font-size: .9rem; font-weight: 600;
}
.ps-right input {
  width: 100%; margin-top: .25rem; padding: .55rem; border-radius: 8px;
  border: 1px solid #444; background: #111; color: #fff; font-size: 1.05rem;
}
.ps-remain {
  margin-top: .75rem; padding: .55rem .7rem; border-radius: 8px;
  background: #333; font-weight: 700;
}
.ps-remain.ok { background: #1b4332; }
.ps-remain.bad { background: #5c0000; }
.ps-preview { margin-top: .5rem; font-size: .82rem; color: #aaa; }
.ps-lines { display: flex; flex-direction: column; gap: .45rem; }
.ps-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .4rem;
  padding: .65rem .7rem;
  background: #2a2a2a;
  border-radius: 8px;
  border-left: 4px solid #666;
  touch-action: pan-y;
  user-select: none;
}
.ps-line.m-cash { border-left-color: #52b788; background: #1e2e24; }
.ps-line.m-card { border-left-color: #4ea8de; background: #1a2733; }
.ps-line.m-meal_card { border-left-color: #b185db; background: #2a1f33; }
.ps-line .ps-name { font-weight: 700; font-size: .9rem; }
.ps-line .ps-amt { font-weight: 800; white-space: nowrap; }
.ps-line .ps-note { font-size: .72rem; color: #aaa; }
.ps-chips {
  grid-column: 1 / -1;
  display: flex; gap: .3rem; margin-top: .25rem;
}
.ps-chips button {
  flex: 1; padding: .35rem; border-radius: 6px; font-size: .72rem; font-weight: 700;
  background: #3a3a3a; color: #ccc;
}
.ps-chips button.on { background: #c1121f; color: #fff; }
.pay-split-foot {
  display: flex; justify-content: flex-end; gap: .5rem;
  padding: .75rem 1rem; background: #111; border-top: 1px solid #333;
}
.pay-split-foot button {
  padding: .65rem 1.1rem; border-radius: 8px; font-weight: 700; background: #333; color: #fff;
}
.pay-split-foot .ok { background: #1b4332; }

@media (max-width: 720px) {
  .pay-split-body { grid-template-columns: 1fr; }
  .ps-right { border-left: 0; border-top: 1px solid #333; }
}

@media (max-width: 1100px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .sale-shell { grid-template-columns: 96px 1fr minmax(260px, 300px) 64px; }
}
@media (max-width: 720px) {
  .sale-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto auto;
    overflow: auto;
  }
  .cats { flex-direction: row; overflow-x: auto; max-height: 52px; }
  .cat-btn { min-width: 100px; min-height: 48px; flex: 0 0 auto; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 6px; }
  .tool-rail { flex-direction: row; overflow-x: auto; }
  .tool-rail button { min-width: 64px; }
  .pay-row { grid-template-columns: 1fr 1fr; }
}

@media print {
  @page {
    size: 58mm auto;
    margin: 2mm;
  }
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body * { visibility: hidden; }
  #print-root, #print-root * { visibility: visible; }
  #print-root {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 54mm;
    max-width: 54mm;
    padding: 0 1mm;
    margin: 0;
    color: #000 !important;
    background: #fff !important;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.3;
    box-sizing: border-box;
    overflow: hidden;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  #print-root .receipt {
    width: 100%;
    max-width: 100%;
    color: #000 !important;
    word-wrap: break-word;
    overflow-wrap: anywhere;
  }
  #print-root .r-ticket {
    font-size: 22px;
    font-weight: 900;
    font-style: italic;
    letter-spacing: 0.5px;
    line-height: 1.05;
    margin: 0 0 2px;
    color: #000 !important;
  }
  #print-root .r-title {
    text-align: center;
    font-size: 14px;
    font-weight: 800;
    margin: 2px 0 6px;
    color: #000 !important;
  }
  #print-root .r-row {
    display: grid;
    grid-template-columns: 18mm 1fr;
    gap: 2px;
    font-size: 11px;
    font-weight: 400;
    margin: 0;
    color: #000 !important;
  }
  #print-root .r-row span { font-weight: 400; }
  #print-root .r-row b { font-weight: 700; }
  #print-root .r-row.r-islem b { font-weight: 800; }
  #print-root .r-ordernote {
    font-size: 10px;
    font-weight: 400;
    margin: 3px 0;
  }
  #print-root .r-solid {
    border: 0;
    border-top: 1.5px solid #000;
    margin: 5px 0;
  }
  #print-root .r-dash {
    border: 0;
    border-top: 1.5px dotted #000;
    margin: 5px 0;
  }
  #print-root .r-item {
    font-size: 13px;
    font-weight: 800;
    margin: 3px 0 0;
    color: #000 !important;
  }
  #print-root .r-opt {
    font-size: 10px;
    font-weight: 400;
    padding-left: 2px;
    margin: 0 0 4px;
    color: #000 !important;
  }
  #print-root .r-total {
    font-size: 14px;
    font-weight: 800;
    margin: 3px 0 4px;
    color: #000 !important;
  }
  #print-root .r-payhead {
    font-size: 12px;
    font-weight: 800;
    margin-top: 2px;
  }
  #print-root .r-payline {
    font-size: 11px;
    font-weight: 400;
    margin: 1px 0;
  }
  #pin-gate, #hub, #app, #panel, dialog { display: none !important; }
}
