/* ==========================================================================
   View-specific styles
   ========================================================================== */

/* ---------- Layout helpers ---------- */
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1200px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (max-width: 900px) { .grid-2-1, .grid-3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Dashboard ---------- */
.hello {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 24px 26px; border-radius: var(--r-lg);
  background: var(--chrome); color: #fff; position: relative; overflow: hidden;
}
.hello h2 { font-size: 26px; font-weight: 800; }
.hello p { color: var(--chrome-ink-2); margin-top: 6px; max-width: 560px; }
.hello-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dash-day { margin-bottom: -6px; }
.hello .btn.primary { background: var(--accent); color: var(--accent-ink); }
.hello .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.hello .btn.ghost:hover { border-color: #fff; }

.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rank li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rank li:last-child { border-bottom: 0; }
.rank-n { font-family: var(--font-display); font-weight: 800; color: var(--ink-3); width: 14px; }
.rank li:first-child .rank-n { color: var(--accent-text); }
.rank-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.rank-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rank-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.rank-main span { font-size: 12px; }
.rank-qty { font-family: var(--font-display); font-weight: 700; font-size: 18px; text-align: right; line-height: 1; }
.rank-qty em { display: block; font-style: normal; font-family: var(--font); font-size: 10.5px; color: var(--ink-3); font-weight: 500; }

.feed { display: flex; flex-direction: column; }
.feed-row { display: flex; align-items: flex-start; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--line); text-align: left; border-radius: 8px; }
.feed-row:last-child { border-bottom: 0; }
.feed-row:hover { background: var(--hover); }
.fr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fr-main > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fr-main > span { color: var(--ink-2); font-size: 13px; }
.fr-time { font-size: 12px; white-space: nowrap; }
.feed-row.sev-high { box-shadow: inset 3px 0 0 var(--crit); }
.feed-row.sev-warn { box-shadow: inset 3px 0 0 var(--warn-mark); }

/* ---------- Charts (HTML/CSS) ---------- */
.cchart { --ch: 200px; padding-left: 44px; }
.cchart-plot { position: relative; height: var(--ch); margin-bottom: 24px; }
.cgrid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--grid); }
.cgrid:first-child { border-top-color: var(--line-2); }
.cgrid span { position: absolute; right: 100%; transform: translateY(-50%); padding-right: 8px; font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ccols { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.ccol { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; cursor: default; min-width: 0; }
.ccol::before { content: ''; position: absolute; inset: 0 -1px; border-radius: 6px; transition: background 0.12s; }
.ccol:hover::before { background: var(--hover); }
.ccol-bar { width: 100%; max-width: 24px; background: var(--chart-bar); border-radius: 4px 4px 0 0; min-height: 1px; position: relative; transition: height 0.5s cubic-bezier(.2,.8,.2,1); }
.ccol.muted .ccol-bar { background: var(--chart-muted); }
.ccol.hi .ccol-bar { background: var(--accent); }
.ccol-val { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 600; padding-bottom: 4px; white-space: nowrap; }
.ccol-x { position: absolute; top: 100%; padding-top: 6px; font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }

.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) auto; align-items: center; gap: 10px; cursor: default; }
.hbar-label { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; font-weight: 500; }
.hbar-label .ico { width: 16px; height: 16px; color: var(--ink-3); }
.hbar-label span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-label em { font-style: normal; color: var(--ink-3); font-size: 11.5px; margin-left: auto; padding-left: 6px; }
.hbar-track { height: 12px; display: flex; align-items: center; }
.hbar-fill { height: 12px; background: var(--chart-bar); border-radius: 0 4px 4px 0; transition: width 0.5s cubic-bezier(.2,.8,.2,1); }
.hbar-fill.hi { background: var(--accent); }
.hbar:hover .hbar-fill { opacity: 0.8; }
.hbar-val { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; min-width: 64px; }

