/* =====================================================================
   Inventory lookup — components on top of the shared design system
   ===================================================================== */
.page-head.compact { margin-bottom: 1.5rem; }
.neg { color: var(--c-danger) !important; }
.pos { color: var(--c-done) !important; }
.warn { color: var(--c-review); }
.ltr-in { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.tbl td.ltr-in { display: table-cell; text-align: right; }
.tbl th.num, .tbl td.num { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grow { flex: 1; }
.actions form { display: inline-flex; }
.cdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--cc, var(--gold)); box-shadow: 0 0 9px var(--cc, var(--gold));
  margin-inline-end: .45rem; vertical-align: middle; flex: none; }
.tips { margin: 0; padding-inline-start: 1.1rem; display: grid; gap: .55rem; color: var(--muted); line-height: 1.9; text-align: justify; }
.tips b { color: var(--text); }
.chips-cloud { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: center; align-items: center; }
.chips-cloud .tag b { color: var(--gold-ink); margin-inline-start: .25rem; }
.tag.on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }
.checks { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; margin: .4rem 0 1rem; justify-content: center; }
@media (max-width: 860px) { .hide-sm { display: none; } }

/* ---------------------------------------------------------------- hero search + suggestions */
.hero-search { position: relative; max-width: 860px; margin: 0 auto 1.8rem; display: flex; align-items: center; gap: .6rem;
  padding: .45rem .45rem .45rem .45rem; padding-inline-start: 1.1rem; border-radius: 22px;
  background: var(--glass-strong); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); transition: border-color .25s, box-shadow .25s; z-index: 30; }
.hero-search:focus-within { border-color: var(--gold); box-shadow: var(--shadow-lg), var(--ring); }
.hero-search > svg { width: 22px; height: 22px; color: var(--gold); flex: none; }
.hero-search input[type=search] { flex: 1; border: 0 !important; background: transparent !important; box-shadow: none !important;
  font-size: 1.08rem; padding: .7rem .2rem; min-width: 0; color: var(--heading); }
.hero-search input[type=search]::-webkit-search-cancel-button { display: none; }
.hero-search.big input[type=search] { font-size: 1.2rem; padding: .95rem .2rem; }
.hero-search .btn { flex: none; }
.hero-search .clear { width: 36px; height: 36px; flex: none; }
.hero-search .spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--gold); opacity: 0; flex: none; }
.hero-search.busy .spin { opacity: 1; animation: spin360 .7s linear infinite; }
@keyframes spin360 { to { transform: rotate(360deg); } }

.suggest { position: absolute; top: calc(100% + 8px); right: 0; left: 0; list-style: none; margin: 0; padding: .4rem; border-radius: 18px;
  background: var(--solid); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px); display: none; max-height: 420px; overflow: auto; }
.suggest.open { display: block; animation: sgIn .16s ease-out; }
@keyframes sgIn { from { opacity: 0; transform: translateY(-4px); } }
.suggest li { display: flex; align-items: center; gap: 1rem; padding: .62rem .9rem; border-radius: 12px; cursor: pointer; }
.suggest li.sel, .suggest li:hover { background: var(--gold-soft); }
.suggest .s-name { flex: 1; color: var(--text); }
.suggest .s-meta { display: flex; align-items: center; gap: .55rem; color: var(--faint); font-size: .78rem; white-space: nowrap; }
.s-bar { display: inline-block; width: 44px; height: 4px; border-radius: 4px; background: var(--line-2); position: relative; overflow: hidden; }
.s-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--btn-bg); border-radius: 4px; }
mark { background: none; color: var(--gold-ink); font-weight: 800; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--gold) 55%, transparent);
  text-underline-offset: 5px; text-decoration-thickness: 2px; }

