/* Screens: lists, search, cart, sheets, statements. Logical properties only (works in LTR and RTL). */
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; } .page-head h1 { flex: 1; min-width: 0; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; text-decoration: none; font-weight: 600; margin-bottom: 4px; }
.back .ic { transform: scaleX(-1); } [dir="rtl"] .back .ic { transform: none; }
.searchbar { position: relative; margin-bottom: 10px; } .searchbar .ic { position: absolute; inset-inline-start: 12px; top: 12px; color: var(--muted); pointer-events: none; }
.searchbar .input { padding-inline-start: 42px; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; min-height: 56px; }
.item:first-child { border-top: 0; } .item:hover { background: var(--surface-2); }
.item .grow, .grow { flex: 1; min-width: 0; } .grow > b, .item b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .end, .end { text-align: end; flex: none; }
.amt { font-variant-numeric: tabular-nums; white-space: nowrap; } .amt.in, .pos { color: var(--ok); } .amt.out, .neg { color: var(--danger); }
.low { color: var(--warn); font-weight: 700; }
.bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; } .bar .btn { flex: 1 1 auto; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.facts > div { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; } .facts b { display: block; font-size: 1.15rem; } .facts span { color: var(--muted); font-size: .82rem; }
.facts.big b { font-size: 1.3rem; }
.sheet { width: min(94vw, 520px); max-height: 92dvh; overflow: auto; } .sheet h2 { margin-bottom: 10px; } .sheet .intro { margin-bottom: 10px; } .sheet-body .field { margin-top: 12px; } .sheet-body .field:first-child { margin-top: 0; }
.picker { position: relative; } .results { list-style: none; margin: 6px 0 0; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); max-height: 260px; overflow: auto; box-shadow: var(--shadow); }
.results button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 10px; border: 0; background: transparent; border-radius: 8px; text-align: start; cursor: pointer; } .results button:hover { background: var(--surface-2); }
.results b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.cart { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.cl { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--surface); }
.cl-top { display: flex; align-items: flex-start; gap: 8px; } .cl-top b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stepper button { width: 40px; height: 42px; border: 0; background: var(--surface-2); cursor: pointer; display: grid; place-items: center; }
.stepper input { width: 64px; height: 42px; border: 0; text-align: center; background: var(--surface); direction: ltr; }
.mini { width: 96px; min-height: 42px; text-align: end; direction: ltr; } .cl .lt { margin-inline-start: auto; font-weight: 700; }
.icon-btn { display: inline-grid; place-items: center; min-width: 40px; min-height: 40px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; color: var(--muted); } .icon-btn:hover { background: var(--surface-2); color: var(--danger); }
.totals { margin-top: 12px; } .totals .r { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; } .totals .r.grand { border-top: 2px solid var(--line); margin-top: 4px; padding-top: 10px; font-size: 1.15rem; font-weight: 800; }
.sticky-save { position: sticky; bottom: calc(var(--tab-h) + 6px); z-index: 20; margin-top: 14px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; }
.sticky-save .tot { flex: 1; font-weight: 800; font-size: 1.1rem; } @media (min-width: 900px) { .sticky-save { bottom: 10px; } }
.rev { padding: 8px 0; border-top: 1px solid var(--line); } .rev:first-child { border-top: 0; }
.menu a { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; min-height: 60px; } .menu a:first-child { border-top: 0; } .menu a:hover { background: var(--surface-2); }
.menu .ic:first-child { color: var(--accent); width: 26px; height: 26px; } .menu small { display: block; color: var(--muted); }
.tbl .n { font-variant-numeric: tabular-nums; } .tbl-wrap { overflow-x: auto; }
.rcbox { max-height: 62dvh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; background: #fff; }
.seg.wrap { flex-wrap: wrap; }
.sub { margin: 14px 0 6px; font-size: .95rem; color: var(--muted); font-weight: 700; }
.val-card { background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; border: 0; }
.val-card .facts > div { background: rgba(255,255,255,.14); } .val-card .facts span { color: rgba(255,255,255,.82); } .val-card h2 { color: #fff; }
.val-card .facts b { color: #fff; }

.end > b, .end > span, .grow > b, .grow > span { display: block; }
.end > span.tag, .end > .tag { display: inline-block; }
.mv-reason { font-size: .86rem; color: var(--muted); }

.hscroll { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 8px; margin-inline: -4px; padding-inline: 4px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.hscroll > .stat { flex: 0 0 auto; min-width: 150px; max-width: 220px; scroll-snap-align: start; }
.hscroll > .stat b { white-space: nowrap; }
.facts.big { grid-template-columns: repeat(2, 1fr); }

.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .opts .btn { font-size: .92rem; padding-inline: 10px; } .opts .btn:first-child { grid-column: 1 / -1; }
@media (max-width: 440px) { .rcbox > * { zoom: .84; } }

/* invoice editor: compact header, pinned add button, compact lines, pinned bottom bar */
.card.tight { padding: 12px; } .card.tight .field { margin-top: 0; gap: 4px; } .card.tight .field > label { font-size: .85rem; color: var(--muted); } .card.tight #walkin .two { margin-top: 10px; }
.addbar { position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top)); z-index: 24; padding: 8px 0; background: var(--bg); } .addbar .btn { width: 100%; min-height: 48px; }
.addbar .tag { background: rgba(255,255,255,.25); color: inherit; }
.cl { padding: 8px 10px; } .cl-top b { font-size: .98rem; } .cl-top .lt { font-weight: 800; white-space: nowrap; } .cl-row { margin-top: 6px; }
.stepper button { width: 38px; height: 40px; } .stepper input { width: 56px; height: 40px; } .mini { width: 92px; min-height: 40px; }
.paidline { display: block; border: 0; background: transparent; padding: 0; margin-top: 2px; font-size: .8rem; color: var(--muted); text-align: start; cursor: pointer; } .paidline b { color: var(--text); font-weight: 700; } .paidline b.neg { color: var(--danger); }
.sticky-save .btn { min-height: 46px; padding-inline: 14px; } .sticky-save .tot { font-size: 1.2rem; line-height: 1.2; }
/* full-screen item picker */
.dlg.full { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; background: var(--bg); }
.full-wrap { display: flex; flex-direction: column; height: 100dvh; }
.full-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 8px; background: var(--surface); border-bottom: 1px solid var(--line); }
.full-search { padding: 10px 14px 6px; background: var(--bg); } .full-recent { padding: 0 14px 6px; align-items: center; }
.full-list { flex: 1; overflow-y: auto; padding: 0 14px; -webkit-overflow-scrolling: touch; }
.prow { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); min-height: 60px; cursor: pointer; } .prow.on { background: var(--ok-bg); border-radius: 10px; }
.prow .grow b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.full-foot { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); } .full-foot .btn { width: 100%; min-height: 50px; }