/* ---------- Register / POS ---------- */
.view[data-route='pos'] { padding: 0; overflow: hidden; }
.view-inner.view-pos { max-width: none; height: 100%; display: block; }
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 390px; height: 100%; }
.pos-catalog { overflow-y: auto; padding: 20px 24px 32px; display: flex; flex-direction: column; gap: 14px; min-width: 0; overscroll-behavior: contain; }
.pos-tools { display: flex; gap: 10px; }
.pos-tools .search { max-width: none; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
.prod {
  position: relative; text-align: left;
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px; min-height: 140px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.prod:hover:not(:disabled) { border-color: var(--ink); box-shadow: var(--shadow-1); }
.prod:active:not(:disabled) { transform: scale(0.97); }
.prod.bump { animation: bump 0.35s; }
@keyframes bump { 40% { transform: scale(0.95); } 100% { transform: none; } }
.prod-ico { width: 46px; height: 46px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; color: var(--ink); flex: none; }
.prod-ico .ico { width: 24px; height: 24px; }
.prod-ico.lg { width: 60px; height: 60px; border-radius: 16px; }
.prod-ico.lg .ico { width: 30px; height: 30px; }
.prod-ico.sm { width: 34px; height: 34px; border-radius: 9px; }
.prod-ico.sm .ico { width: 18px; height: 18px; }
.prod-name { font-weight: 600; font-size: 14px; line-height: 1.25; flex: 1; }
.prod-foot { display: flex; align-items: center; justify-content: space-between; }
.prod-foot b { font-family: var(--font-display); font-size: 16px; }
.prod-foot em { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--surface); display: grid; place-items: center; }
.prod-foot em .ico { width: 15px; height: 15px; }
.prod-foot em.so { width: auto; height: auto; background: none; color: var(--crit); font-style: normal; font-size: 11.5px; font-weight: 600; }
.prod-count { position: absolute; top: 10px; right: 10px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.prod.sold-out { opacity: 0.55; background: repeating-linear-gradient(135deg, var(--surface) 0 10px, var(--surface-2) 10px 20px); }

.pos-cart { background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.cart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 20px 12px; }
.cart-head h3 { font-size: 17px; }
.cart-head .muted { font-size: 12px; }
.cart-close { display: none; }
.order-type { margin: 0 20px 10px; width: auto; }
.cust-row { display: flex; align-items: center; gap: 12px; margin: 0 20px 6px; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: var(--r-sm); text-align: left; }
.cust-row:hover { border-color: var(--ink); }
.cr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cr-main b { font-size: 13.5px; }
.cr-main .muted { font-size: 11.5px; }
.stamps { display: inline-flex; gap: 3px; }
.stamps i { width: 9px; height: 9px; border-radius: 2px; background: var(--surface-3); border: 1px solid var(--line-2); }
.stamps i.on { background: var(--ink); border-color: var(--ink); }
.cart-lines { flex: 1; overflow-y: auto; padding: 4px 20px; min-height: 80px; overscroll-behavior: contain; }
.cline { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'main total' 'main step'; gap: 6px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cl-main { grid-area: main; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cl-main b { font-weight: 600; }
.cl-main .muted { font-size: 12px; }
.cl-note { font-size: 12px; color: var(--accent-text); font-style: italic; }
.cl-total { grid-area: total; text-align: right; font-weight: 600; }
.cline .stepper { grid-area: step; justify-self: end; }
.cart-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 40px 10px; color: var(--ink-3); text-align: center; }
.cart-empty .ico { width: 34px; height: 34px; margin-bottom: 6px; }
.cart-empty b { color: var(--ink); }
.cart-foot { padding: 12px 20px 20px; border-top: 1px solid var(--line); background: var(--surface); }
.disc-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); font-weight: 600; font-size: 13px; text-align: left; }
.disc-row span { flex: 1; }
.disc-row.on { background: var(--accent-soft); }
.disc-row:disabled { opacity: 0.5; }
.totals { margin: 12px 0 14px; display: flex; flex-direction: column; gap: 6px; }
.totals div { display: flex; justify-content: space-between; font-size: 13.5px; }
.totals dt { color: var(--ink-2); }
.totals dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 500; }
.totals .sub { font-size: 12px; }
.totals .sub dt, .totals .sub dd { color: var(--ink-3); }
.totals .grand { margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line-2); }
.totals .grand dt { color: var(--ink); font-weight: 700; font-size: 15px; }
.totals .grand dd { font-family: var(--font-display); font-weight: 800; font-size: 24px; }

.stepper { display: inline-flex; align-items: center; background: var(--surface-3); border-radius: 999px; padding: 3px; }
.stepper button { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow-1); }
.stepper button:active { transform: scale(0.92); }
.stepper span { min-width: 34px; text-align: center; font-weight: 700; font-family: var(--font-display); font-size: 16px; }
.stepper.sm button { width: 28px; height: 28px; }
.stepper.sm button .ico { width: 14px; height: 14px; }
.stepper.sm span { min-width: 26px; font-size: 14px; }