/* ---------------------------------------------------------------- toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; align-items: center; justify-content: space-between; margin: 0 0 1.1rem; }
.seg-group { display: flex; flex-wrap: wrap; gap: .45rem; }
.tool-right { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; }
.cchip { display: inline-flex; align-items: center; gap: .1rem; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; user-select: none;
  padding: .42rem .85rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--btn2-bg); color: var(--faint); transition: all .2s; }
.cchip .cdot { opacity: .35; box-shadow: none; }
.cchip.on { color: var(--heading); border-color: color-mix(in srgb, var(--cc) 60%, transparent); background: color-mix(in srgb, var(--cc) 14%, transparent); }
.cchip.on .cdot { opacity: 1; box-shadow: 0 0 9px var(--cc); }
.warn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c-review); margin-inline-start: .4rem; display: inline-block; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--btn2-bg); border: 1px solid var(--line); }
.seg button { font: inherit; font-size: .8rem; border: 0; background: none; color: var(--muted); padding: .32rem .8rem; border-radius: 9px; cursor: pointer; }
.seg button.on { background: var(--btn-bg); color: var(--btn-fg); font-weight: 800; }

.status-line { text-align: center; color: var(--muted); font-size: .86rem; min-height: 1.4rem; margin-bottom: .9rem; }
.status-line b { color: var(--heading); }

/* ---------------------------------------------------------------- per-company summary */
.sum-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem; margin-bottom: 1.2rem; }
.sum-card { position: relative; overflow: hidden; padding: 1rem 1.1rem; border-radius: 18px; text-align: center;
  background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(16px); animation: sgIn .3s ease-out; }
.sum-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--cc); opacity: .9; }
.sum-card.has { border-color: color-mix(in srgb, var(--cc) 35%, transparent); }
.sum-card.nohas { opacity: .7; }
.sc-head { display: flex; align-items: center; justify-content: center; font-size: .9rem; }
.sc-val { font-size: 1.45rem; font-weight: 900; color: var(--heading); margin: .35rem 0 .15rem; font-variant-numeric: tabular-nums; }
.sc-val small { font-size: .72rem; color: var(--muted); font-weight: 600; }
.sc-val .none { font-size: .95rem; color: var(--faint); font-weight: 700; }
.sc-foot { font-size: .74rem; color: var(--faint); }
.plus { color: var(--faint); margin: 0 .3rem; font-weight: 400; }

/* ---------------------------------------------------------------- result matrix */
.tbl.mx th.cc { color: var(--text); }
.tbl.mx th.cc .cdot { width: 7px; height: 7px; }
.tbl.mx th.sortable { cursor: pointer; user-select: none; }
.tbl.mx th.sortable:hover { color: var(--gold-ink); }
.tbl.mx td, .tbl.mx th { padding: .7rem .8rem; }
.tbl.mx .ck { width: 34px; text-align: center; }
.tbl.mx .ck input { accent-color: var(--gold); width: 16px; height: 16px; cursor: pointer; }
.tbl.mx tr.vrow { cursor: pointer; }
.tbl.mx tr.vrow.off { opacity: .5; }
.tbl.mx tr.vrow.open td { background: var(--gold-soft); }
.vname { font-weight: 700; color: var(--heading); line-height: 1.7; }
.vmeta { display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-size: .74rem; color: var(--faint); margin-top: .1rem; }
.vmeta .code { direction: ltr; unicode-bidi: isolate; }
.vmeta .alias { color: var(--violet); }
.tbl.mx td.num .q { font-weight: 800; color: var(--heading); }
.tbl.mx td.num .q.pos { color: var(--c-done); }
.tbl.mx td.num .q.zero { color: var(--faint); font-weight: 600; }
.tbl.mx td.num .q small { font-size: .7rem; color: var(--muted); font-weight: 500; }
.tbl.mx td.num .none { color: var(--faint); opacity: .5; }
.tbl.mx td.total { background: color-mix(in srgb, var(--gold) 5%, transparent); }
.tbl.mx td.sim { white-space: nowrap; font-size: .76rem; color: var(--faint); width: 96px; }
.simbar { display: inline-block; width: 46px; height: 5px; border-radius: 5px; background: var(--line-2); position: relative; overflow: hidden; vertical-align: middle; margin-inline-end: .4rem; }
.simbar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--btn-bg); }
tr.drow > td { background: var(--bg-2); padding: .3rem .8rem .9rem !important; }
table.lines { width: 100%; border-collapse: collapse; font-size: .82rem; }
table.lines th { color: var(--faint); font-weight: 600; text-align: right; padding: .45rem .5rem; border-bottom: 1px solid var(--line); }
table.lines td { padding: .45rem .5rem; border-bottom: 1px dashed var(--line); }
table.lines td.num, table.lines th.num { text-align: center; }

