/* INVENTORY_0_FOUNDATION — shared component classes for the warehouse
   inventory system. Agents A–F use these classes; they do not edit this file.
   Built on the design tokens in style.css (var(--gold), var(--bg-card), etc.).
   Responsive at 375 / 768 / 1280px; touch targets >= 44px. */

/* ---- page shell -------------------------------------------------------- */
.inv-shell { max-width: 1100px; margin: 0 auto; padding: 4px 0 48px; }
.inv-shell h1 { font-size: 22px; margin: 0 0 4px; }
.inv-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 16px 0; }
.inv-toolbar .inv-spacer { flex: 1 1 auto; }

/* ---- nesting tree ------------------------------------------------------ */
.inv-tree { display: flex; flex-direction: column; gap: 2px; }
.inv-tree__node {
  display: flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 6px 10px;
  border: 1px solid transparent; border-radius: 8px;
  color: var(--text); text-decoration: none; cursor: pointer; }
.inv-tree__node:hover { background: var(--bg-hover); }
.inv-tree__node.is-active { border-color: var(--gold); }
.inv-tree__node[data-depth="1"] { margin-left: 18px; }
.inv-tree__node[data-depth="2"] { margin-left: 36px; }
.inv-tree__node[data-depth="3"] { margin-left: 54px; }
.inv-tree__node[data-depth="4"] { margin-left: 72px; }
.inv-tree__toggle {
  flex: 0 0 24px; width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; color: var(--text-sec); cursor: pointer;
  transition: transform .12s ease; }
.inv-tree__toggle.is-open { transform: rotate(90deg); }
.inv-tree__toggle.is-leaf { visibility: hidden; }
.inv-tree__label { flex: 1 1 auto; font-variant-numeric: tabular-nums; }
.inv-tree__label small { color: var(--text-sec); margin-left: 8px; }
.inv-tree__badge {
  flex: 0 0 auto; min-width: 22px; padding: 2px 7px;
  font-size: 12px; text-align: center;
  background: var(--bg-input); color: var(--text-sec);
  border-radius: 999px; }
.inv-tree__badge.has-items { background: rgba(240,185,11,.14); color: var(--gold); }

/* ---- location detail card --------------------------------------------- */
.inv-loc-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 18px; margin-bottom: 16px; }
.inv-loc-header {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px;
  margin-bottom: 6px; }
.inv-loc-header h2 { margin: 0; font-size: 24px; letter-spacing: .5px; }
.inv-loc-meta { color: var(--text-sec); font-size: 13px;
  display: flex; flex-wrap: wrap; gap: 12px; }
.inv-loc-breadcrumb { color: var(--text-sec); font-size: 13px; margin-bottom: 12px; }
.inv-loc-breadcrumb a { color: var(--text-sec); text-decoration: none; }
.inv-loc-breadcrumb a:hover { color: var(--gold); }

/* ---- contents list ----------------------------------------------------- */
.inv-contents { display: flex; flex-direction: column; gap: 6px; }
.inv-contents__item {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 8px 12px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; }
.inv-contents__item .sku { font-weight: 600; font-variant-numeric: tabular-nums; }
.inv-contents__item .title { color: var(--text-sec); flex: 1 1 auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- scan ui ----------------------------------------------------------- */
.inv-scan { max-width: 640px; margin: 0 auto; }
.inv-scan__input {
  width: 100%; height: 60px; font-size: 22px; text-align: center;
  letter-spacing: 2px; text-transform: uppercase;
  background: var(--bg-input); color: var(--text);
  border: 2px solid var(--gold); border-radius: 8px; }
.inv-scan__input:focus { outline: none; box-shadow: 0 0 0 3px rgba(240,185,11,.25); }
.inv-scan__camera {
  width: 100%; aspect-ratio: 4 / 3; margin-top: 14px;
  background: #000; border: 1px solid var(--border); border-radius: 8px;
  object-fit: cover; }
.inv-scan__hint { color: var(--text-sec); font-size: 13px; text-align: center;
  margin-top: 10px; }

/* ---- move modal -------------------------------------------------------- */
.inv-move-modal {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.6); padding: 16px; }
.inv-move-modal[hidden] { display: none; }
.inv-move-modal__body {
  width: 100%; max-width: 460px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; }

/* ---- bin sizes catalog ------------------------------------------------- */
.inv-sizes-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.inv-size-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 16px; }
.inv-size-card h3 { margin: 0 0 4px; font-size: 16px; }
.inv-size-card .dims { color: var(--text-sec); font-size: 13px;
  font-variant-numeric: tabular-nums; }
.inv-size-card .cubic { color: var(--gold); font-weight: 600; margin-top: 8px; }

/* ---- import wizard ----------------------------------------------------- */
.inv-import { max-width: 720px; }
.inv-import__drop {
  border: 2px dashed var(--border); border-radius: 12px;
  padding: 40px 20px; text-align: center; color: var(--text-sec);
  background: var(--bg-card); }
.inv-import__map {
  display: grid; gap: 12px; grid-template-columns: 1fr 1fr;
  margin: 16px 0; }
.inv-import__preview {
  overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.inv-import__preview table { width: 100%; border-collapse: collapse;
  font-size: 13px; }
.inv-import__preview th, .inv-import__preview td {
  padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--border);
  white-space: nowrap; }

/* ---- movements ledger -------------------------------------------------- */
.inv-movements { width: 100%; border-collapse: collapse; font-size: 14px; }
.inv-movements th, .inv-movements td {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.inv-movements th { color: var(--text-sec); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .5px; }
.inv-movements__row .code { font-variant-numeric: tabular-nums; }
.inv-movements__row .action { text-transform: capitalize; color: var(--text-sec); }

/* ---- cubic usage bar --------------------------------------------------- */
.inv-cubic-bar {
  position: relative; height: 10px; border-radius: 999px;
  background: var(--bg-input); overflow: hidden; margin: 8px 0; }
.inv-cubic-bar__fill { position: absolute; inset: 0 auto 0 0;
  background: var(--green); border-radius: 999px; transition: width .2s ease; }
.inv-cubic-bar__fill.is-mid { background: var(--gold); }
.inv-cubic-bar__fill.is-full { background: var(--red); }

/* ---- chips + empty ----------------------------------------------------- */
.inv-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; font-size: 12px; border-radius: 999px;
  background: var(--bg-input); color: var(--text-sec);
  border: 1px solid var(--border); }
.inv-empty { text-align: center; color: var(--text-dim);
  padding: 40px 20px; font-size: 14px; }

/* ---- responsive -------------------------------------------------------- */
@media (max-width: 768px) {
  .inv-import__map { grid-template-columns: 1fr; }
  .inv-loc-header h2 { font-size: 20px; }
}
@media (max-width: 600px) {
  /* movements + import tables collapse to stacked cards */
  .inv-movements thead { display: none; }
  .inv-movements, .inv-movements tbody, .inv-movements tr, .inv-movements td {
    display: block; width: 100%; }
  .inv-movements__row {
    margin-bottom: 8px; border: 1px solid var(--border); border-radius: 8px;
    padding: 4px 0; }
  .inv-movements__row td { border-bottom: 0; padding: 4px 12px; }
  .inv-movements__row td::before {
    content: attr(data-label); display: inline-block; width: 84px;
    color: var(--text-sec); font-size: 12px; }
  .inv-sizes-grid { grid-template-columns: 1fr; }
}

/* SnowUI elevation on the warehouse inventory cards (additive). */
.inv-loc-card,
.inv-size-card,
.inv-movements { box-shadow: var(--shadow-sm); }
