/* Foodservice shell — Tocchetta tokens, simple owner workspace (not a POS layout). */
body.app { background: var(--surface-2); }
body.app .topbar { margin-bottom: 0; }

.brand-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.brand-mark img { width: 36px; height: 36px; display: block; }
.topbar .brand-name { font-weight: 700; overflow-wrap: anywhere; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; flex-wrap: wrap; }


.page { max-width: 880px; margin: 0 auto; padding: var(--s4); padding-bottom: calc(var(--s7) + env(safe-area-inset-bottom)); }
.page-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s4); }
.page-head h1 { font-size: 1.45rem; }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
@media (max-width: 600px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-card { display: flex; flex-direction: column; gap: 8px; min-height: 132px; text-decoration: none; color: inherit; }
.dash-card .count { font-size: 1.8rem; font-weight: 700; color: var(--on-soft); }
.dash-card.soon { opacity: .92; }
.dash-card .soon-tag { align-self: flex-start; }

/* Login */
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: var(--s4); background: linear-gradient(160deg, var(--tq-primary-100), var(--tq-primary-300)); }
.login { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: var(--s4); padding: var(--s5); }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: var(--s2); text-align: center; }
.login-brand img { width: 220px; max-width: 80%; height: auto; display: block; }
.login-brand img.logo-dark { display: none; }
html[data-theme="dark"]:not(.kds-light) .login-brand img.logo-dark { display: block; }
html[data-theme="dark"]:not(.kds-light) .login-brand img.logo-light { display: none; }
.login-brand h1 { font-size: 1.25rem; }
.login-foot { justify-content: center; }
.center { text-align: center; }

/* Inline add row */
.add-row { display: grid; grid-template-columns: 1.2fr 1.2fr 0.7fr 1.1fr auto; gap: 8px; align-items: end; padding: var(--s3); position: sticky; top: 68px; z-index: 15; }
.add-row .add-cat-new:not([hidden]) { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 900px) {
  .add-row { grid-template-columns: 1.2fr 1.2fr 0.7fr; }
  .add-row .add-cat, .add-row .add-go { grid-column: auto; }
}
@media (max-width: 700px) {
  .add-row { grid-template-columns: 1fr 100px; }
  .add-row .add-name-en, .add-row .add-cat, .add-row .add-cat-new:not([hidden]), .add-row .add-go { grid-column: 1 / -1; }
  .add-row .add-cat-new:not([hidden]) { grid-template-columns: 1fr; }
}
.add-hint { margin: 8px 0 var(--s4); }