.intro .card-body { padding: 1.6rem; }
.intro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .8rem; }
.intro-c { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1rem; border-radius: 16px; text-align: center;
  background: color-mix(in srgb, var(--cc) 7%, transparent); border: 1px solid color-mix(in srgb, var(--cc) 25%, transparent); }

/* ---------------------------------------------------------------- dashboard company cards */
.ccards { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1rem; }
.ccard { position: relative; padding: 1.1rem 1.15rem 1rem; border-radius: 18px; background: var(--glass-2); border: 1px solid var(--line);
  overflow: hidden; transition: transform .25s, border-color .25s; }
.ccard:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--cc) 45%, transparent); }
.ccard::before { content: ""; position: absolute; width: 160px; height: 160px; border-radius: 50%; top: -90px; left: -50px;
  background: var(--cc); filter: blur(55px); opacity: .22; pointer-events: none; }
.ccard-top { display: flex; align-items: center; gap: .8rem; position: relative; }
.ccard .mono { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 900; font-size: .85rem; flex: none;
  color: var(--cc); background: color-mix(in srgb, var(--cc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--cc) 35%, transparent); }
.ccard h3 { font-size: 1rem; margin: 0; }
.ccard-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin: .95rem 0 .7rem; position: relative; text-align: center; }
.ccard-nums div { display: flex; flex-direction: column; }
.ccard-nums b { font-size: 1.15rem; color: var(--heading); font-variant-numeric: tabular-nums; }
.ccard-nums .neg b { color: var(--c-danger); } .ccard-nums .pos b { color: var(--c-done); }
.ccard-nums span { font-size: .7rem; color: var(--faint); }
.ccard-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem; border-top: 1px solid var(--line); padding-top: .65rem; position: relative; }
.ccard-foot .links { display: flex; gap: .8rem; }
.fresh-ok { color: var(--c-done); background: var(--c-done-bg); }
.fresh-warn { color: var(--c-review); background: var(--c-review-bg); }
.fresh-old { color: var(--c-ret); background: var(--c-ret-bg); }
.fresh-none { color: var(--c-cancel); background: var(--c-cancel-bg); }