.row2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 8px; } .card.tight .input, .card.tight .select { min-height: 42px; padding: 6px 10px; } .card.tight input[type=date] { padding-inline: 6px; font-size: .92rem; }

/* feature switches (Settings → Inventory): shell.js sets these flags on <html> */
html[data-no-stock] .f-stock, html[data-no-wh] .f-wh, html[data-no-dmg] .f-dmg, html[data-no-barcode] .f-barcode { display: none !important; }
.backbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; font-weight: 700; text-decoration: none; }
.backbtn .ic { transform: scaleX(-1); } [dir="rtl"] .backbtn .ic { transform: none; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; text-decoration: none; color: inherit; padding: 16px 8px; }
.tile .ic { width: 28px; height: 28px; } .tile span { font-weight: 700; color: inherit; font-size: .95rem; }
.backbtn { margin-bottom: 10px; }
#view .back { display: none; }
#page { outline: none; }

/* Licence: features above the current level are hidden; a locked app shows only the licence screen. */
html[data-plan="0"] [data-need], html[data-plan="1"] [data-need="2"], html[data-plan="1"] [data-need="3"], html[data-plan="2"] [data-need="3"] { display: none !important; }
html[data-locked] .tabs, html[data-locked] #bell { display: none !important; }
.licbar { display: flex; align-items: center; gap: 8px; padding: 6px 14px; background: color-mix(in srgb, var(--c4, #eda100) 18%, var(--surface)); border-bottom: 1px solid var(--line); font-size: .85rem; } .licbar[hidden] { display: none; } .licbar span { flex: 1; } .licbar .ic { width: 18px; height: 18px; flex: none; }
.lic-id { font-family: ui-monospace, Menlo, monospace; font-size: 1.4rem; letter-spacing: .12em; direction: ltr; text-align: center; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-2); user-select: all; }
.lic-code { width: 100%; min-height: 110px; font-family: ui-monospace, Menlo, monospace; font-size: .85rem; direction: ltr; }
.full-search { display: flex; gap: 8px; } .full-search input[type=search] { flex: 1; min-width: 0; } .full-catsel { width: auto; }

/* item photos and the barcode scan sheet */
.ph-thumb { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 12px; background: var(--surface-2, #e8edf5); color: var(--muted, #8a96ab); display: inline-grid; place-items: center; overflow: hidden; border: 1px dashed var(--line, #c9d3e3); }
.ph-thumb svg { width: 24px; height: 24px; }
.ph-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-thumb:has(img) { border-style: solid; }
.ph-thumb.sm { width: 44px; height: 44px; border-radius: 10px; margin-inline-end: 10px; }
.ph-thumb.sm svg { width: 20px; height: 20px; }
.ph-big { display: block; width: 100%; max-height: 240px; object-fit: contain; background: var(--surface-2, #eef2f9); border-radius: 12px; margin-bottom: 10px; }
.scan-cam { position: relative; border-radius: 14px; overflow: hidden; background: #000; margin-top: 8px; }
.scan-cam video { display: block; width: 100%; max-height: 46vh; object-fit: cover; }
.scan-frame { position: absolute; inset: 22% 10%; border: 2px solid #4ade80; border-radius: 12px; pointer-events: none; }
