/* =========================================================
   Kasir Coffee Shop — red & white theme
   ========================================================= */
:root {
  --red: #C62828;
  --red-d: #A51D1D;
  --red-dd: #7F1414;
  --red-50: #FFF4F4;
  --red-100: #FFE3E3;
  --red-200: #FFC9C9;
  --ink: #231B1B;
  --ink-2: #5E5454;
  --muted: #8C8282;
  --line: #F0E7E7;
  --line-2: #E5D9D9;
  --bg: #FBF8F8;
  --card: #FFFFFF;
  --green: #18794E;
  --green-50: #E8F6EE;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(90, 20, 20, .05), 0 2px 8px rgba(90, 20, 20, .06);
  --shadow-lg: 0 16px 48px rgba(60, 10, 10, .22);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
.ic { flex: none; display: block; }
.ti { display: inline-flex; }
[hidden] { display: none !important; }
.sp { flex: 1; }
.muted { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.red { color: var(--red); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #E6D6D6; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #D7BDBD; background-clip: padding-box; border: 2px solid transparent; }

/* ---------- Top bar ---------- */
.topbar {
  flex: none;
  min-height: 64px;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  position: relative;
  z-index: 30;
  box-shadow: 0 2px 12px rgba(120, 10, 10, .25);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px; background: #fff; color: var(--red);
  display: grid; place-items: center; overflow: hidden; flex: none;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; padding: 1px; }
.brand-text { min-width: 0; }
.brand-name { font-weight: 800; font-size: 16px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.brand-sub { font-size: 11.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.tabs { display: flex; gap: 4px; margin-left: 8px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: flex; align-items: center; gap: 8px; border: 0; background: transparent; color: #fff;
  padding: 9px 15px; border-radius: 999px; font-weight: 600; white-space: nowrap; opacity: .92;
}
.tab:hover { background: rgba(255, 255, 255, .14); opacity: 1; }
.tab.active { background: #fff; color: var(--red); opacity: 1; box-shadow: 0 2px 8px rgba(80, 0, 0, .2); }
.top-right { display: flex; align-items: center; gap: 8px; flex: none; }
.clock { text-align: right; line-height: 1.2; font-size: 11.5px; opacity: .95; margin-right: 6px; white-space: nowrap; }
.clock b { display: block; font-size: 16px; letter-spacing: .02em; }
.top-cashier {
  display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .3); border-radius: 10px; padding: 0 4px 0 10px; height: 36px;
}
.top-select { background: transparent; border: 0; color: #fff; outline: 0; max-width: 130px; font-weight: 600; height: 100%; }
.top-select option { color: var(--ink); }
.top-btn {
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3); color: #fff;
  border-radius: 10px; height: 36px; min-width: 36px; padding: 0 10px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.top-btn:hover, .top-cashier:hover { background: rgba(255, 255, 255, .24); }

/* ---------- Views ---------- */
main { flex: 1; min-height: 0; position: relative; }
.view { display: none; height: 100%; overflow: auto; }
.view.active { display: block; }
#view-pos.active { display: flex; overflow: hidden; }
.page { max-width: 1320px; margin: 0 auto; padding: 22px 20px 40px; }
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title h1 { margin: 0; font-size: 23px; letter-spacing: -.01em; }
.page-title p { margin: 4px 0 0; color: var(--muted); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px;
  border-radius: 11px; border: 1.5px solid transparent; font-weight: 700; white-space: nowrap; background: none;
  transition: background .12s, border-color .12s, color .12s, transform .05s; text-decoration: none;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible, .chip:focus-visible, .item-card:focus-visible, .icon-btn:focus-visible, .tab:focus-visible { outline: 3px solid var(--red-200); outline-offset: 2px; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--red-d); }
.btn-primary:disabled { background: #E7B9B9; cursor: not-allowed; }
.btn-outline { background: #fff; color: var(--red); border-color: var(--red-200); }
.btn-outline:hover { background: var(--red-50); border-color: var(--red); }
.btn-light { background: var(--red-50); color: var(--red); }
.btn-light:hover { background: var(--red-100); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: #F5EEEE; }
.btn-danger { background: #fff; color: var(--red-d); border-color: var(--red-200); }
.btn-danger:hover { background: var(--red-d); color: #fff; border-color: var(--red-d); }
.btn-lg { height: 52px; font-size: 16px; border-radius: 13px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; gap: 6px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent;
  display: inline-grid; place-items: center; color: var(--ink-2); flex: none;
}
.icon-btn:hover { background: #F5EEEE; color: var(--ink); }
.icon-btn.danger:hover { background: var(--red-50); color: var(--red); }
.link-btn { border: 0; background: none; color: var(--red); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }
.pill { background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; font-weight: 800; }
.pill:empty { display: none; }

.input {
  width: 100%; height: 42px; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 0 12px;
  background: #fff; outline: 0; transition: border-color .12s, box-shadow .12s;
}
.input:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-100); }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; min-height: 76px; line-height: 1.45; }
select.input { padding-right: 8px; }
.input.sm { height: 36px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .lbl { font-weight: 700; font-size: 12.5px; color: var(--ink-2); }
.field small, .hint { color: var(--muted); font-size: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.money { position: relative; }
.money::before { content: 'Rp'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; pointer-events: none; }
.money .input { padding-left: 40px; font-weight: 700; font-variant-numeric: tabular-nums; }
.money.big .input { height: 56px; font-size: 24px; }
.money.big::before { font-size: 18px; }

.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 42px; height: 42px; border-radius: 10px; border: 1.5px solid var(--line-2); background: #fff; font-size: 20px; font-weight: 700; color: var(--red); }
.stepper button:hover { background: var(--red-50); border-color: var(--red-200); }
.stepper .input { text-align: center; font-weight: 800; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .sl { width: 42px; height: 24px; border-radius: 999px; background: #D9CDCD; position: relative; transition: background .15s; flex: none; }
.switch .sl::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch input:checked + .sl { background: var(--red); }
.switch input:checked + .sl::after { transform: translateX(18px); }
.switch input:focus-visible + .sl { outline: 3px solid var(--red-200); outline-offset: 2px; }
.switch.sm .sl { width: 36px; height: 20px; }
.switch.sm .sl::after { width: 14px; height: 14px; }
.switch.sm input:checked + .sl::after { transform: translateX(16px); }
.switch.sm { font-size: 12.5px; gap: 8px; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--red-50); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 8px 6px; font-weight: 700; font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.seg button:hover { color: var(--red); }
.seg button.active { background: #fff; color: var(--red); box-shadow: var(--shadow); }
.seg.inline { display: inline-grid; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 12px; flex: none; }
.chip {
  border: 1.5px solid var(--line-2); background: #fff; border-radius: 999px; padding: 7px 14px;
  font-weight: 700; white-space: nowrap; color: var(--ink-2); font-size: 13px;
}
.chip:hover { border-color: var(--red-200); color: var(--red); }
.chip .n { font-size: 11px; opacity: .65; margin-left: 6px; font-weight: 700; }
.chip.active { background: var(--red); border-color: var(--red); color: #fff; }
.chip.sm { padding: 4px 10px; font-size: 12px; }

/* ---------- POS: catalog ---------- */
.catalog { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.catalog-bar { display: flex; gap: 10px; padding: 16px 16px 10px; align-items: center; flex: none; }
.search {
  flex: 1; display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--line-2);
  border-radius: 12px; padding: 0 12px; height: 44px; color: var(--muted);
  transition: border-color .12s, box-shadow .12s;
}
.search:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-100); color: var(--red); }
.search input { border: 0; outline: 0; flex: 1; height: 100%; background: transparent; min-width: 0; color: var(--ink); }
.grid {
  flex: 1; overflow: auto; padding: 4px 16px 24px; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); grid-auto-rows: max-content; gap: 14px; align-content: start;
}
.item-card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0; text-align: left; overflow: hidden; box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s, border-color .12s; display: flex; flex-direction: column;
}
.item-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(130, 20, 20, .13); border-color: var(--red-200); }
.item-card:active { transform: scale(.97); }
.item-card.bump .item-img { animation: bump .3s ease; }
@keyframes bump { 40% { filter: brightness(1.12); } }
.item-img { position: relative; aspect-ratio: 4 / 3; background: var(--red-50); overflow: hidden; }
.item-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.item-card:hover .item-img img { transform: scale(1.05); }
.item-info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.item-name { font-weight: 700; font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-price { color: var(--red); font-weight: 800; margin-top: auto; font-variant-numeric: tabular-nums; }
.qty-badge {
  position: absolute; top: 8px; right: 8px; background: var(--red); color: #fff; min-width: 30px; height: 30px;
  padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font-weight: 800; font-size: 13px;
  border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.item-card.soldout { cursor: not-allowed; }
.item-card.soldout:hover { transform: none; }
.item-card.soldout .item-img img { filter: grayscale(1); opacity: .45; transform: none; }
.soldout-tag {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-8deg);
  background: var(--ink); color: #fff; padding: 4px 12px; border-radius: 6px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: 12px;
}
.item-card.manual {
  border: 2px dashed var(--red-200); background: var(--red-50); box-shadow: none; align-items: center;
  justify-content: center; text-align: center; min-height: 190px; color: var(--red); gap: 6px; padding: 16px;
}
.item-card.manual b { font-size: 14px; }
.item-card.manual small { color: var(--ink-2); font-size: 12px; }
.item-card.manual .plus-circle { width: 52px; height: 52px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; margin-bottom: 4px; }
.empty-grid { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- POS: cart ---------- */
.cart {
  width: 410px; flex: none; background: #fff; border-left: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
}
.cart-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); flex: none; }
.cart-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.cart-title h2 { margin: 0; font-size: 18px; }
.order-no { font-size: 12px; color: var(--muted); margin-top: 2px; }
.order-no b { color: var(--red); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cart-head-btns { display: flex; gap: 6px; align-items: center; }
.cart-close { display: none; }
.cart-head .seg { margin-top: 12px; }
.cart-fields { display: grid; grid-template-columns: 1fr 132px; gap: 8px; margin-top: 10px; }
.cart-fields.no-table { grid-template-columns: 1fr; }
.cart-items { flex: 1; overflow: auto; padding: 4px 0; min-height: 80px; }
.cart-empty { height: 100%; min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); text-align: center; padding: 20px; }
.cart-empty .ic { color: var(--red-200); margin-bottom: 4px; }
.cart-empty b { color: var(--ink-2); }
.ci { display: flex; gap: 10px; padding: 10px 16px; border-bottom: 1px dashed var(--line); align-items: flex-start; transition: background .3s; }
.ci.flash { background: var(--red-50); }
.ci-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; background: var(--red-50); }
.ci-main { flex: 1; min-width: 0; cursor: pointer; }
.ci-main:hover .ci-name { color: var(--red); }
.ci-name { font-weight: 700; line-height: 1.3; }
.ci-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.ci-sub s { margin-right: 4px; }
.ci-note { font-size: 12px; color: var(--red-d); margin-top: 3px; font-style: italic; }
.tag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 5px; background: var(--red-100); color: var(--red-d); vertical-align: 1px; margin-left: 4px; }
.ci-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ci-total { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qty { display: flex; align-items: center; border: 1.5px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.qty button { width: 30px; height: 28px; border: 0; background: #fff; color: var(--red); display: grid; place-items: center; }
.qty button:hover { background: var(--red-50); }
.qty span { min-width: 28px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.cart-foot { border-top: 1px solid var(--line); padding: 10px 16px 16px; background: #fff; flex: none; }
.cart-tools { display: flex; gap: 16px; margin-bottom: 6px; }
.order-note { font-size: 12px; background: var(--red-50); color: var(--red-d); border-radius: 8px; padding: 6px 10px; margin-bottom: 6px; font-style: italic; }
.sum-row { display: flex; justify-content: space-between; align-items: center; padding: 2px 0; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sum-row .x { border: 0; background: none; color: var(--muted); padding: 0 4px; margin-left: 2px; }
.sum-row .x:hover { color: var(--red); }
.sum-row.disc span:last-child { color: var(--green); }
.sum-row.total { font-size: 21px; font-weight: 800; color: var(--ink); padding-top: 8px; margin-top: 6px; border-top: 1px dashed var(--line-2); }
.sum-row.total span:last-child { color: var(--red); }
.cart-actions { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; margin-top: 12px; }
.cart-actions .btn-lg { height: 52px; padding: 0 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cart-actions .btn-outline { padding: 0 14px; }
.cart-backdrop { display: none; }
.cart-fab { display: none; }

/* ---------- Modal ---------- */
.modal-wrap {
  position: fixed; inset: 0; background: rgba(40, 8, 8, .48); display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 100; opacity: 0; transition: opacity .15s;
}
.modal-wrap.show { opacity: 1; }
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 480px; max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg); transform: translateY(12px) scale(.98); transition: transform .16s;
}
.modal-wrap.show .modal { transform: none; }
.modal.lg { max-width: 820px; }
.modal.md { max-width: 600px; }
.modal.sm { max-width: 380px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 14px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.modal-msg { margin: 0; line-height: 1.55; color: var(--ink-2); }

/* line edit / manual item */
.note-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.line-total { display: flex; justify-content: space-between; align-items: center; background: var(--red-50); border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.line-total b { color: var(--red); font-size: 18px; font-variant-numeric: tabular-nums; }
.quick-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.checkline { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; margin: 4px 0 14px; }
.checkline input { width: 18px; height: 18px; accent-color: var(--red); }

/* ---------- Payment ---------- */
.pay { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.pay-total { background: var(--red); color: #fff; border-radius: 16px; padding: 16px 18px; margin-bottom: 16px; }
.pay-total span { font-size: 12.5px; opacity: .88; font-weight: 600; }
.pay-total b { display: block; font-size: 32px; letter-spacing: -.01em; margin: 2px 0; font-variant-numeric: tabular-nums; }
.pay-total small { opacity: .85; }
.pm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 14px; }
.pm {
  border: 1.5px solid var(--line-2); background: #fff; border-radius: 12px; padding: 10px 6px; display: flex;
  flex-direction: column; align-items: center; gap: 6px; font-weight: 700; font-size: 12.5px; color: var(--ink-2); min-height: 66px; justify-content: center;
}
.pm:hover { border-color: var(--red-200); color: var(--red); }
.pm.active { border-color: var(--red); background: var(--red-50); color: var(--red); box-shadow: 0 0 0 2px var(--red-100) inset; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.quick button { border: 1.5px solid var(--line-2); background: #fff; border-radius: 10px; padding: 8px 10px; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.quick button:hover { border-color: var(--red); color: var(--red); }
.quick button.exact { background: var(--red-50); color: var(--red); border-color: var(--red-200); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.keypad button { height: 48px; border-radius: 10px; border: 1.5px solid var(--line); background: #FDFAFA; font-size: 18px; font-weight: 700; display: grid; place-items: center; }
.keypad button:hover { background: var(--red-50); border-color: var(--red-200); }
.keypad button:active { background: var(--red-100); }
.change { display: flex; justify-content: space-between; align-items: center; border-radius: 14px; padding: 14px 16px; background: var(--green-50); color: var(--green); font-weight: 700; }
.change b { font-size: 24px; font-variant-numeric: tabular-nums; }
.change.short { background: var(--red-50); color: var(--red); }
.noncash-info { border: 1.5px dashed var(--line-2); border-radius: 16px; padding: 24px 18px; text-align: center; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 10px; height: 100%; justify-content: center; }
.noncash-info .ic { color: var(--red); }
.noncash-info b { font-size: 26px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Receipt (screen preview & print) ---------- */
.success-banner { display: flex; align-items: center; gap: 12px; background: var(--green-50); color: var(--green); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }
.success-banner .circle { width: 40px; height: 40px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; flex: none; }
.success-banner b { display: block; font-size: 15px; }
.success-banner .big { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.paper-wrap { background: #F4EDED; border-radius: 14px; padding: 18px 10px; display: flex; justify-content: center; }
.paper { background: #fff; padding: 16px 14px 20px; box-shadow: 0 2px 10px rgba(0, 0, 0, .1); position: relative; }
.paper::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 6px; background: linear-gradient(-45deg, transparent 4px, #fff 0) 0 0 / 8px 6px, linear-gradient(45deg, transparent 4px, #fff 0) 0 0 / 8px 6px; }
.paper .receipt.w58 { width: 250px; font-size: 12.5px; }
.paper .receipt.w80 { width: 330px; font-size: 13px; }
.wa-row { display: flex; gap: 8px; margin-top: 14px; }
.receipt { font-family: 'Plus Jakarta Sans', Arial, Helvetica, sans-serif; color: #000; font-size: 11.5px; line-height: 1.38; }
.receipt.w58 { width: 48mm; }
.receipt.w80 { width: 72mm; font-size: 12.5px; }
.r-center { text-align: center; }
.r-shop { text-align: center; font-weight: 800; font-size: 1.3em; line-height: 1.2; }
.r-small { font-size: .88em; }
.r-line { border-top: 1px dashed #000; margin: 6px 0; }
.r-line.solid { border-top-style: solid; border-top-width: 2px; }
.r-row { display: flex; justify-content: space-between; gap: 8px; }
.r-row > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.r-row > span:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.r-total { font-weight: 800; font-size: 1.2em; margin: 2px 0; }
.r-bold { font-weight: 800; }
.r-queue { text-align: center; margin: 4px 0 2px; }
.r-queue small { display: block; font-size: .8em; letter-spacing: .12em; text-transform: uppercase; }
.r-queue b { font-size: 2.4em; line-height: 1.05; letter-spacing: .04em; }
.r-item { margin-bottom: 3px; }
.r-iname { font-weight: 700; }
.r-note { font-size: .88em; font-style: italic; padding-left: 8px; }
.r-logo { display: block; max-width: 60%; max-height: 26mm; margin: 0 auto 4px; filter: grayscale(1) contrast(1.2); }
.r-logo.mono { filter: none; }
.r-void { border: 2px solid #000; text-align: center; font-weight: 800; padding: 4px; margin: 6px 0; letter-spacing: .1em; }
.r-void small { letter-spacing: 0; font-weight: 600; }
.r-title { text-align: center; font-weight: 800; letter-spacing: .06em; margin: 2px 0; }
.r-section { font-weight: 800; letter-spacing: .06em; margin: 2px 0 2px; }
.r-kitem { display: flex; gap: 8px; font-size: 1.15em; font-weight: 700; margin: 4px 0 0; }
.r-kitem .q { min-width: 2.2em; }
.r-sign { display: flex; justify-content: space-between; gap: 10px; margin-top: 26px; text-align: center; font-size: .88em; }
.r-sign div { flex: 1; border-top: 1px solid #000; padding-top: 3px; }
#printArea { display: none; }

/* ---------- Cards, tables ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); min-width: 0; }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card-head h3 .ic { color: var(--red); }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }
.table-wrap { overflow: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #FDFAFA; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.table th.num { text-align: right; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--red-50); }
.table tr.is-void td { color: var(--muted); }
.table tr.is-void td.tot { text-decoration: line-through; }
.table .strong { font-weight: 800; }
.table tfoot td { font-weight: 800; background: #FDFAFA; border-top: 1px solid var(--line); }
.qno { font-weight: 800; color: var(--red); font-size: 15px; }
.sub { display: block; font-size: 11.5px; color: var(--muted); }
.sub.nowrap { white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.badge.paid { background: var(--green-50); color: var(--green); }
.badge.void { background: #EFE9E9; color: var(--ink-2); }
.badge.neutral { background: var(--red-50); color: var(--red-d); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ic { color: var(--red-200); margin: 0 auto 10px; }
.empty b { display: block; color: var(--ink-2); margin-bottom: 4px; font-size: 15px; }
.sumbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.sumbar .s { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; box-shadow: var(--shadow); }
.sumbar .s small { display: block; color: var(--muted); font-weight: 600; font-size: 11.5px; }
.sumbar .s b { font-size: 17px; font-variant-numeric: tabular-nums; }
.datebox { display: flex; align-items: center; gap: 4px; background: #fff; border: 1.5px solid var(--line-2); border-radius: 11px; padding: 2px; }
.datebox .input { border: 0; height: 36px; width: 150px; box-shadow: none !important; }
.datebox .icon-btn { width: 34px; height: 34px; }

/* ---------- Reports ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.kpi .k-label { font-size: 12.5px; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.kpi .k-val { font-size: 25px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.hero { background: var(--red); color: #fff; border-color: var(--red); }
.kpi.hero .k-label, .kpi.hero .k-sub { color: rgba(255, 255, 255, .88); }
.minis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.mini { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; min-width: 0; }
.mini small { display: block; color: var(--muted); font-weight: 600; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini b { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rgrid .span2 { grid-column: 1 / -1; }
.chart { position: relative; width: 100%; }
.chart > svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .bar { fill: var(--red); transition: fill .1s; }
.chart .bar.on { fill: var(--red-dd); }
.chart .grid-l { stroke: #F1E8E8; stroke-width: 1; }
.chart .base-l { stroke: #D8CACA; stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 11px; font-family: inherit; font-variant-numeric: tabular-nums; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .tip {
  position: absolute; pointer-events: none; background: var(--ink); color: #fff; padding: 8px 11px; border-radius: 9px;
  font-size: 12px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity .1s; z-index: 5; box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
}
.chart .tip b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.chart .tip span { opacity: .8; }
.chart-empty { padding: 50px 0; text-align: center; color: var(--muted); }
.chart-empty .ic { margin: 0 auto; color: var(--red-200); }
details.dtable { margin-top: 10px; }
details.dtable summary { cursor: pointer; color: var(--red); font-weight: 700; font-size: 13px; padding: 4px 0; }
.share { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.share .track { flex: 1; height: 8px; background: var(--red-50); border-radius: 4px; overflow: hidden; }
.share .track i { display: block; height: 100%; background: var(--red); border-radius: 4px; }
.share em { font-style: normal; font-size: 12px; color: var(--muted); min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.rank { width: 26px; height: 26px; border-radius: 8px; background: var(--red-50); color: var(--red); display: inline-grid; place-items: center; font-weight: 800; font-size: 12px; }
.rank.top { background: var(--red); color: #fff; }
.closing { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: end; }
.closing .cbox { background: #FDFAFA; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.closing .cbox small { display: block; color: var(--muted); font-weight: 700; font-size: 11.5px; margin-bottom: 4px; }
.closing .cbox b { font-size: 17px; font-variant-numeric: tabular-nums; }
.closing .cbox.ok b { color: var(--green); }
.closing .cbox.bad b { color: var(--red); }
.closing .field { margin: 0; }

/* ---------- Menu management ---------- */
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.m-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.m-card.off .m-img img { filter: grayscale(1); opacity: .55; }
.m-img { position: relative; aspect-ratio: 16 / 10; background: var(--red-50); }
.m-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-cat { position: absolute; left: 10px; top: 10px; background: rgba(255, 255, 255, .94); color: var(--red); font-weight: 800; font-size: 11px; padding: 3px 9px; border-radius: 999px; }
.m-body { padding: 12px 14px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.m-name { font-weight: 800; font-size: 14.5px; }
.m-price { color: var(--red); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.m-desc { color: var(--muted); font-size: 12.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.m-actions { display: flex; align-items: center; gap: 4px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.m-actions .switch { margin-right: auto; }
.item-form { display: grid; grid-template-columns: 220px 1fr; gap: 20px; }
.photo-prev { aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--red-50); border: 1.5px dashed var(--red-200); }
.photo-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-btns { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.photo-btns label.btn { cursor: pointer; }
.cat-row { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.cat-row .count { font-size: 12px; color: var(--muted); white-space: nowrap; min-width: 64px; text-align: right; }

/* ---------- Settings ---------- */
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.set-grid .span2 { grid-column: 1 / -1; }
.set-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.set-line:last-child { border-bottom: 0; }
.set-line .t b { display: block; font-size: 13.5px; }
.set-line .t small { color: var(--muted); font-size: 12px; }
.pm-checks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pm-check { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 9px 10px; cursor: pointer; font-weight: 600; font-size: 13px; }
.pm-check input { accent-color: var(--red); width: 16px; height: 16px; }
.pm-check:has(input:checked) { border-color: var(--red-200); background: var(--red-50); color: var(--red-d); }
.logo-box { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.logo-prev { width: 72px; height: 72px; border-radius: 16px; background: var(--red); color: #fff; display: grid; place-items: center; overflow: hidden; flex: none; }
.logo-prev:has(img) { background: #fff; border: 1.5px solid var(--line-2); }
.logo-prev img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.data-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.preview-no { font-weight: 800; color: var(--red); font-variant-numeric: tabular-nums; }

/* ---------- Tables & orders ---------- */
.tab-pill { background: #fff; color: var(--red); border-radius: 999px; font-size: 11px; font-weight: 800; padding: 1px 7px; line-height: 1.45; }
.tab.active .tab-pill { background: var(--red); color: #fff; }
.tab-pill:empty { display: none; }
.pick-btn {
  display: flex; align-items: center; gap: 6px; width: 100%; height: 42px; border: 1.5px solid var(--red-200); border-radius: 10px;
  background: var(--red-50); padding: 0 8px 0 10px; font-weight: 800; color: var(--red-d); min-width: 0;
}
.pick-btn span { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-btn.empty { background: #fff; border-color: var(--line-2); color: var(--muted); font-weight: 600; }
.pick-btn:hover { border-color: var(--red); }
.order-no .badge { vertical-align: 1px; }
.order-no .link-btn { font-size: 12px; padding: 0; margin-left: 4px; }
.badge.unpaid { background: var(--red); color: #fff; }
.o-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 14px; font-size: 13px; }
.o-status .pg { flex-basis: 100%; }
.pg { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.pg .st { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 7px; border-radius: 999px; background: #F5EFEF; white-space: nowrap; }
.pg .st.done { background: var(--green-50); color: var(--green); }
.pg .st.cur { background: var(--ink); color: #fff; }
.pg i { width: 8px; height: 2px; background: var(--line-2); border-radius: 2px; flex: none; }
.seg.wrap { display: flex; flex-wrap: wrap; max-width: 100%; }
.seg.wrap button { flex: 1 1 auto; }
.seg .pill { margin-left: 2px; }
.seg button.active .pill { background: var(--red); }
.notice { display: flex; align-items: center; gap: 10px; width: 100%; border: 1.5px dashed var(--red-200); background: var(--red-50); color: var(--red-d); border-radius: 12px; padding: 10px 14px; font-weight: 700; margin-bottom: 16px; text-align: left; }
.notice .ic:last-child { margin-left: auto; }

.ogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; align-items: start; }
.ogrid.one { grid-template-columns: 1fr; }
.ocard { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--green); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ocard.unpaid { border-left-color: var(--red); }
.ocard.closed { border-left-color: var(--line-2); opacity: .9; }
.oc-head { display: flex; gap: 10px; align-items: flex-start; }
.oc-q { font-size: 22px; font-weight: 800; color: var(--red); line-height: 1.05; font-variant-numeric: tabular-nums; }
.oc-who { flex: 1; min-width: 0; }
.oc-who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-who span { font-size: 11.5px; color: var(--muted); }
.oc-time { font-size: 12px; font-weight: 700; color: var(--ink-2); display: flex; gap: 4px; align-items: center; white-space: nowrap; background: #F7F2F2; border-radius: 999px; padding: 3px 9px; }
.oc-time.late { color: #fff; background: var(--red); }
.oc-items { font-size: 13px; line-height: 1.45; border-top: 1px dashed var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.oc-items > div { display: flex; gap: 6px; align-items: baseline; }
.oc-items .q { font-weight: 800; min-width: 26px; font-variant-numeric: tabular-nums; }
.oc-items em { color: var(--red-d); font-size: 12px; }
.oc-items .tag { margin-left: auto; }
.oc-more { color: var(--muted); font-size: 12px; display: flex; gap: 4px; align-items: center; }
.oc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.oc-foot b { font-size: 17px; font-variant-numeric: tabular-nums; }
.oc-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }

.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
.tcard {
  position: relative; border-radius: 16px; padding: 12px 14px; min-height: 138px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  text-align: left; border: 2px dashed var(--line-2); background: #fff; color: var(--ink); transition: transform .12s, box-shadow .12s, border-color .12s;
}
.tcard:hover { transform: translateY(-2px); border-color: var(--red-200); box-shadow: var(--shadow); }
.tcard .tl { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.tcard .tn { font-size: 30px; font-weight: 800; line-height: 1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcard .ts { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.tcard .tamt { font-size: 16px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tcard .tstat { margin-top: auto; font-weight: 700; font-size: 12.5px; display: flex; align-items: center; gap: 6px; padding-top: 6px; }
.tcard .dot, .ldot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); display: inline-block; }
.ldot { margin-right: 6px; vertical-align: 0; }
.ldot.free { background: #fff; border: 2px dashed var(--line-2); }
.ldot.busy { background: var(--red); }
.ldot.paid { background: var(--red-50); border: 2px solid var(--red); }
.tcard .tpill { position: absolute; top: 10px; right: 10px; background: #fff; color: var(--red); border-radius: 999px; font-size: 11px; font-weight: 800; padding: 2px 8px; border: 1.5px solid var(--red-200); }
.tcard.busy { background: var(--red); border: 2px solid var(--red); color: #fff; box-shadow: 0 6px 18px rgba(160, 20, 20, .28); }
.tcard.busy .ts { color: rgba(255, 255, 255, .85); }
.tcard.paid { border: 2px solid var(--red); background: var(--red-50); }
.tcard.paid .tstat { color: var(--green); }
.tcard.selected { outline: 3px solid var(--ink); outline-offset: 2px; }
.tgrid.sm { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-bottom: 14px; }
.tgrid.sm .tcard { min-height: 84px; padding: 8px 10px; border-radius: 12px; }
.tgrid.sm .tn { font-size: 22px; }
.tgrid.sm .tstat { font-size: 11px; }
.area-h { font-size: 12.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; display: flex; gap: 8px; align-items: center; }
.area-h span { background: #F3ECEC; border-radius: 999px; padding: 0 8px; font-size: 11px; }
.cat-row.head { border-bottom: 1px solid var(--line); font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mini.warn { border-color: var(--red-200); background: var(--red-50); }
.mini.warn b { color: var(--red); }

/* ---------- Toast ---------- */
#toastRoot { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; animation: tin .2s ease; transition: opacity .3s, transform .3s; max-width: 90vw; }
.toast.ok .ic { color: #7EE2A8; }
.toast.error { background: var(--red-d); }
.toast.hide { opacity: 0; transform: translateY(8px); }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .tab .ti + span { display: none; }
  .tab { padding: 10px 13px; }
  .cart { width: 370px; }
  #btnSave .hold-txt { display: none; }
  .minis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
  .clock { display: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .closing { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; padding: 8px 12px 6px; gap: 6px 10px; }
  .brand-name, .brand-sub { max-width: 160px; }
  .tabs { order: 3; flex-basis: 100%; margin-left: 0; padding-bottom: 2px; }
  .tab .ti + span { display: inline; }
  .tab { padding: 8px 12px; font-size: 13px; }
  .top-right { margin-left: auto; }
  .cart {
    position: fixed; left: 0; right: 0; bottom: 0; width: auto; height: 90dvh; border-radius: 20px 20px 0 0;
    z-index: 60; transform: translateY(105%); transition: transform .25s ease; box-shadow: var(--shadow-lg); border: 0;
  }
  .cart.open { transform: none; }
  .cart-close { display: inline-grid; }
  .cart-backdrop { display: block; position: fixed; inset: 0; background: rgba(40, 8, 8, .45); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .cart-backdrop.show { opacity: 1; pointer-events: auto; }
  .cart-fab {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: var(--red); color: #fff; border: 0; border-radius: 14px; height: 56px; padding: 0 18px; font-weight: 800; font-size: 15px; box-shadow: 0 8px 24px rgba(160, 20, 20, .4);
  }
  .cart-fab .cnt { background: #fff; color: var(--red); border-radius: 999px; padding: 2px 9px; font-size: 13px; margin-right: 8px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; padding-bottom: 96px; }
  .catalog-bar { padding: 12px 12px 8px; }
  .catalog-bar .btn span:last-child { display: none; }
  .chips { padding: 2px 12px 10px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .grid { padding-left: 12px; padding-right: 12px; }
  .pay { grid-template-columns: 1fr; gap: 6px; }
  .rgrid, .set-grid { grid-template-columns: 1fr; }
  .item-form { grid-template-columns: 1fr; }
  .photo-box { max-width: 260px; }
  .page { padding: 16px 16px 40px; }
  .pm-checks { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .topbar { gap: 6px 8px; }
  .brand-logo { width: 36px; height: 36px; border-radius: 10px; }
  .brand-name { max-width: 120px; font-size: 14.5px; }
  .top-right { gap: 6px; }
  .top-cashier { padding: 0 2px 0 8px; }
  .top-cashier .ti { display: none; }
  .top-select { max-width: 78px; }
  .top-btn { min-width: 34px; height: 34px; padding: 0 8px; }
  .brand-sub { display: none; }
  .kpi .k-val { font-size: 20px; }
  .minis { grid-template-columns: repeat(2, 1fr); }
  .row2, .row3 { grid-template-columns: 1fr; }
  .closing { grid-template-columns: 1fr; }
  .modal-wrap { padding: 8px; align-items: flex-end; }
  .modal { max-height: calc(100dvh - 16px); }
  .pm-grid { grid-template-columns: repeat(3, 1fr); }
  .keypad button { height: 44px; }
}

/* ---------- Print ---------- */
@media print {
  html, body { height: auto !important; overflow: visible !important; background: #fff !important; display: block !important; }
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block !important; padding: 2mm 0 6mm; }
  #printArea .receipt { margin: 0 auto; }
}

/* ---------- Users, network status, remote-change notice ---------- */
.user-chip {
  display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3); color: #fff;
  border-radius: 10px; height: 36px; padding: 0 8px 0 4px; max-width: 200px; cursor: pointer;
}
.user-chip:hover { background: rgba(255, 255, 255, .24); }
.user-chip .avatar { width: 28px; height: 28px; border-radius: 8px; background: #fff; color: var(--red); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
.user-chip .uc-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; min-width: 0; }
.user-chip .uc-text b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.user-chip .uc-text small { font-size: 10.5px; opacity: .85; }
.net-status {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .3);
  background: rgba(255, 255, 255, .14); color: #fff; font-weight: 700; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.net-status.off { background: #FFFFFF; color: var(--red-d); border-color: #fff; }
.net-status.off .ic { animation: blink 1.2s infinite; }
.net-status .pill { background: var(--red-dd); }
.net-status.off .pill { background: var(--red); color: #fff; }
@keyframes blink { 50% { opacity: .35; } }
.link-btn.locked { color: var(--muted); }
.remote-note { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; background: var(--red-50); color: var(--red-d); border: 1px dashed var(--red-200); border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 600; }
.remote-note .link-btn { font-size: 12px; margin: 0; }
.cart-actions button:disabled { opacity: .6; cursor: not-allowed; }
@media (max-width: 860px) { .net-status span { display: none; } .net-status { padding: 0 8px; } }
@media (max-width: 520px) { .user-chip .uc-text small { display: none; } .user-chip .uc-text b { max-width: 70px; } }

/* ---------- status lights, QR sheet ---------- */
.net-status .ldot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.net-status .ldot.ok { background: #35D07F; }
.net-status .ldot.bad { background: var(--red); }
.net-status .ldot.warn { background: #F5B301; }
.net-status .net-cloud { margin-left: 6px; height: 24px; padding: 0 9px; font-size: 12px; background: #fff; color: var(--red); border-radius: 999px; border: 0; font-weight: 700; }
.net-status .ldot.grey { background: #D9CDCD; }
.net-status .mdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; margin-left: 2px; }
.net-status .mdot.ok { background: #35D07F; }
.net-status .mdot.bad { background: #FFB020; animation: blink 1.2s infinite; }
.net-status.off .ldot.bad { box-shadow: 0 0 0 2px rgba(198,40,40,.25); }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.qr-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.qr-card .qr-img svg { width: 100%; height: auto; }
.qr-card b { display: block; margin-top: 6px; }
.qr-card small { color: var(--muted); font-size: 11.5px; }