/* ---------------------------------------------------------------- import preview */
.steps-bar { display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; font-size: .8rem; }
.steps-bar span { padding: .35rem .9rem; border-radius: 999px; border: 1px solid var(--line-2); color: var(--faint); }
.steps-bar span.on { color: var(--gold-ink); border-color: color-mix(in srgb, var(--gold) 50%, transparent); }
.steps-bar span.cur { background: var(--gold-soft); font-weight: 800; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 1rem; }
.map-grid.fields { margin-top: .4rem; padding-top: 1rem; border-top: 1px dashed var(--line-2); }
.map-f.set select { border-color: color-mix(in srgb, var(--gold) 55%, transparent); }
.map-f.is-req:not(.set) select { border-color: var(--c-danger); }
.kpis.mini { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.kpis.mini .kpi { padding: .9rem .8rem; }
.kpis.mini .kpi .num { font-size: 1.6rem; }
.warn-list { margin: 0; padding-inline-start: 1.1rem; display: grid; gap: .3rem; }
.warn-list b { color: var(--c-review); }
.table-wrap.raw { max-height: 420px; overflow: auto; }
.tbl.raw th, .tbl.raw td { font-size: .78rem; padding: .5rem .65rem; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.tbl.raw th.mapped { color: var(--gold-ink); background: var(--gold-soft); }
.tbl.raw td.mapped { background: color-mix(in srgb, var(--gold) 6%, transparent); color: var(--heading); }
.mtag { display: block; font-size: .66rem; font-weight: 800; color: var(--gold-ink); margin-top: .15rem; }
.sticky-actions { position: sticky; bottom: 5.4rem; z-index: 20; display: flex; gap: .6rem; align-items: center; padding: .8rem 1rem; border-radius: 18px;
  background: var(--glass-strong); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); backdrop-filter: blur(20px); }
.fixed-company { display: flex; align-items: center; padding: .65rem .9rem; border-radius: 12px; font-weight: 800;
  background: color-mix(in srgb, var(--cc) 10%, transparent); border: 1px solid color-mix(in srgb, var(--cc) 35%, transparent); }

/* ---------------------------------------------------------------- compare */
.cmp-head { display: flex; align-items: center; justify-content: center; gap: 1.2rem; margin: 0 auto 1.2rem; flex-wrap: wrap; }
.cmp-side { display: flex; flex-direction: column; align-items: center; padding: .8rem 1.6rem; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); }
.cmp-side b { color: var(--heading); font-size: 1.05rem; }
.cmp-arrow { display: flex; flex-direction: column; align-items: center; color: var(--gold); font-size: .78rem; }
.cmp-arrow svg { width: 26px; height: 26px; }
.cmp-form { margin-bottom: 1.3rem; }
.c-consumed { color: var(--c-ret); background: var(--c-ret-bg); }
.c-removed { color: var(--c-review); background: var(--c-review-bg); }
.c-increased { color: var(--c-done); background: var(--c-done-bg); }
.c-new { color: var(--c-new); background: var(--c-new-bg); }
.c-same { color: var(--c-cancel); background: var(--c-cancel-bg); }

/* ---------------------------------------------------------------- admin */
.role-importer { color: var(--c-prog); background: var(--c-prog-bg); }
.role-manager { color: var(--violet); background: color-mix(in srgb, var(--violet) 13%, transparent); }
.role-admin { color: var(--gold-ink); background: var(--gold-soft); }
.a-login { color: var(--c-done); background: var(--c-done-bg); }
.a-login_failed, .a-locked, .a-delete_snapshot { color: var(--c-ret); background: var(--c-ret-bg); }
.a-commit, .a-upload { color: var(--c-new); background: var(--c-new-bg); }
.a-search, .a-export, .a-compare { color: var(--c-prog); background: var(--c-prog-bg); }
.role-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .6rem; }
.role-opt { cursor: pointer; }
.role-opt input { position: absolute; opacity: 0; }
.role-opt span { display: flex; flex-direction: column; gap: .2rem; height: 100%; padding: .8rem 1rem; border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--input-bg); transition: all .2s; text-align: center; }
.role-opt small { color: var(--faint); font-size: .76rem; line-height: 1.7; }
.role-opt input:checked + span { border-color: var(--gold); background: var(--gold-soft); box-shadow: var(--ring); }
.role-opt input:focus-visible + span { box-shadow: var(--ring); }
.swatches { display: flex; flex-wrap: wrap; gap: .45rem; padding-top: .3rem; }
.swatches input { position: absolute; opacity: 0; }
.swatches span { display: block; width: 28px; height: 28px; border-radius: 9px; cursor: pointer; border: 2px solid transparent; transition: transform .15s; }
.swatches input:checked + span { border-color: var(--heading); transform: scale(1.12); }
td.ua { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager { display: flex; justify-content: center; align-items: center; gap: .8rem; padding: 1rem; }

@media (max-width: 860px) {
  .hero-search { flex-wrap: wrap; }
  .hero-search .btn { width: 100%; }
  .toolbar { justify-content: center; }
  .ccard-nums { grid-template-columns: repeat(2, 1fr); }
  .sticky-actions { flex-wrap: wrap; bottom: 4.8rem; }
}
@media print {
  .hero-search, .toolbar, .sticky-actions { display: none; }
}
.tbl td.title .ltr-in { display: block; direction: ltr; text-align: right; }
.card-head h2 svg { width: 18px; height: 18px; vertical-align: -3px; color: var(--gold); margin-inline-end: .3rem; }
.tbl td div.ltr-in { display: block; text-align: right; }

/* ---------------------------------------------------------------- v1.1: warehouses, watch list, item history */
.drop { display: block; cursor: pointer; }
.drop .t { margin-top: .6rem; }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 10px; flex: none; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.whlist { list-style: none; margin: .9rem 0 0; padding: 0; position: relative; display: grid; gap: .35rem; }
.whlist li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .25rem .6rem; padding: .55rem .75rem; border-radius: 12px;
  background: color-mix(in srgb, var(--cc) 5%, transparent); border: 1px solid var(--line); font-size: .84rem; }