/* Menu groups */
.cat-block { margin-bottom: var(--s4); }
.cat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cat-names { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cat-head h2 { font-size: 1.05rem; min-height: 44px; display: flex; align-items: center; padding: 0 4px; border-radius: var(--r-sm); cursor: text; }
.cat-head h2:focus, .cat-head h2.editing { background: var(--surface); box-shadow: var(--focus); outline: none; }
.cat-en-name, .item-name-en { min-height: 36px; display: flex; align-items: center; padding: 0 4px; border-radius: var(--r-sm); cursor: text; font-weight: 600; }
.cat-en-name.editing, .item-name-en.editing { background: var(--surface-2); box-shadow: var(--focus); outline: none; }
.cat-en-name.is-placeholder, .item-name-en.is-placeholder { opacity: .65; font-weight: 500; }
.cat-en-name.editing input, .item-name-en.editing input { min-width: 160px; direction: ltr; }
.cat-actions { display: flex; gap: 4px; }

.item-list { display: flex; flex-direction: column; gap: 8px; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 10px 14px; min-height: 64px; }
.item .iname { font-weight: 700; min-height: 44px; display: flex; align-items: center; padding: 0 4px; border-radius: var(--r-sm); cursor: text; overflow-wrap: anywhere; }
.item .iname:focus, .item .iname.editing, .item .iprice.editing, .item .icat.editing { background: var(--surface-2); box-shadow: var(--focus); outline: none; }
.item .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.item .iprice, .item .icat { min-height: 44px; display: inline-flex; align-items: center; padding: 0 8px; border-radius: var(--r-sm); cursor: pointer; font-weight: 700; }
.item .icat.editing { flex-direction: column; align-items: stretch; gap: 6px; cursor: default; padding: 6px; min-width: min(100%, 220px); }
.item .icat.editing select, .item .icat.editing input { min-height: 40px; }
.item-cat-new-fields { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.item .iprice { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.item .icat { background: var(--surface-2); border-radius: var(--r-pill); font-size: .85rem; }
.item.is-off { opacity: .62; }
.item .avail-wrap { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.item .del { width: 44px; height: 44px; padding: 0; }
.item input.input, .cat-head input.input { min-height: 44px; }
.item.saving { opacity: .85; }
.item.flash-err { box-shadow: 0 0 0 2px var(--bad); }

.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--s4); }
.suggest button { min-height: 44px; }

.toast-row { display: flex; align-items: center; gap: 12px; }
.toast button { color: inherit; background: transparent; border: 0; font-weight: 700; cursor: pointer; min-height: 36px; padding: 0 8px; text-decoration: underline; }

.placeholder { display: flex; flex-direction: column; gap: var(--s3); align-items: flex-start; }
.placeholder h1 { margin-bottom: 0; }

.settings-form { display: flex; flex-direction: column; gap: var(--s4); }
.type-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 640px) { .type-grid { grid-template-columns: 1fr 1fr 1fr; } }
.type-opt { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: start; min-height: 72px; padding: 12px 14px; border-radius: var(--r-md); border: 2px solid transparent; background: var(--surface-2); cursor: pointer; font-weight: 700; }
.type-opt[aria-pressed=true] { border-color: var(--primary); background: var(--primary-soft); color: var(--on-soft); }
.type-opt .sub { font-weight: 500; font-size: .85rem; color: var(--muted); }

.sk-line { height: 64px; margin-bottom: 8px; }

body.app .topbar .sub#user-name:empty { display: none; }

.wrap { flex-wrap: wrap; }
.tight { gap: 2px; }
.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.plain li { display: flex; align-items: center; gap: 10px; min-height: 36px; flex-wrap: wrap; }
.rank { margin: 0; padding-inline-start: 1.2em; display: flex; flex-direction: column; gap: 6px; }
.rank li > * { margin-inline-end: 8px; }
.rank li { display: list-item; }
.rank li .grow { display: inline; }
.section-title { margin: var(--s5) 0 var(--s3); }
.toolbar { margin-bottom: var(--s3); gap: 8px; align-items: center; }
.w-cash { width: 150px; } .w-qty { width: 120px; } .w-date { width: 170px; } .w-role { width: 130px; }
@media (max-width: 420px) { .w-cash, .w-qty { width: 100%; flex: 1 1 110px; } }
.editable { cursor: text; border-radius: var(--r-sm); padding: 4px 8px; background: var(--surface-2); min-height: 36px; display: inline-flex; align-items: center; }
.editable.editing input { min-height: 36px; width: 110px; }
.iname.editing input { min-width: 160px; }
.neg { color: var(--bad-ink); } .num.pos { color: var(--ok-ink); }   /* was a bare .pos: it also coloured the whole sales page (wrapper class) green */ .strike { text-decoration: line-through; opacity: .7; }
.big { font-size: 1.5rem; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); margin-bottom: var(--s3); }
@media (max-width: 900px) { .kpis { grid-template-columns: 1fr 1fr; } }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 14px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.page:has(.pos), .page:has(.kpis) { max-width: 1180px; }
.page:has(.tbl) { max-width: 1180px; }

