/* Inventory: only what is its own. The base (theme tokens from the site theme, inputs, buttons, tabs, cards, notes,
 * toolbars, the top bar, form grids) is shared/biz/app.css. Here: the product table, KPIs, stock levels and histories, the
 * scan screen and the forms. At 390 px the product table stacks and nothing scrolls sideways. */
.fhint { color: var(--mute); font-size: 12.5px; margin: 6px 0; }
.h2 { font-size: 15px; }
.h3 { font-size: 14px; margin: 0 0 4px; }
.brand { display: inline-flex; color: var(--accent); }
.brand-mark { width: 26px; height: 26px; }
.main { max-width: 1100px; }
.ok-line { color: var(--ok); }
.form-error { color: var(--danger); }
.toolbar label, .scan-bar label, .card label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--mute); min-width: 0; }
.toolbar .grow { flex: 1 1 200px; }
input[type="number"] { width: 110px; }
.search { flex: 1 1 220px; }
.card > label { margin: 6px 0; }
.check { flex-direction: row !important; align-items: center; color: var(--ink) !important; }
.forms { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.forms .card { display: flex; flex-direction: column; gap: 6px; }
/* the product form (js/ui/product-form.js) is the products view's right panel */
.pfields { display: grid; gap: 8px; }
.pform .sui-input { width: 100%; box-sizing: border-box; }
.pform .h2 { margin: 0; overflow-wrap: anywhere; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.kpi span { display: block; color: var(--mute); font-size: 12px; }
.kpi b { font-size: 20px; font-variant-numeric: tabular-nums; }

/* product table: a header row on wide screens, stacked rows on narrow ones */
.row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: center; padding: 9px 12px; border-top: 1px solid var(--line); cursor: pointer; min-width: 0; }
.row.head { border-top: 0; cursor: default; color: var(--mute); font-size: 12px; background: var(--panel-2); }
.row:not(.head):hover, .row:not(.head):focus-visible { background: var(--panel-2); }
.row > span { min-width: 0; overflow-wrap: anywhere; }
.c-name { display: flex; flex-direction: column; }
.is-low .c-name b { color: var(--warn); }
.badge { margin-left: 6px; font-size: 11px; padding: 1px 6px; border-radius: 999px; background: var(--chip); }
.badge.warn { color: var(--warn); border: 1px solid var(--warn); }
@media (max-width: 600px) {
  .row.head { display: none; }
}

/* levels, histories and logs */
.levels, .history, .log, .report { list-style: none; margin: 0; padding: 0; }
.levels li, .history li, .log li, .report li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.levels li > span:first-child, .log .lname { flex: 1 1 160px; min-width: 0; }
.levels li.out b, .history li.out b, .rep-error { color: var(--danger); }
.levels li.in b, .history li.in b { color: var(--ok); }
.history li > span:nth-child(2) { flex: 1 1 140px; }
.report li { font-size: 13px; }
.rep-new { color: var(--ok); }
.rep-update { color: var(--mute); }
.rep-ok { color: var(--ok); }
.report-box { margin-top: 10px; max-height: 50vh; overflow: auto; min-width: 0; }
.file { margin-top: 10px; }
.form-error:empty, .ferr:empty { display: none; }
.ferr { color: var(--danger); font-size: 12px; }
.sui-dlg.wide { width: min(680px, 100%); }
.qty { width: 84px !important; }

/* scan */
.scan-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { min-height: 34px; padding: 0 12px; border: 0; background: var(--panel-2); cursor: pointer; color: var(--mute); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.camera { margin-bottom: 12px; }
.camera video { width: 100%; max-height: 300px; background: #000; border-radius: 10px; object-fit: cover; }
.scanfield { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.scanfield label { font-weight: 600; font-size: 13px; }
#scanInput { min-height: 52px; font-size: 22px; font-family: "JetBrains Mono", ui-monospace, monospace; padding: 0 12px; }
.result { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 12px; min-height: 120px; margin-bottom: 8px; }
.res-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.code { font-size: 18px; font-weight: 600; }
.res-prod { margin: 8px 0 2px; font-size: 16px; }
.res-stock { margin: 0 0 6px; color: var(--mute); }
.res-msg { margin: 6px 0; }
.res-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.link-row { display: flex; flex-wrap: wrap; gap: 8px; }
.link-row select { flex: 1 1 200px; }
.pill { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--chip); font-weight: 600; }
.pill.s-received, .pill.s-sold, .pill.s-counted, .pill.s-found { color: var(--ok); }
.pill.s-refused, .pill.s-rejected { color: var(--danger); }
.pill.s-unknown { color: var(--warn); }
.log-row.s-undone { opacity: .55; text-decoration: line-through; }
.log-row { cursor: context-menu; }
.log-row:focus-visible { background: var(--panel-2); }
.lmsg { flex: 1 1 100%; }
.pform { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.frow { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--mute); }
.flabel { color: var(--ink); font-weight: 600; }
.import { display: flex; flex-direction: column; gap: 6px; }