.wh-name { font-weight: 700; color: var(--heading); }
.wh-meta { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; color: var(--muted); font-size: .78rem; }
.wh-meta:empty { display: none; }
.wh-meta a { color: var(--muted); }
.wh-meta a:hover { color: var(--gold-ink); }
.wh-delta { display: inline-flex; gap: .35rem; font-weight: 800; }
.wh-line { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; padding: .18rem 0; }
.wh-line > span:first-child { font-weight: 700; min-width: 90px; }
.wh-line.off, tr.off { opacity: .55; }
.wh-edit input[type=text] { min-width: 140px; }
.wh-add { display: flex; flex-wrap: wrap; gap: .6rem; padding: 1rem 1.35rem; justify-content: center; border-top: 1px solid var(--line); }
.wh-add input[type=text] { flex: 1; min-width: 220px; max-width: 420px; }

.sc-wh { list-style: none; margin: .4rem 0 .5rem; padding: .45rem 0 0; border-top: 1px dashed var(--line-2); display: grid; gap: .2rem; font-size: .78rem; }
.sc-wh li { display: flex; justify-content: space-between; gap: .6rem; color: var(--muted); }
.sc-wh b { color: var(--text); font-weight: 700; }
.sc-wh .q { font-weight: 700; }
.tbl.mx th.cc small.sup { display: block; font-size: .66rem; color: var(--faint); font-weight: 500; }
.tbl.mx th.cc.first, .tbl.mx td.first { border-inline-start: 1px solid var(--line); }
.d-actions { display: flex; justify-content: flex-start; padding: .6rem .2rem 0; }

.watch { list-style: none; margin: 0; padding: 0; }
.watch li { padding: .8rem 1.2rem; border-bottom: 1px solid var(--line); }
.watch li:last-child { border-bottom: 0; }
.w-head { display: flex; align-items: center; gap: .5rem; }
.w-title { flex: 1; font-weight: 800; color: var(--heading); }
.w-title:hover { color: var(--gold-ink); }
.w-head form { display: inline-flex; }
.w-head .x { border: 0; background: none; color: var(--faint); cursor: pointer; padding: .2rem; border-radius: 8px; }
.w-head .x:hover { color: var(--c-danger); background: var(--c-ret-bg); }
.w-head .x svg { width: 15px; height: 15px; }
.w-per { display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin-top: .35rem; font-size: .82rem; font-variant-numeric: tabular-nums; }
.w-c { display: inline-flex; align-items: center; color: var(--heading); font-weight: 800; }
.w-c small { color: var(--muted); font-weight: 500; margin-inline-start: .2rem; }
.w-c.nohas { color: var(--faint); font-weight: 600; }

svg.chart { width: 100%; height: auto; direction: ltr; display: block; }
svg.chart .grid { stroke: var(--line); stroke-width: 1; }
svg.chart text { fill: var(--faint); font-size: 11px; font-family: inherit; }
.legend.inline { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.4rem; margin: .8rem 0 0; }
