/* ==========================================================================
   HomeBiz Zim - inventory.css
   Toolbar, tables, product cells, stock badges and mobile cards
   Load order: 4 of 7
   ========================================================================== */

/* ---------- Toolbar / inventory ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.search { position: relative; flex: 1 1 230px; min-width: 170px; }
.search .icon { position: absolute; top: 50%; left: 11px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; transform: translateY(-50%); }
.search input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.seg { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-3); }
.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.select {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
}
.select:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.table-card { margin-top: 14px; overflow: hidden; }
.table-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.table-head h2 { font-size: 14.5px; font-weight: 650; letter-spacing: -0.015em; }
.table-head p { margin-top: 1px; color: var(--muted); font-size: 11.5px; }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 700px; border-collapse: collapse; }
thead th {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
thead th.right { text-align: right; }
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.product { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand-text);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.avatar.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 10.5px; }
.avatar[data-tone="0"] { background: var(--brand-soft); color: var(--brand-text); }
.avatar[data-tone="1"] { background: var(--blue-soft); color: var(--blue); }
.avatar[data-tone="2"] { background: var(--green-soft); color: var(--green); }
.avatar[data-tone="3"] { background: var(--amber-soft); color: var(--amber); }
.avatar[data-tone="4"] { background: var(--violet-soft); color: var(--violet); }
.avatar[data-tone="5"] { background: var(--teal-soft); color: var(--teal); }
.product-main { min-width: 0; }
.product-main strong { display: block; max-width: 290px; overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.product-main small { display: block; overflow: hidden; color: var(--muted); font-size: 10.8px; text-overflow: ellipsis; white-space: nowrap; }
.stock-cell { display: flex; align-items: center; gap: 8px; }
.stock-cell strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.margin-badge { display: inline-block; padding: 2px 7px; border-radius: 6px; background: var(--green-soft); color: var(--green); font-size: 10.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.margin-badge.neg { background: var(--red-soft); color: var(--red); }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.inventory-cards { display: none; }
.inv-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.inv-card:last-child { border-bottom: 0; }
.inv-card-main { flex: 1; min-width: 0; }
.inv-card-main strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.inv-card-main small { display: block; overflow: hidden; color: var(--muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.inv-card-main .badge { margin-top: 5px; }
.inv-card-actions { display: flex; flex: none; align-items: center; gap: 1px; }
