/* SIMMER — stock list, freshness board, scan console, shopping list */

/* ---------- toolbar above lists ---------- */
.toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar .search { flex: 1; min-width: 200px; position: relative; }
.toolbar .search input { padding-left: 32px; }
.toolbar .search::before {
  content: "⌕"; position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); font-size: 16px; pointer-events: none;
}

/* ---------- stat strip ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
  background: var(--paper-2); border: 1px solid var(--shade);
  border-radius: var(--r); padding: 12px 14px;
  border-left: 3px solid var(--shade-2);
}
.stat .k { font-size: 10.5px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-3); }
.stat .v { font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1.15; margin-top: 3px; font-variant-numeric: tabular-nums; }
.stat.fresh   { border-left-color: var(--fresh); }
.stat.soon    { border-left-color: var(--soon); }   .stat.soon .v    { color: #8a6a12; }
.stat.urgent  { border-left-color: var(--urgent); } .stat.urgent .v  { color: var(--urgent); }
.stat.expired { border-left-color: var(--expired); }.stat.expired .v { color: var(--expired); }

/* ---------- stock table ---------- */
.tbl-wrap { background: var(--paper-2); border: 1px solid var(--shade); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left; padding: 9px 12px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); background: var(--paper);
  border-bottom: 1px solid var(--shade-2); white-space: nowrap;
  position: sticky; top: var(--bar); z-index: 5; cursor: pointer; user-select: none;
}
table.tbl th:hover { color: var(--ink); }
table.tbl th .sortcue { font-size: 8px; margin-left: 4px; color: var(--pine); }
table.tbl th.sorted { color: var(--pine); background: var(--pine-lt); }

/* the "added on" column — asked for prominently, so it gets real weight */
.t-added { font-weight: 600; color: var(--ink); }
.t-sub { font-size: 10.5px; font-weight: 500; color: var(--ink-3); margin-top: 1px; }

.grp-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--ink-2); white-space: nowrap; cursor: pointer;
}
.grp-toggle input { width: 16px; height: 16px; accent-color: var(--pine); cursor: pointer; }
table.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--shade); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr { cursor: pointer; }
table.tbl tbody tr:hover { background: var(--enamel); }
table.tbl tbody tr[data-fresh="expired"] { background: var(--expired-bg); }
table.tbl tbody tr[data-fresh="expired"]:hover { background: #f3d4d4; }
.t-name { font-weight: 600; }
.t-brand { font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.t-loc { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.t-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t-actions { text-align: right; white-space: nowrap; }
.t-actions .btn { opacity: 0; }
table.tbl tbody tr:hover .t-actions .btn { opacity: 1; }

/* group header row (grouped by zone) */
tr.grp td {
  background: var(--shade); font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2);
  padding: 6px 12px;
}

/* ---------- freshness board ---------- */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px,1fr)); gap: 16px; }
.bcol { background: var(--paper-2); border: 1px solid var(--shade); border-radius: var(--r-lg); overflow: hidden; }
.bcol-head { padding: 10px 14px; border-bottom: 1px solid var(--shade); display: flex; align-items: center; gap: 8px; }
.bcol-head h3 { font-size: 14.5px; flex: 1; }
.bcol-head .n { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.bcol[data-k=expired] .bcol-head { background: var(--expired-bg); color: var(--expired); }
.bcol[data-k=urgent]  .bcol-head { background: var(--urgent-bg);  color: var(--urgent); }
.bcol[data-k=soon]    .bcol-head { background: var(--soon-bg);    color: #8a6a12; }
.bcol[data-k=fresh]   .bcol-head { background: var(--fresh-bg);   color: var(--fresh); }
.bcol-list { padding: 8px; display: flex; flex-direction: column; gap: 5px; max-height: 60vh; overflow-y: auto; }

/* ---------- scan console ---------- */
.scan-wrap { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: 20px; align-items: start; }
.scanbox { background: var(--ink); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-2); }
.scanbox .reader { width: 100%; min-height: 260px; background: #14160f; display: flex; align-items: center; justify-content: center; }
.scanbox .reader video { width: 100% !important; display: block; }
.scanbox .reader-idle { color: rgba(244,239,228,.5); font-size: 13px; text-align: center; padding: 40px 20px; }
.scanbox .scanbar { padding: 12px; display: flex; gap: 8px; align-items: center; }
.scanbox .scanbar .btn { flex: 1; justify-content: center; }

/* the big manual-entry field — barcode wedge scanners type into this */
.wedge {
  display: flex; gap: 8px; margin-bottom: 14px;
}
.wedge input {
  font-family: var(--mono); font-size: 17px; letter-spacing: .06em;
  padding: 12px 14px;
}
.wedge .btn { padding: 12px 18px; }

/* the receiving slip — what you're about to add */
.slip { background: var(--enamel); border: 1px solid var(--shade-2); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.slip-head {
  padding: 12px 16px; border-bottom: 1px dashed var(--shade-2);
  display: flex; align-items: center; gap: 10px;
}
.slip-head .plate { width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--copper-lt); display: flex; align-items: center; justify-content: center; font-size: 22px; overflow: hidden; flex: none; }
.slip-head .plate img { width: 100%; height: 100%; object-fit: cover; }
.slip-head h3 { font-size: 16px; }
.slip-head .code { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.slip-body { padding: 16px; }

/* recent scans ticker */
.recent { margin-top: 16px; }
.recent-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px;
  font-size: 13px; border-bottom: 1px solid var(--shade);
}
.recent-item:last-child { border-bottom: 0; }
.recent-item .rt { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- shopping list ---------- */
.shop-list { display: flex; flex-direction: column; gap: 2px; }
.shop-row {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-bottom: 1px solid var(--shade);
  font-size: 14px;
}
.shop-row:last-child { border-bottom: 0; }
.shop-row.done { opacity: .45; }
.shop-row.done .sname { text-decoration: line-through; }
.shop-row .sname { flex: 1; font-weight: 500; }
.shop-row .sqty { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.shop-row .swhy { font-size: 11.5px; color: var(--ink-3); }
.shop-row input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--pine); cursor: pointer; flex: none; }

@media (max-width: 900px) {
  .scan-wrap { grid-template-columns: 1fr; }
  table.tbl .hide-sm { display: none; }
}