/* POS */
.banner-card { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-bottom: var(--s3); background: var(--warn-bg); color: var(--warn-ink); }
.pos { display: grid; grid-template-columns: 1fr 360px; gap: var(--s4); align-items: start; }
@media (max-width: 860px) { .pos { grid-template-columns: 1fr; } }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip-btn { flex: 0 0 auto; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 0; background: var(--surface); font-weight: 700; cursor: pointer; box-shadow: 0 2px 8px rgba(32, 31, 26, .06); touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.chip-btn[aria-pressed=true] { background: var(--primary); color: var(--on-primary); }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
@media (max-width: 420px) { .pos-grid { grid-template-columns: 1fr 1fr; } }
.pos-item { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 8px; min-height: 92px; padding: 12px; border-radius: var(--r-md); border: 2px solid transparent; background: var(--surface); box-shadow: var(--sh-1); cursor: pointer; text-align: start; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.pos-item:active { transform: scale(.98); }
.pos-item.in-cart { border-color: var(--primary); }
.pos-item .pname { font-weight: 700; overflow-wrap: anywhere; }
.pos-item .pprice { color: var(--on-soft); }
.pos-item .ptop { display: flex; align-items: flex-start; gap: 8px; width: 100%; }
.pos-item .ptop .pname { flex: 1; min-width: 0; }
.pos-item .badge { flex: none; min-width: 26px; height: 26px; border-radius: 13px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-size: .85rem; padding: 0 6px; }
.pos-cart { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 0; scroll-margin-top: 80px; max-height: calc(100dvh - 96px); overflow: hidden; min-height: 0; }
.pos-cart .cart-head { flex: 0 0 auto; padding-bottom: 8px; }
.pos-cart .cart-scroll { flex: 1 1 auto; min-height: 72px; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; background: var(--surface); position: relative; z-index: 0; }
.pos-cart .cart-pay { flex: 0 1 auto; min-height: 0; max-height: 50%; overflow-x: hidden; overflow-y: auto; padding-top: 10px; background: var(--surface); border-block-start: 1px solid var(--line); position: relative; z-index: 1; }
.pos-cart .cart-checkout { flex: 0 0 auto; padding: 10px 0 0; background: var(--surface); border-block-start: 1px solid var(--line); position: relative; z-index: 2; }
@media (max-width: 860px) {
  .pos-cart { position: static; max-height: none; overflow: visible; }
  .pos-cart .cart-scroll, .pos-cart .cart-pay { max-height: none; overflow: visible; }
}
.cart-lines { display: flex; flex-direction: column; gap: 8px; }
.cart-line { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.qty { display: inline-flex; align-items: center; gap: 4px; }
.qty-btn { width: 40px; min-height: 40px; padding: 0; font-size: 1.2rem; font-weight: 700; }
.qty-in { width: 52px; min-height: 40px; text-align: center; padding: 0 4px; }
.line-total { min-width: 64px; text-align: end; }
.totals { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.totals > div { display: flex; justify-content: space-between; gap: 8px; }
.totals dt { margin: 0; } .totals dd { margin: 0; }
.totals .grand { font-weight: 700; font-size: 1.15rem; border-top: 1px solid var(--line); padding-top: 6px; }
.done { background: var(--ok-bg); color: var(--ok-ink); border-radius: var(--r-md); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.cart-bar { display: none; }
@media (max-width: 860px) {
  .cart-bar:not([hidden]) { display: flex; position: sticky; bottom: 0; z-index: 25; align-items: center; gap: 8px; margin: var(--s3) calc(-1 * var(--s4)) 0; padding: 10px var(--s4) calc(10px + env(safe-area-inset-bottom)); background: var(--surface); box-shadow: 0 -8px 24px rgba(32, 31, 26, .1); font-weight: 700; }
  .page:has(.cart-bar:not([hidden])) { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
}

/* Orders */
.order { padding: 0; overflow: hidden; }
.order-head { width: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 56px; padding: 10px 14px; background: none; border: 0; text-align: start; cursor: pointer; font: inherit; }
.order-head .order-cashier { max-width: 8.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-body { padding: 0 14px 14px; }
.refund-form .input { min-width: 180px; }

/* Shift */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.stat { background: var(--surface-2); border-radius: var(--r-md); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }

/* Inventory / purchases / expenses / users add rows */
.inv-add { grid-template-columns: 1.4fr .7fr .7fr .7fr .8fr; }
.inv-add > .btn[type="submit"] { grid-column: 1 / -1; justify-self: start; }
.sup-add { grid-template-columns: 1.4fr 1fr auto; }
.exp-add { grid-template-columns: 1fr .7fr 1.3fr .8fr auto; }
.exp-add .exp-cat-new:not([hidden]) { grid-column: 1 / -1; }
.user-add { grid-template-columns: 1fr 1fr .8fr 1fr auto; }
@media (max-width: 700px) {
  .inv-add, .exp-add, .user-add { grid-template-columns: 1fr 1fr; }
  .inv-add > :first-child, .exp-add > :first-child, .user-add > :first-child { grid-column: 1 / -1; }
  .inv-add .btn, .exp-add .btn, .user-add .btn, .sup-add .btn { grid-column: 1 / -1; }
  .sup-add { grid-template-columns: 1fr; }
}
.add-row { position: static; margin-bottom: var(--s3); }
.stock.is-low { box-shadow: 0 0 0 2px var(--bad-bg), var(--sh-1); }
.stock .iname, article.card > .iname { font-weight: 700; min-height: 40px; display: inline-flex; align-items: center; padding: 0 6px; border-radius: var(--r-sm); cursor: text; }
/* Menu items: keep the name in a flexible column so it does not stack letter-by-letter at 390px. */
.card.item { grid-template-columns: minmax(0, 1fr) auto; }
.card.item .iname { display: flex; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .card.item { grid-template-columns: 1fr; }
  .card.item .meta { justify-content: flex-start; }
}
.qty-big { font-size: 1.2rem; }
.stock { display: flex; flex-direction: column; gap: 8px; padding: 10px 14px; }
.stock-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; width: 100%; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: start; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.stock-summary .iname { min-height: 36px; cursor: pointer; }
.stock-summary .stock-qty, .stock-summary .qty-big { font-weight: 700; white-space: nowrap; }
.stock-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.stock-bar[data-tone=out] { background: color-mix(in srgb, var(--bad) 22%, var(--surface-2)); }
.stock-bar { grid-column: 1 / -1; position: relative; height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.stock-bar-fill { display: block; height: 100%; width: var(--fill, 0%); border-radius: inherit; transform-origin: left center; transform: scaleX(1); animation: stock-fill .55s ease-out; }
[dir=rtl] .stock-bar-fill { transform-origin: right center; }
.stock-bar[data-tone=ok] .stock-bar-fill { background: var(--ok); }
.stock-bar[data-tone=low] .stock-bar-fill { background: var(--amber); }
.stock-bar[data-tone=out] .stock-bar-fill { background: var(--bad); }
.stock-bar-tick { position: absolute; top: -2px; bottom: -2px; width: 2px; inset-inline-start: var(--tick, 0%); background: var(--ink); opacity: .7; border-radius: 1px; pointer-events: none; }
@keyframes stock-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .stock-bar-fill { animation: none; } }
.stock-details[hidden] { display: none !important; }
.stock-details { display: flex; flex-direction: column; gap: 8px; border-block-start: 1px solid var(--line); padding-top: 8px; }

.adjust, .hist, .recipe { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.recipe { grid-column: 1 / -1; }
.del { width: 44px; height: 44px; padding: 0; }
.is-off { opacity: .62; }

/* Reports */
.tbl-wrap { overflow-x: auto; max-width: 100%; min-width: 0; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: start; color: var(--muted); font-weight: 700; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
.tbl .n { text-align: end; white-space: nowrap; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.toggle-row { align-items: flex-start; gap: 12px; cursor: pointer; }
.zatca { border-radius: var(--r-md); align-items: flex-start; }
.steps { margin: 0; padding-inline-start: 1.3em; display: flex; flex-direction: column; gap: 6px; }
fieldset.field { border: 0; padding: 0; margin: 0; }

.page-head.row { flex-direction: row; align-items: center; flex-wrap: wrap; }
@media (max-width: 860px) { body:has(.cart-bar:not([hidden])) .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); } }

/* ---- phase 3: bell, shop switcher, amendments, audit, shops ---- */
.shop-chip { display: inline-flex; align-items: center; }
.shop-select { min-height: 36px; padding: 0 10px; border-radius: var(--r-pill); max-width: 170px; font-weight: 700; background: var(--primary-soft); color: var(--on-soft); border: 0; }
.bell-wrap { position: relative; }
.bell { position: relative; width: 44px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; }
.bell-count { position: absolute; inset-block-start: -4px; inset-inline-end: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--bad); color: var(--on-bad); font-size: .72rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); }
.bell-panel { position: absolute; inset-block-start: calc(100% + 8px); inset-inline-end: 0; width: min(380px, calc(100vw - 24px)); max-height: min(70vh, 520px); overflow-y: auto; background: var(--surface); color: var(--ink); border-radius: var(--r-lg); box-shadow: var(--sh-2); padding: 12px; z-index: 50; }
@media (max-width: 520px) { .bell-wrap { position: static; } .bell-panel { inset-inline: 12px; inset-block-start: 64px; position: fixed; width: auto; } }
.bell-list { display: flex; flex-direction: column; gap: 8px; }
.bell-item { padding: 10px; border-radius: var(--r-md); background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.bell-item.unread { border-inline-start: 4px solid var(--bad); background: var(--warn-bg); }
.bell-dl, .kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; font-size: .9rem; }
.bell-dl dt, .kv dt { color: var(--muted); } .bell-dl dd, .kv dd { margin: 0; overflow-wrap: anywhere; }
.bell-head { margin-bottom: 8px; } .bell-empty { text-align: center; padding: 16px 0; }
ul.plain { list-style: none; margin: 0; padding: 0; }
.audit-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: var(--s3); }
.audit-actions { grid-column: 1 / -1; }
@media (max-width: 700px) { .audit-filters { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .audit-filters { grid-template-columns: 1fr; } }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.feat { gap: 10px; }
.cart-line.removed { opacity: .5; text-decoration: line-through; }
.amend-form { padding: 10px; border: 2px dashed var(--line); border-radius: var(--r-md); }
.amend-form .qty-n { min-width: 28px; text-align: center; }
.chip.warn { border: 2px solid var(--warn); }
.pos-item.is-out { opacity: .6; cursor: not-allowed; }

/* Pack price helpers + cost warnings */
.pack-fields { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pack-live { min-height: 1.2em; }
.cost-warn { margin: 6px 0 0; }
.cost-warn.amber, .banner.cost-amber { background: var(--warn-bg); color: var(--warn-ink); }
.cost-warn.red, .banner.cost-red { background: var(--bad-bg); color: var(--bad-ink); }
.chip.cost-red, .chip.cost-amber { font-weight: 700; }
@media (max-width: 700px) {
  .pack-fields { display: grid; grid-template-columns: 1fr 1fr; }
  .pack-fields .pack-live { grid-column: 1 / -1; }
}

input.is-computed, input[aria-readonly="true"].is-computed {
  background: var(--surface-2);
  color: var(--ink);
  cursor: default;
  opacity: .9;
}
.pack-cost-hint { font-weight: 600; }

/* Cash tendered + split payment */
#pay-seg .seg { flex-wrap: wrap; width: 100%; }
#pay-seg .seg button { flex: 1 1 auto; min-width: 4.5rem; touch-action: manipulation; }
.pay-extra { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 0; }
.pay-extra[hidden] { display: none; }
.pay-split { display: flex; flex-direction: column; gap: 6px; }
.pay-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.pay-quick-btn { min-height: 40px; touch-action: manipulation; }
.pay-change { font-size: 1.35rem; font-weight: 700; color: var(--on-soft); margin: 4px 0 0; line-height: 1.3; }
.pay-change.pay-short { font-size: 1rem; color: var(--bad-ink); }

/* Stocktake (جرد) panel + waste report */
.st-panel { padding: 14px; gap: 10px; }
.st-panel[hidden] { display: none !important; }
.st-list { display: flex; flex-direction: column; gap: 8px; }
.st-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(104px, 132px); gap: 6px 10px; align-items: center; padding: 10px 0; border-block-end: 1px solid var(--line); }
.st-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.st-in { width: 100%; min-width: 0; font-size: 16px; min-height: 44px; text-align: center; }
.st-var { grid-column: 1 / -1; min-height: 0; font-size: .85rem; overflow-wrap: anywhere; }
.st-var:empty { display: none; }
.st-row.res { grid-template-columns: minmax(0, 1fr); }
.st-row > .chip { grid-column: 1 / -1; justify-self: start; white-space: normal; }
.st-actions { align-items: center; }
.tbl tr.waste-warn td { background: var(--warn-bg); }
.tbl tr.waste-bad td { background: var(--bad-bg); font-weight: 700; }
.waste-card .tbl-wrap { max-width: 100%; overflow-x: auto; }

/* Collapsed add-forms.
   0fr is treated as minmax(auto, 0fr); a padded .card/.add-row keeps a ~24px auto
   minimum, so the form (and the green submit pill) used to peek under the toggle.
   max-height: 0 on the closed body clips that leftover. Open uses 1fr (content
   minimum) — not minmax(0, 1fr), which collapses an auto-height grid to zero.
   The toggle is a compact pill (align-self: start), not a full-width stretched bar. */
.add-fold { display: flex; flex-direction: column; gap: 8px; margin-bottom: var(--s3); min-width: 0; }
.add-fold-toggle { align-self: start; width: auto; max-width: 100%; justify-content: center; min-height: 44px; }
.add-fold-body { display: grid; grid-template-rows: 0fr; overflow: hidden; max-height: 0; transition: grid-template-rows .22s ease, max-height .22s ease; }
.add-fold-body > * { overflow: hidden; min-height: 0; min-width: 0; }
.add-fold.open .add-fold-body { grid-template-rows: 1fr; max-height: 100rem; }
.add-fold.open .add-fold-body > * { overflow: visible; }
.add-fold:not(.open) .add-fold-body { pointer-events: none; }

/* inline-editable names (users page) are real tap targets on phones */
.iname[role="button"] { min-height: 40px; display: inline-flex; align-items: center; padding-inline: 6px; border-radius: var(--r-sm); }


/* shop username prefix: fixed LTR addon before the local name (stays left in Arabic too) */
.user-login { display: flex; align-items: stretch; min-width: 0; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.user-login:focus-within { box-shadow: var(--focus); border-color: var(--primary); }
.user-login .user-prefix { display: inline-flex; align-items: center; flex: 0 0 auto; padding: 0 8px 0 10px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--on-soft); background: var(--surface-2); border-inline-end: 1px solid var(--line); white-space: nowrap; letter-spacing: 0; }
.user-login .user-prefix[hidden] { display: none; }
.user-login .input { border: 0; box-shadow: none; border-radius: 0; background: transparent; flex: 1 1 auto; min-width: 0; }
.user-login .input:focus { box-shadow: none; background: transparent; }
.user-login-block { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.user-login-preview { margin: 0; font-variant-numeric: tabular-nums; }