.cart-scrim, .cart-bar { display: none; }

/* Modifier sheet */
.mod-head { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.mod-head p { font-size: 13px; }
.mod-group { margin-top: 18px; }
.mod-title { font-weight: 700; font-size: 13px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: baseline; }
.mod-title .muted { font-weight: 500; font-size: 11.5px; }
.mod-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.mod-opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 46px; padding: 8px 14px; border-radius: var(--r-sm); border: 1.5px solid var(--line-2); font-weight: 600; font-size: 13px; text-align: left; transition: all 0.12s; }
.mod-opt em { font-style: normal; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.mod-opt:hover { border-color: var(--ink); }
.mod-opt.active { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.mod-opt.active em { color: inherit; opacity: 0.75; }

/* Payment */
.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin-bottom: 18px; }
.pay-m { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border-radius: var(--r); border: 1.5px solid var(--line-2); font-weight: 600; font-size: 13px; transition: all 0.12s; }
.pay-m .ico { width: 24px; height: 24px; }
.pay-m:hover { border-color: var(--ink); }
.pay-m.active { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.pay-cash .chips { margin: -2px 0 14px; }
.change-due { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--surface-2); border-radius: var(--r); }
.change-due span { font-weight: 600; color: var(--ink-2); }
.change-due b { font-family: var(--font-display); font-size: 26px; font-weight: 800; }
.change-due.big { background: var(--accent); color: var(--accent-ink); margin-top: 14px; }
.change-due.big span { color: inherit; }
.pay-wait { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 10px; text-align: center; position: relative; }
.pay-wait .ico { width: 40px; height: 40px; margin-bottom: 6px; }
.pay-wait .pulse { position: absolute; top: 18px; left: 50%; width: 60px; height: 60px; margin-left: -30px; border-radius: 50%; border: 2px solid var(--accent); animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { from { transform: scale(0.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.pay-qr { display: flex; gap: 18px; align-items: center; }
.pay-qr .qr { width: 148px; height: 148px; flex: none; border-radius: 10px; border: 1px solid var(--line); }
.pay-qr b { display: block; font-size: 16px; margin-bottom: 4px; }
.pay-qr span { font-size: 13px; }
.paid { text-align: center; padding: 6px 0 18px; }
.paid-check { width: 64px; height: 64px; border-radius: 50%; background: var(--ink); color: var(--surface); display: grid; place-items: center; margin: 0 auto 12px; animation: pop-in 0.45s cubic-bezier(.34,1.56,.64,1); }
.paid-check .ico { width: 32px; height: 32px; stroke-width: 2.6; }
@keyframes pop-in { from { transform: scale(0.3); opacity: 0; } to { transform: none; opacity: 1; } }
.paid h3 { font-size: 24px; font-weight: 800; }
.paid p { margin-top: 4px; }

/* Receipt */
.receipt {
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.55;
  background: #fff; color: #111;
  width: 100%; max-width: 320px; margin: 0 auto; padding: 22px 20px 18px;
  border: 1px solid #e2e2e2; border-radius: 4px; position: relative;
  box-shadow: 0 1px 0 #eee, 0 12px 24px -16px rgba(0,0,0,.35);
}
.r-logo { display: flex; justify-content: center; margin-bottom: 10px; }
.r-mark { width: 54px; color: #111; }
.r-logo .logo-img { width: 70px; height: 70px; }
.r-center { text-align: center; }
.r-small { font-size: 9.5px; color: #666; margin-top: 6px; }
.receipt hr { border: 0; border-top: 1px dashed #bbb; margin: 9px 0; }
.r-row { display: flex; justify-content: space-between; gap: 10px; }
.r-row span:last-child { white-space: nowrap; }
.r-row.b { font-weight: 600; }
.r-row.total { font-weight: 700; font-size: 14px; margin: 4px 0; }
.r-mods { color: #666; font-size: 10.5px; padding-left: 14px; margin-top: -2px; }
.r-stamp { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-14deg); border: 3px solid #c22b2b; color: #c22b2b; font-size: 26px; font-weight: 800; padding: 4px 14px; letter-spacing: 0.1em; opacity: 0.75; border-radius: 6px; }
.r-barcode { display: block; width: 80%; height: 34px; margin: 12px auto 0; fill: #111; }

/* ---------- Orders ---------- */
.queue { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.qcol { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; gap: 12px; min-height: 200px; }
.qcol-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px; }
.qcol-head h3 { font-size: 15px; }
.qcol.prep .qcol-head .count { background: var(--ink); color: var(--surface); }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-1); }
.qcard.ready { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.qcard header { display: flex; align-items: center; gap: 8px; }
.qcard header b { font-size: 18px; font-family: var(--font-display); }
.q-time { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.q-time .ico { width: 14px; height: 14px; }
.q-time.late { color: var(--crit); }
.qcard.late { border-left: 4px solid var(--crit); }
.q-who { font-size: 12px; color: var(--ink-3); margin-top: -6px; }
.q-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.q-lines li { display: flex; gap: 10px; }
.q-lines li > b { font-family: var(--font-display); min-width: 22px; }
.q-lines li div { display: flex; flex-direction: column; }
.q-lines span { font-weight: 600; }
.q-lines em { font-style: normal; font-size: 12px; color: var(--ink-3); }
.q-lines em.note { color: var(--accent-text); font-style: italic; }

.order-detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.od-status { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.od-receipt { background: var(--surface-2); border-radius: var(--r); padding: 16px; }
.kv { margin: 0; display: flex; flex-direction: column; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: center; }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--ink-3); font-size: 12.5px; flex: none; }
.kv dd { margin: 0; text-align: right; display: flex; align-items: center; gap: 6px; justify-content: flex-end; min-width: 0; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.timeline li { display: flex; gap: 10px; }
.timeline li > .ico { width: 30px; height: 30px; padding: 7px; border-radius: 50%; background: var(--surface-3); flex: none; }
.timeline li div { display: flex; flex-direction: column; font-size: 13px; }
.timeline .muted { font-size: 12px; }
.od-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0 10px; }

/* ---------- Inventory ---------- */
.intro { max-width: 760px; }
.onhand { display: flex; flex-direction: column; min-width: 110px; }
.onhand .meter { margin-top: 5px; }
.cell-prod { display: flex; align-items: center; gap: 10px; }
.po-grid, .sup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.po-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.po-card header, .sup-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.po-card header div { display: flex; flex-direction: column; }
.po-card header b { font-size: 15px; }
.po-card.draft { border-style: dashed; border-color: var(--line-2); }
.po-lines { list-style: none; margin: 0; padding: 0; font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.po-lines li { display: flex; justify-content: space-between; gap: 10px; }
.po-card footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.po-card footer > div { display: flex; flex-direction: column; }
.sup-card { display: flex; flex-direction: column; gap: 10px; }
.sup-card header { justify-content: flex-start; align-items: center; }
.sup-card header div { display: flex; flex-direction: column; }
.sup-card header .muted { font-size: 12px; }
.tagrow { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 11.5px; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.adj-now { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.adj-now > div { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; display: flex; flex-direction: column; }
.adj-now .muted { font-size: 11.5px; }
.adj-now b { font-size: 15px; }
.adj-now + .seg { margin-bottom: 16px; }
.adj-preview { padding: 12px 14px; background: var(--accent-soft); border-radius: var(--r-sm); font-size: 13px; }

/* ---------- Reports ---------- */
.mini-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.mini-stats b { color: var(--ink); font-size: 13px; margin-left: 4px; }
.share { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.share .meter { flex: 1; margin: 0; }
.locked { display: flex; flex-direction: column; align-items: center; padding-bottom: 28px; }

/* ---------- Audit ---------- */
.integrity { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); flex-wrap: wrap; }
.int-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--ink); color: var(--surface); display: grid; place-items: center; flex: none; }
.int-icon .ico { width: 22px; height: 22px; }
.int-text { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; }
.int-text b { font-size: 15px; }
.int-text span { font-size: 12.5px; color: var(--ink-2); }
.integrity.ok { border-color: color-mix(in srgb, var(--good) 40%, transparent); background: var(--good-bg); }
.integrity.ok .int-icon { background: var(--good); color: #fff; }
.integrity.bad { border-color: var(--crit); background: var(--crit-bg); }
.integrity.bad .int-icon { background: var(--crit); color: #fff; }
.audit-table td.wrap { min-width: 260px; }
.audit-table tr.sev-high td:first-child { box-shadow: inset 3px 0 0 var(--crit); }
.audit-table tr.sev-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn-mark); }
.hash { color: var(--ink-3); }
.audit-msg { font-size: 15px; font-weight: 500; padding: 12px 14px; background: var(--surface-2); border-radius: var(--r-sm); margin-bottom: 12px; }

/* ---------- Cash ---------- */
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

.drawer { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 1.4fr); gap: 20px; align-items: center; padding: 18px; background: var(--surface-2); border-radius: var(--r); }
.drawer-total { display: flex; flex-direction: column; gap: 4px; }
.drawer-total b { font-family: var(--font-display); font-size: 40px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.drawer-calc { margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.drawer-calc div { display: flex; justify-content: space-between; gap: 12px; }
.drawer-calc dt { color: var(--ink-2); }
.drawer-calc dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 500; }
.drawer-calc .sep { border-top: 1px dashed var(--line-2); padding-top: 8px; margin-top: 4px; }
.drawer-calc .sep dt, .drawer-calc .sep dd { color: var(--ink-3); }
.shift-card.closed .empty { padding: 40px 16px; }
.denoms { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.denom { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); }
.denom span { font-weight: 700; font-family: var(--font-display); }
.denom input { border: 0; border-bottom: 1px solid var(--line-2); background: none; outline: 0; font-size: 18px; font-weight: 600; padding: 2px 0; width: 100%; }
.denom input:focus { border-color: var(--ink); }
.denom em { font-style: normal; font-size: 11.5px; color: var(--ink-3); }

/* ---------- People ---------- */
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.staff-card { display: flex; flex-direction: column; gap: 12px; }
.staff-card header { display: flex; align-items: center; gap: 12px; }
.staff-card header > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.staff-card header b { font-size: 15px; }
.staff-card.me { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.perm { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; vertical-align: middle; }
.perm .ico { width: 14px !important; height: 14px !important; vertical-align: 0 !important; }
.perm.yes { background: var(--ink); color: var(--surface); }
.perm.no { background: var(--surface-3); color: var(--ink-3); }
.legend-line { margin-top: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cust-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.stamp-card { margin-top: 12px; padding: 16px; border-radius: var(--r); background: var(--chrome); color: #fff; display: flex; flex-direction: column; gap: 10px; }
.stamp-card .stamps i { width: 18px; height: 18px; border-radius: 4px; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); }
.stamp-card .stamps i.on { background: var(--accent); border-color: var(--accent); }
.stamp-card span { font-size: 12.5px; color: var(--chrome-ink-2); }

/* ---------- Settings ---------- */
.tenant-hero { display: flex; gap: 24px; align-items: center; padding: 24px; border-radius: var(--r-lg); background: var(--chrome); color: #fff; flex-wrap: wrap; }
.th-logo { width: 120px; height: 120px; border-radius: 22px; background: #000; display: grid; place-items: center; flex: none; border: 1px solid var(--chrome-line); }
.th-mark { width: 64px; color: #fff; }
.th-logo .logo-img { width: 90px; height: 90px; }
.th-text { flex: 1; min-width: 240px; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent); font-weight: 700; }
.th-text h2 { font-size: 28px; font-weight: 800; margin: 4px 0 8px; }
.th-text p { color: var(--chrome-ink-2); max-width: 620px; }
.th-meta { display: flex; gap: 8px 18px; flex-wrap: wrap; margin-top: 14px; font-size: 12.5px; color: var(--chrome-ink-2); }
.th-meta span { display: inline-flex; align-items: center; gap: 6px; }
.th-meta .ico { width: 15px; height: 15px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .settings-grid { grid-template-columns: minmax(0, 1fr); } }
.logo-row { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.logo-preview { width: 84px; height: 84px; border-radius: 16px; display: grid; place-items: center; border: 1px solid var(--line); flex: none; }
.logo-preview .logo-mark { width: 46px; }
.logo-preview .logo-img { width: 64px; height: 64px; }
.logo-preview.dark { background: #0b0b0b; color: #fff; }
.logo-preview.light { background: #fff; color: #0b0b0b; }
.logo-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.logo-actions label.btn { cursor: pointer; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 6px; width: 76px; border-radius: var(--r-sm); border: 1.5px solid var(--line); font-size: 11px; font-weight: 600; cursor: pointer; position: relative; }
.swatch i { width: 30px; height: 30px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.swatch:hover { border-color: var(--ink-3); }
.swatch.active { border-color: var(--ink); background: var(--surface-2); }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.accent-note { margin-top: 8px; }
.brand-sample { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px; background: var(--surface-2); border-radius: var(--r); margin: 6px 0 4px; }
.brand-sample .btn { pointer-events: none; }
.tab-sample { width: 46px; height: 46px; border-radius: 50%; background: var(--chrome); color: #fff; display: grid; place-items: center; margin-left: auto; box-shadow: 0 0 0 3px var(--accent); }
.tab-sample .logo-mark { width: 22px; }
.tab-sample .logo-img { width: 26px; height: 26px; }

/* ==========================================================================
   Responsive: tablet (bottom tab bar) and phone
   ========================================================================== */
@media (max-width: 1024px) {
  .view[data-route='pos'] { padding: 0 0 calc(var(--tabbar-h) + var(--safe-bottom)); }
  .pos { grid-template-columns: minmax(0, 1fr) 330px; }
  .pos-catalog { padding: 16px; }
  .prod-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .cart-head { padding: 14px 16px 10px; }
  .order-type, .cust-row { margin-left: 16px; margin-right: 16px; }
  .cart-lines { padding: 4px 16px; }
  .cart-foot { padding: 12px 16px 16px; }
  .hello { padding: 20px; }
  .hello h2 { font-size: 22px; }
  .order-detail { grid-template-columns: minmax(0, 1fr); }
  .od-receipt { order: -1; }
}

@media (max-width: 760px) {
  /* POS: product grid full width, cart becomes a bottom sheet */
  .pos { grid-template-columns: minmax(0, 1fr); }
  .pos-catalog { padding: 14px 14px 96px; }
  .prod { min-height: 128px; padding: 12px; }
  .prod-ico { width: 40px; height: 40px; }
  .pos-cart {
    position: fixed; z-index: 62; left: 0; right: 0; bottom: 0;
    top: calc(var(--sim-top) + var(--safe-top) + 36px);
    border-left: 0; border-radius: 22px 22px 0 0;
    transform: translateY(105%); transition: transform 0.34s cubic-bezier(.2,.8,.2,1);
    box-shadow: var(--shadow-3);
  }
  .pos.sheet-open .pos-cart { transform: none; }
  .cart-close { display: inline-grid; color: var(--ink-2); margin-left: -8px; }
  .cart-close:hover { background: var(--hover); color: var(--ink); }
  .cart-head { justify-content: flex-start; }
  .cart-head > div { flex: 1; }
  .cart-foot { padding-bottom: calc(16px + var(--safe-bottom)); }
  .cart-scrim { display: block; position: fixed; inset: 0; z-index: 61; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
  .pos.sheet-open .cart-scrim { opacity: 1; pointer-events: auto; }
  .cart-bar {
    display: flex; align-items: center; gap: 12px;
    position: fixed; z-index: 48; left: 12px; right: 12px;
    bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px);
    height: 58px; padding: 0 8px 0 18px; border-radius: 18px;
    background: var(--ink); color: var(--surface);
    box-shadow: 0 14px 30px -10px rgba(0,0,0,.5);
    transform: translateY(150%); opacity: 0; transition: transform 0.3s cubic-bezier(.34,1.4,.64,1), opacity 0.2s;
    pointer-events: none;
  }
  .cart-bar.show { transform: none; opacity: 1; pointer-events: auto; }
  .cart-bar.bump { animation: barbump 0.35s; }
  @keyframes barbump { 40% { transform: scale(1.03); } }
  .cb-count { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
  .cb-total { flex: 1; font-family: var(--font-display); font-weight: 800; font-size: 18px; text-align: right; }
  .cb-go { display: flex; align-items: center; gap: 4px; height: 44px; padding: 0 12px 0 16px; border-radius: 13px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 13.5px; }
  body.fab-open .cart-bar { opacity: 0; pointer-events: none; }

  .queue { grid-template-columns: minmax(0, 1fr); }
  .drawer { grid-template-columns: minmax(0, 1fr); }
  .drawer-total b { font-size: 34px; }
  .cust-hero { grid-template-columns: minmax(0, 1fr); }
  .pay-qr { flex-direction: column; text-align: center; }
  .card-head .btn-group { width: 100%; }
  .card-head .btn-group .btn { flex: 1 1 auto; }
  .tenant-hero { padding: 20px; }
  .th-logo { width: 84px; height: 84px; border-radius: 18px; }
  .th-mark { width: 46px; }
  .th-text h2 { font-size: 22px; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
}

@media (max-width: 640px) {
  .hello { flex-direction: column; align-items: stretch; }
  .hello-actions .btn { flex: 1; }
    .cchart { padding-left: 38px; }
  .hbar { grid-template-columns: minmax(80px, 38%) minmax(0, 1fr) auto; gap: 8px; }
  .hbar-val { min-width: 54px; font-size: 12px; }
  .summary-strip { gap: 14px; }
  .adj-now { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .po-grid, .sup-grid, .staff-grid { grid-template-columns: minmax(0, 1fr); }
  .stock-table td .onhand { align-items: flex-end; }
  .perm-table tr { padding: 8px 14px; }
  .mod-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Fixes & compact phone layouts for the busiest tables ---------- */
.pos-cart .seg.full.order-type { width: auto; display: flex; }
html.embed body:has(.lock-screen) .home-indicator { background: #fff; }

@media (max-width: 640px) {
  .table td::before { font-family: var(--font); }

  /* Orders history: order + total / items / time + status */
  .orders-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'order total' 'items items' 'time status'; gap: 2px 12px; padding: 12px 14px; }
  .orders-table td { display: block; padding: 0; border: 0; text-align: left; }
  .orders-table td::before { display: none; }
  .orders-table td[data-l='Order'] { grid-area: order; font-size: 15px; }
  .orders-table td[data-l='Total'] { grid-area: total; text-align: right; font-weight: 700; }
  .orders-table td[data-l='Items'] { grid-area: items; max-width: none; color: var(--ink-2); font-size: 13px; }
  .orders-table td[data-l='Time'] { grid-area: time; color: var(--ink-3); font-size: 12px; align-self: center; }
  .orders-table td[data-l='Status'] { grid-area: status; justify-self: end; }
  .orders-table td[data-l='Customer'], .orders-table td[data-l='Cashier'], .orders-table td[data-l='Payment'] { display: none; }

  /* Audit: action + time / details / user */
  .audit-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'action time' 'details details' 'user user'; gap: 6px 10px; padding: 12px 14px; }
  .audit-table td { display: block; padding: 0; border: 0; text-align: left; }
  .audit-table td::before { display: none; }
  .audit-table td[data-l='Action'] { grid-area: action; }
  .audit-table td[data-l='Time'] { grid-area: time; font-size: 11.5px; color: var(--ink-3); align-self: center; }
  .audit-table td[data-l='Details'] { grid-area: details; min-width: 0 !important; font-size: 13.5px; }
  .audit-table td[data-l='User'] { grid-area: user; font-size: 12px; color: var(--ink-3); }
  .audit-table td[data-l='Ref'], .audit-table td[data-l='Terminal'], .audit-table td[data-l='Hash'] { display: none; }
  .audit-table tr.sev-high { border-left: 3px solid var(--crit); }
  .audit-table tr.sev-warn { border-left: 3px solid var(--warn-mark); }
  .audit-table tr td:first-child { box-shadow: none !important; }

  /* Stock: item + status / on-hand meter */
  .stock-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'item status' 'onhand onhand'; gap: 8px 12px; padding: 12px 14px; }
  .stock-table td { display: block; padding: 0; border: 0; text-align: left; }
  .stock-table td::before { display: none; }
  .stock-table td[data-l='Item'] { grid-area: item; }
  .stock-table td[data-l='Status'] { grid-area: status; }
  .stock-table td[data-l='On hand'] { grid-area: onhand; }
  .stock-table td[data-l='On hand'] .onhand { flex-direction: row; align-items: center; gap: 12px; }
  .stock-table td[data-l='On hand'] .meter { flex: 1; margin: 0; }
  .stock-table td:not([data-l]), .stock-table td[data-l='Group'], .stock-table td[data-l='Par'], .stock-table td[data-l='Reorder at'], .stock-table td[data-l='Unit cost'] { display: none; }

  /* Generic cards: the first cell reads as the card title */
  .table td:first-child:not(.muted) { display: block; text-align: left; }
  .table td:first-child:not(.muted)::before { display: none; }
}
