/*
 * Shemify Inventory v1 — Stock tab + Adjust modal
 * Glass theme. Matches prod-v2 + shemify-ui conventions.
 */

/* ------------------------------------------------------------
 * Sub-tab bar (Catalog | Stock) inside Products panel
 * ------------------------------------------------------------ */
.prod-subtabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  background: rgba(255, 255, 255, .02);
  border-radius: var(--r-sm, 10px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
  margin-bottom: 20px;
}

.prod-subtab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  border-radius: calc(var(--r-sm, 10px) - 2px);
  cursor: pointer;
  transition: all .22s var(--spring, cubic-bezier(.16, 1, .3, 1));
}

.prod-subtab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, .03);
}

.prod-subtab.is-active {
  background: linear-gradient(135deg, rgba(200, 160, 76, .14), rgba(200, 160, 76, .06));
  color: var(--gold);
  box-shadow:
    inset 0 0 0 1px rgba(200, 160, 76, .18),
    0 2px 8px rgba(200, 160, 76, .08);
}

.prod-subtab svg { flex: 0 0 auto; }

/* Hide the Catalog-only topbar actions on non-catalog tabs */
[data-prod-active="stock"] [data-prod-topbar-for="catalog"] { display: none; }

/* Categories mode (standalone Categories screen) reuses the Products panel —
   hide the Stock sub-tab in that context. Stock only applies to Products. */
#settings-page[data-surface-mode="categories"] .prod-v2 .prod-subtabs,
#settings-page[data-surface-mode="categories"] .prod-v2 [data-prod-subtab-view="stock"] {
  display: none;
}

/* ------------------------------------------------------------
 * Enable-inventory banner (pre-migration)
 * ------------------------------------------------------------ */
.inv-enable-banner {
  position: relative;
  padding: 28px;
  border-radius: var(--r-lg, 20px);
  background: linear-gradient(180deg, rgba(200, 160, 76, .06) 0%, rgba(200, 160, 76, .02) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(200, 160, 76, .18),
    0 4px 16px rgba(0, 0, 0, .25),
    0 0 40px rgba(200, 160, 76, .04);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 640px;
  margin: 20px 0;
}

.inv-enable-banner[hidden] { display: none; }

.inv-enable-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.inv-enable-head svg {
  flex: 0 0 auto;
  color: var(--gold);
  filter: drop-shadow(0 0 8px rgba(200, 160, 76, .3));
}

.inv-enable-head h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
}

.inv-enable-head p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
}

.inv-enable-banner button {
  align-self: flex-start;
}

.inv-enable-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.inv-enable-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  overflow: hidden;
  position: relative;
}

.inv-enable-bar #inv-enable-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-bright, #D4B060) 100%);
  box-shadow: 0 0 12px rgba(200, 160, 76, .4);
  transition: width .25s var(--spring);
  border-radius: inherit;
}

.inv-enable-progress #inv-enable-status,
.inv-enable-progress-label {
  font-size: 11px;
  color: var(--ink-3);
}

.inv-enable-progress-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  overflow: hidden;
  position: relative;
}

.inv-enable-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-bright, #D4B060) 100%);
  box-shadow: 0 0 12px rgba(200, 160, 76, .4);
  transition: width .25s var(--spring);
  border-radius: inherit;
}

/* ------------------------------------------------------------
 * Main Stock view
 * ------------------------------------------------------------ */
.inv-main-view { display: block; }
.inv-main-view[hidden] { display: none; }

.inv-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.inv-location-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inv-location-picker label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.inv-location-select {
  appearance: none;
  padding: 10px 32px 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background-color: rgba(255, 255, 255, .03);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%239898A8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  border: none;
  border-radius: var(--r-sm, 10px);
  cursor: pointer;
  color-scheme: dark;
  transition: all .2s var(--spring);
}

.inv-location-select:hover {
  background-color: rgba(255, 255, 255, .05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}

.inv-location-select:focus {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(200, 160, 76, .12),
    inset 0 0 0 1px rgba(200, 160, 76, .2);
}

.inv-search-wrap {
  flex: 1 1 240px;
  position: relative;
}

.inv-search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}

.inv-search-wrap input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  font-size: 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, .03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  border: none;
  border-radius: var(--r-sm, 10px);
  transition: all .2s var(--spring);
}

.inv-search-wrap input:focus {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(200, 160, 76, .12),
    inset 0 0 0 1px rgba(200, 160, 76, .2);
}

.inv-toolbar .prod-count {
  margin-left: auto;
}

/* ------------------------------------------------------------
 * Stock table
 * ------------------------------------------------------------ */
.inv-table-wrap {
  border-radius: var(--r-lg, 20px);
  background: linear-gradient(180deg, rgba(255, 255, 255, .025) 0%, rgba(255, 255, 255, .01) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .05),
    0 2px 8px rgba(0, 0, 0, .2);
  overflow: hidden;
}

.inv-table {
  width: 100%;
  border-collapse: collapse;
}

.inv-table thead th {
  padding: 14px 16px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: left;
  background: rgba(255, 255, 255, .015);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.inv-table thead th.num { text-align: right; }

.inv-table tbody td {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--ink);
  border-bottom: 1px solid rgba(255, 255, 255, .03);
  vertical-align: middle;
}

.inv-table tbody tr:last-child td { border-bottom: none; }

.inv-table tbody tr { transition: background .16s ease; }
.inv-table tbody tr:hover { background: rgba(255, 255, 255, .02); }

.inv-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

.inv-table .inv-qty-main {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.inv-table .inv-qty-low    { color: var(--amber, #FBBF24); text-shadow: 0 0 10px rgba(251, 191, 36, .2); }
.inv-table .inv-qty-out    { color: var(--red, #F87171); text-shadow: 0 0 10px rgba(248, 113, 113, .2); }
.inv-table .inv-qty-ok     { color: var(--ink); }

.inv-table .inv-product-name {
  font-weight: 600;
  color: var(--ink);
}

.inv-table .inv-product-sub {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--ink-3);
}

.inv-table .inv-sku {
  font-size: 12px;
  color: var(--ink-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.inv-table .inv-last-move {
  font-size: 12px;
  color: var(--ink-3);
}

.inv-table .inv-damaged {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.inv-table .inv-damaged.has { color: var(--red); }

.inv-row-action-btn {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  background: rgba(255, 255, 255, .04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all .18s var(--spring);
}

.inv-row-action-btn:hover {
  color: var(--gold);
  background: rgba(200, 160, 76, .08);
  box-shadow: inset 0 0 0 1px rgba(200, 160, 76, .18);
}

.inv-loading, .inv-empty-row {
  text-align: center;
  color: var(--ink-3);
  padding: 32px !important;
  font-size: 13px;
}

.inv-empty-state {
  padding: 48px 24px;
  text-align: center;
  border-radius: var(--r-lg, 20px);
  background: linear-gradient(180deg, rgba(255, 255, 255, .02) 0%, rgba(255, 255, 255, .005) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}

.inv-empty-state .inv-empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.inv-empty-state .inv-empty-sub {
  font-size: 13px;
  color: var(--ink-3);
  max-width: 420px;
  margin: 0 auto;
}

/* ------------------------------------------------------------
 * Adjust Stock modal
 * ------------------------------------------------------------ */
.inv-adjust-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inv-adjust-modal[hidden] { display: none; }

.inv-adjust-modal .modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(16px);
  animation: invAdjBdropIn .4s ease forwards;
}

@keyframes invAdjBdropIn {
  from { backdrop-filter: blur(0); background: transparent; }
  to   { backdrop-filter: blur(16px); background: rgba(0, 0, 0, .5); }
}

.inv-adjust-panel {
  position: relative;
  max-width: 480px;
  width: 92vw;
  padding: 28px;
  border-radius: var(--r-xl, 26px);
  background: linear-gradient(180deg, var(--floating, #22222C), var(--elevated, #1A1A22));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .08),
    0 8px 32px rgba(0, 0, 0, .5),
    0 40px 80px rgba(0, 0, 0, .3),
    0 0 60px rgba(200, 160, 76, .04);
  animation: invAdjSpringIn .5s cubic-bezier(.34, 1.4, .64, 1) forwards;
}

@keyframes invAdjSpringIn {
  from { opacity: 0; transform: translateY(24px) scale(.96); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.inv-adjust-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.inv-adjust-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--ink);
  text-shadow: 0 0 20px rgba(200, 160, 76, .05);
}

.inv-adjust-close {
  background: rgba(255, 255, 255, .04);
  border: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
  color: var(--ink-2);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s var(--spring);
}

.inv-adjust-close:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, .08);
}

.inv-adjust-product {
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: var(--r-sm, 10px);
  background: rgba(255, 255, 255, .02);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.inv-adjust-product .inv-adjust-pname {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.inv-adjust-product .inv-adjust-ponhand {
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.inv-adjust-product .inv-adjust-ponhand strong {
  display: inline-block;
  margin-left: 6px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: normal;
  text-transform: none;
  font-size: 15px;
  font-weight: 600;
}

.inv-adjust-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.inv-adjust-field label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.inv-adjust-field select,
.inv-adjust-field input,
.inv-adjust-field textarea {
  padding: 10px 14px;
  font-size: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, .03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  border: none;
  border-radius: var(--r-sm, 10px);
  color-scheme: dark;
  font-family: inherit;
  transition: all .2s var(--spring);
}

.inv-adjust-field select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%239898A8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.inv-adjust-field textarea { resize: vertical; min-height: 60px; }

.inv-adjust-field select:focus,
.inv-adjust-field input:focus,
.inv-adjust-field textarea:focus {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(200, 160, 76, .12),
    inset 0 0 0 1px rgba(200, 160, 76, .2);
}

.inv-adjust-preview {
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: var(--r-sm, 10px);
  background: rgba(200, 160, 76, .05);
  box-shadow: inset 0 0 0 1px rgba(200, 160, 76, .14);
  font-size: 12px;
  color: var(--ink-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inv-adjust-preview strong {
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}

.inv-adjust-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.inv-adjust-message {
  min-height: 18px;
  font-size: 12px;
  color: var(--red);
  margin-top: 8px;
}
.inv-adjust-message.is-success { color: var(--green); }

/* Responsive */
@media (max-width: 640px) {
  .inv-toolbar { flex-direction: column; align-items: stretch; }
  .inv-toolbar .prod-count { margin-left: 0; align-self: flex-start; }
  .inv-table thead { display: none; }
  .inv-table tbody, .inv-table tr, .inv-table td { display: block; width: 100%; }
  .inv-table tbody tr {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .04);
  }
  .inv-table tbody td { padding: 4px 0; border-bottom: none; text-align: left; }
  .inv-table td.num { text-align: left; }
}

/* ═══════════════════════════════════════════════════════════════
 *  Valuation sub-view (Phase 2c)
 * ═══════════════════════════════════════════════════════════════ */

.inv-val-blocked {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 12px;
  padding: 48px 32px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, .03) 0%, rgba(255, 255, 255, .015) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05), 0 2px 8px rgba(0, 0, 0, .2);
  color: var(--ink-3);
}
.inv-val-blocked svg { color: var(--gold); opacity: .8; }
.inv-val-blocked h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.inv-val-blocked p  { margin: 0; font-size: 13px; color: var(--ink-3); max-width: 380px; line-height: 1.5; }

.inv-val-main { display: flex; flex-direction: column; gap: 20px; }
.inv-val-blocked[hidden], .inv-val-main[hidden],
.inv-val-badge-wrap[hidden], .inv-val-legacy-gap[hidden],
.inv-val-kill[hidden] { display: none !important; }

.inv-val-topbar {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.inv-val-head h2 {
  margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.025em; color: var(--ink);
  text-shadow: 0 0 30px rgba(200, 160, 76, .06);
}
.inv-val-head p {
  margin: 4px 0 0; font-size: 12px; color: var(--ink-3);
}
.inv-val-topbar-actions {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
}

/* Kill-switch + badge row */
.inv-val-kill {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.inv-val-kill:has(.inv-val-badge-wrap[hidden]) { grid-template-columns: 1fr; }
@media (max-width: 820px) {
  .inv-val-kill { grid-template-columns: 1fr; }
}

.inv-val-badge-wrap {
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
  padding: 16px 18px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, .03) 0%, rgba(255, 255, 255, .015) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05), 0 2px 8px rgba(0, 0, 0, .2);
}
.inv-val-badge { align-self: flex-start; }
.inv-val-badge.ui-badge-amber {
  background: var(--amber-glow); color: var(--amber);
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .15);
}
.inv-val-badge.ui-badge-red {
  background: var(--red-glow); color: var(--red);
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, .18), 0 0 18px rgba(248, 113, 113, .06);
}
.inv-val-badge.ui-badge-critical {
  background: var(--red-glow); color: var(--red);
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, .25), 0 0 30px rgba(248, 113, 113, .12);
}
.inv-val-badge-sub {
  font-size: 12px; color: var(--ink-3); line-height: 1.4;
}
.inv-val-legacy-gap {
  margin-top: 4px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 500;
  background: var(--blue-glow); color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .15);
  align-self: flex-start;
  cursor: help;
}
.inv-val-legacy-gap svg { opacity: .85; }

.inv-val-toggle-card {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 18px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, .03) 0%, rgba(255, 255, 255, .015) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05), 0 2px 8px rgba(0, 0, 0, .2);
}
.inv-val-toggle-text { flex: 1; min-width: 0; }
.inv-val-toggle-title { font-size: 13px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.inv-val-toggle-desc  { margin-top: 4px; font-size: 12px; color: var(--ink-3); line-height: 1.45; }

/* iOS-style toggle (matches prototype .ui-toggle) */
.ui-toggle {
  width: 52px; height: 30px; padding: 2px; border-radius: 20px;
  background: var(--ink-5);
  border: none; cursor: pointer; flex-shrink: 0;
  position: relative; transition: background .3s var(--spring), box-shadow .3s var(--spring);
}
.ui-toggle.on {
  background: var(--gold);
  box-shadow: 0 0 20px rgba(200, 160, 76, .15);
}
.ui-toggle:disabled { opacity: .5; cursor: not-allowed; }
.ui-toggle-knob {
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
  transition: transform .35s var(--spring);
  position: absolute; top: 2px; left: 2px;
}
.ui-toggle.on .ui-toggle-knob { transform: translateX(22px); }

/* Stat strip (reuses prototype .stats/.st styles — inventory.css does not
 * own these globally, so we scope minimal helpers here) */
.inv-val-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: rgba(255, 255, 255, .04);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .05),
    0 4px 16px rgba(0, 0, 0, .3),
    0 16px 48px rgba(0, 0, 0, .3),
    0 40px 80px rgba(0, 0, 0, .2);
}
.inv-val-stats .st {
  background: linear-gradient(180deg, rgba(22, 22, 28, 1) 0%, rgba(14, 14, 18, 1) 100%);
  padding: 24px 22px;
  position: relative; overflow: hidden;
  transition: all .28s var(--spring);
}
.inv-val-stats .st:hover {
  background: linear-gradient(180deg, rgba(28, 28, 36, 1) 0%, rgba(18, 18, 24, 1) 100%);
  transform: scale(1.005);
  z-index: 1;
}
.inv-val-stats .st:first-child { border-radius: var(--r-lg) 0 0 var(--r-lg); }
.inv-val-stats .st:last-child  { border-radius: 0 var(--r-lg) var(--r-lg) 0; }
.inv-val-stats .st::before {
  content: ''; position: absolute; top: -30px; right: -30px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, var(--gold-glow), transparent 65%);
  pointer-events: none; opacity: .6;
  transition: opacity .4s;
}
.inv-val-stats .st:hover::before { opacity: 1.1; }
.inv-val-stats .st-l {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .2em; color: var(--ink-4);
  position: relative; z-index: 1;
}
.inv-val-stats .st-v {
  font-size: 32px; font-weight: 200; color: var(--ink);
  margin-top: 8px; letter-spacing: -.04em; line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 20px rgba(0, 0, 0, .5), 0 0 40px rgba(200, 160, 76, .04);
  position: relative; z-index: 1;
}
.inv-val-stats .st-c {
  font-size: 10px; font-weight: 500; margin-top: 12px;
  display: flex; align-items: center; gap: 4px;
  position: relative; z-index: 1;
}

/* Valuation table */
.inv-val-table-wrap {
  border-radius: var(--r-lg);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, .02) 0%, rgba(255, 255, 255, .01) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05), 0 2px 8px rgba(0, 0, 0, .2);
}
.inv-val-table thead th { font-size: 9.5px; letter-spacing: .08em; color: var(--ink-3); }
.inv-val-table td { font-size: 13px; color: var(--ink-2); }
.inv-val-table td.inv-val-prod-name { color: var(--ink); font-weight: 500; letter-spacing: -.01em; }
.inv-val-table td.num { font-variant-numeric: tabular-nums; color: var(--ink); }
.inv-val-table td.inv-val-cost {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(200, 160, 76, .2);
}
.inv-val-table td.inv-val-oldest.old   { color: var(--amber); }
.inv-val-table td.inv-val-oldest.stale { color: var(--red); }

.inv-val-footer {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
  padding: 4px 2px;
}
.inv-val-method {
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-4);
}
.inv-val-method strong { color: var(--gold); letter-spacing: .04em; font-weight: 700; }

/* Confirm modal body paragraph */
.inv-val-confirm-body {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}

/* Print styles — for the "Print / PDF" button */
@media print {
  body * { visibility: hidden !important; }
  .inv-val-main, .inv-val-main * { visibility: visible !important; }
  .inv-val-main { position: absolute; inset: 0; padding: 24px; }
  .inv-val-topbar-actions,
  .inv-val-kill,
  .inv-val-footer,
  .inv-val-modal { display: none !important; }
  .inv-val-stats { box-shadow: none; background: #fafafa; }
  .inv-val-stats .st { background: #fff !important; color: #111 !important; }
  .inv-val-stats .st-l, .inv-val-stats .st-v, .inv-val-stats .st-c { color: #111 !important; text-shadow: none !important; }
  .inv-val-stats .st::before { display: none !important; }
  .inv-val-table thead th, .inv-val-table td { color: #111 !important; }
  .inv-val-table td.inv-val-cost { color: #7a5a0b !important; text-shadow: none !important; }
}

/* Responsive */
@media (max-width: 820px) {
  .inv-val-stats { grid-template-columns: repeat(2, 1fr); }
  .inv-val-stats .st:nth-child(1), .inv-val-stats .st:nth-child(2) { border-radius: 0; }
  .inv-val-stats .st:nth-child(1) { border-radius: var(--r-lg) 0 0 0; }
  .inv-val-stats .st:nth-child(2) { border-radius: 0 var(--r-lg) 0 0; }
  .inv-val-stats .st:nth-child(3) { border-radius: 0 0 0 var(--r-lg); }
  .inv-val-stats .st:nth-child(4) { border-radius: 0 0 var(--r-lg) 0; }
}
@media (max-width: 640px) {
  .inv-val-stats { grid-template-columns: 1fr; }
  .inv-val-stats .st { border-radius: 0 !important; }
  .inv-val-stats .st:first-child { border-radius: var(--r-lg) var(--r-lg) 0 0 !important; }
  .inv-val-stats .st:last-child  { border-radius: 0 0 var(--r-lg) var(--r-lg) !important; }
  .inv-val-topbar { flex-direction: column; align-items: stretch; }
}

/* ============================================================
   Phase 3 — Purchase Orders sub-tab (shell) + Supplier manager
   ============================================================ */

/* Blocked banner (inventory v1 not enabled) — same tone as inv-val-blocked */
.inv-po-blocked {
  text-align: center;
  padding: 48px 32px;
  border-radius: var(--r-lg, 20px);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 2px 8px rgba(0,0,0,.2);
  color: var(--ink-2);
}
.inv-po-blocked svg { color: var(--amber, #FBBF24); opacity: .8; margin-bottom: 12px; }
.inv-po-blocked h3 { margin: 0 0 8px 0; font-size: 16px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.inv-po-blocked p  { margin: 0; font-size: 13px; color: var(--ink-3); }

/* Topbar */
.inv-po-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.inv-po-head h2 {
  margin: 0 0 4px 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--ink);
  text-shadow: 0 0 30px rgba(200,160,76,.06);
}
.inv-po-head p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
}
.inv-po-topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Empty state */
.inv-po-empty {
  text-align: center;
  padding: 48px 32px;
  border-radius: var(--r-lg, 20px);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 2px 8px rgba(0,0,0,.2);
}
.inv-po-empty-illust { margin-bottom: 12px; display: flex; justify-content: center; }
.inv-po-empty h3 {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.01em;
}
.inv-po-empty p {
  margin: 0 0 20px 0;
  font-size: 13px;
  color: var(--ink-3);
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}
.inv-po-empty .prod-btn-glow { margin-top: 4px; }

/* ===========================
   Phase 3c1 — PO list view
   Toolbar (filter pills + search), table, status badges,
   loading skeleton, error, "no matches" inline state.
   =========================== */

/* Toolbar row */
.inv-po-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* Filter pills */
.inv-po-filter-pills {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: rgba(255,255,255,.02);
  border-radius: var(--r-sm, 10px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  flex-wrap: wrap;
}
.inv-po-pill {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -.005em;
  padding: 6px 12px;
  border-radius: var(--r-sm, 10px);
  cursor: pointer;
  transition: all .22s cubic-bezier(.16, 1, .3, 1);
  white-space: nowrap;
}
.inv-po-pill:hover {
  color: var(--ink);
  background: rgba(255,255,255,.03);
}
.inv-po-pill.is-active {
  background: linear-gradient(135deg, rgba(200,160,76,.12), rgba(200,160,76,.06));
  color: var(--gold, #C8A04C);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(200,160,76,.15), 0 2px 8px rgba(200,160,76,.1);
}

/* Search input with leading icon */
.inv-po-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 220px;
  flex: 0 1 280px;
}
.inv-po-search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}
.inv-po-search {
  appearance: none;
  width: 100%;
  padding: 9px 12px 9px 34px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: rgba(255,255,255,.03);
  border: none;
  border-radius: var(--r-sm, 10px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  transition: all .2s cubic-bezier(.16, 1, .3, 1);
}
.inv-po-search::placeholder { color: var(--ink-4); }
.inv-po-search:hover {
  background: rgba(255,255,255,.05);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.inv-po-search:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(200,160,76,.12), inset 0 0 0 1px rgba(200,160,76,.2);
}
/* Remove webkit search decorations for consistency */
.inv-po-search::-webkit-search-cancel-button { appearance: none; }

/* Loading skeleton */
.inv-po-loading {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0;
}
.inv-po-skel-row {
  height: 44px;
  border-radius: var(--r-sm, 10px);
  background: linear-gradient(90deg,
    rgba(255,255,255,.02) 0%,
    rgba(255,255,255,.05) 50%,
    rgba(255,255,255,.02) 100%);
  background-size: 200% 100%;
  animation: inv-po-skel 1.4s ease-in-out infinite;
}
@keyframes inv-po-skel {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Error panel */
.inv-po-error {
  text-align: center;
  padding: 40px 32px;
  border-radius: var(--r-lg, 20px);
  background: linear-gradient(180deg, rgba(248,113,113,.04), rgba(248,113,113,.015));
  box-shadow: inset 0 0 0 1px rgba(248,113,113,.12), 0 2px 8px rgba(0,0,0,.2);
}
.inv-po-error svg { color: var(--red, #F87171); opacity: .85; margin-bottom: 10px; }
.inv-po-error h3 {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.01em;
}
.inv-po-error p {
  margin: 0 0 16px 0;
  font-size: 13px;
  color: var(--ink-3);
}

/* Table wrapper — rounded glass card with horizontal scroll on narrow */
.inv-po-table-wrap {
  border-radius: var(--r-lg, 20px);
  background: linear-gradient(180deg, rgba(255,255,255,.03) 0%, rgba(255,255,255,.015) 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 2px 8px rgba(0,0,0,.2);
  overflow: hidden;
}

/* Table */
.inv-po-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: auto;
}
.inv-po-table thead th {
  position: sticky;
  top: 0;
  background: rgba(20,20,26,.72);
  backdrop-filter: blur(8px);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  white-space: nowrap;
}
.inv-po-table tbody td {
  padding: 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,.03);
  color: var(--ink-2);
  vertical-align: middle;
}
.inv-po-table tbody tr:last-child td { border-bottom: none; }
.inv-po-table tbody tr.inv-po-row {
  cursor: pointer;
  transition: background .2s ease;
}
.inv-po-table tbody tr.inv-po-row:hover { background: rgba(255,255,255,.02); }
.inv-po-table tbody tr.inv-po-row:focus-visible {
  outline: none;
  background: rgba(200,160,76,.04);
  box-shadow: inset 0 0 0 1px rgba(200,160,76,.2);
}

/* Column-specific */
.inv-po-td-num      { white-space: nowrap; }
.inv-po-num {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.inv-po-td-sup      { color: var(--ink); font-weight: 500; }
.inv-po-td-loc      { color: var(--ink-3); }
.inv-po-td-lines    { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); width: 1%; white-space: nowrap; }
.inv-po-th-lines    { text-align: right; }
.inv-po-td-total    { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); white-space: nowrap; width: 1%; text-shadow: 0 0 10px rgba(200,160,76,.08); }
.inv-po-th-total    { text-align: right; }
.inv-po-td-date     { color: var(--ink-3); white-space: nowrap; width: 1%; }
.inv-po-td-status   { white-space: nowrap; width: 1%; }

/* Status badges (Glass Theme kinds) */
.inv-po-status-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 20px;
  line-height: 1.5;
  white-space: nowrap;
}
.inv-po-status-neutral {
  background: rgba(255,255,255,.05);
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.inv-po-status-info {
  background: rgba(96,165,250,.12);
  color: var(--blue, #60A5FA);
  box-shadow: inset 0 0 0 1px rgba(96,165,250,.15), 0 0 10px rgba(96,165,250,.05);
}
.inv-po-status-warning {
  background: rgba(251,191,36,.12);
  color: var(--amber, #FBBF24);
  box-shadow: inset 0 0 0 1px rgba(251,191,36,.15), 0 0 10px rgba(251,191,36,.05);
}
.inv-po-status-success {
  background: rgba(74,222,128,.14);
  color: var(--green, #4ADE80);
  box-shadow: inset 0 0 0 1px rgba(74,222,128,.15), 0 0 10px rgba(74,222,128,.05);
}
.inv-po-status-muted {
  background: rgba(248,113,113,.08);
  color: var(--ink-4, #6A6A7A);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  text-decoration: line-through;
  text-decoration-color: rgba(248,113,113,.3);
}

/* Inline "no matches" state (inside table-wrap) */
.inv-po-nomatches {
  padding: 32px 16px;
  text-align: center;
}
.inv-po-nomatches p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
}

/* Narrow-viewport collapse — hide the optional columns on mobile/tablet portrait */
@media (max-width: 720px) {
  .inv-po-th-loc,
  .inv-po-td-loc,
  .inv-po-th-date,
  .inv-po-td-date,
  .inv-po-th-lines,
  .inv-po-td-lines {
    display: none;
  }
  .inv-po-toolbar { gap: 12px; }
  .inv-po-search-wrap { flex: 1 1 100%; min-width: 0; }
  .inv-po-table thead th,
  .inv-po-table tbody td { padding: 12px 10px; }
}

/* ============================================================
   Phase 4b — Cycle Counts sub-tab (list view shell)
   Mirrors .inv-po-* visual language; variance column adds
   polarity coloring (positive = green, negative = red).
   ============================================================ */

.inv-ct-blocked {
  text-align: center;
  padding: 48px 32px;
  border-radius: var(--r-lg, 20px);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 2px 8px rgba(0,0,0,.2);
  color: var(--ink-2);
}
.inv-ct-blocked svg { color: var(--amber, #FBBF24); opacity: .8; margin-bottom: 12px; }
.inv-ct-blocked h3 { margin: 0 0 8px 0; font-size: 16px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.inv-ct-blocked p  { margin: 0; font-size: 13px; color: var(--ink-3); }

.inv-ct-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.inv-ct-head h2 {
  margin: 0 0 4px 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--ink);
  text-shadow: 0 0 30px rgba(200,160,76,.06);
}
.inv-ct-head p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
}
.inv-ct-topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.inv-ct-empty {
  text-align: center;
  padding: 48px 32px;
  border-radius: var(--r-lg, 20px);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 2px 8px rgba(0,0,0,.2);
}
.inv-ct-empty-illust { margin-bottom: 12px; display: flex; justify-content: center; }
.inv-ct-empty h3 {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.01em;
}
.inv-ct-empty p {
  margin: 0 0 20px 0;
  font-size: 13px;
  color: var(--ink-3);
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}
.inv-ct-empty .prod-btn-glow { margin-top: 4px; }

.inv-ct-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.inv-ct-filter-pills {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: rgba(255,255,255,.02);
  border-radius: var(--r-sm, 10px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  flex-wrap: wrap;
}
.inv-ct-pill {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -.005em;
  padding: 6px 12px;
  border-radius: var(--r-sm, 10px);
  cursor: pointer;
  transition: all .22s cubic-bezier(.16, 1, .3, 1);
  white-space: nowrap;
}
.inv-ct-pill:hover {
  color: var(--ink);
  background: rgba(255,255,255,.03);
}
.inv-ct-pill.is-active {
  background: linear-gradient(135deg, rgba(200,160,76,.12), rgba(200,160,76,.06));
  color: var(--gold, #C8A04C);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(200,160,76,.15), 0 2px 8px rgba(200,160,76,.1);
}

.inv-ct-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 220px;
  flex: 0 1 280px;
}
.inv-ct-search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}
.inv-ct-search {
  appearance: none;
  width: 100%;
  padding: 9px 12px 9px 34px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: rgba(255,255,255,.03);
  border: none;
  border-radius: var(--r-sm, 10px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  transition: all .2s cubic-bezier(.16, 1, .3, 1);
}
.inv-ct-search::placeholder { color: var(--ink-4); }
.inv-ct-search:hover {
  background: rgba(255,255,255,.05);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.inv-ct-search:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(200,160,76,.12), inset 0 0 0 1px rgba(200,160,76,.2);
}
.inv-ct-search::-webkit-search-cancel-button { appearance: none; }

.inv-ct-loading {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0;
}
.inv-ct-skel-row {
  height: 44px;
  border-radius: var(--r-sm, 10px);
  background: linear-gradient(90deg,
    rgba(255,255,255,.02) 0%,
    rgba(255,255,255,.05) 50%,
    rgba(255,255,255,.02) 100%);
  background-size: 200% 100%;
  animation: inv-po-skel 1.4s ease-in-out infinite;
}

.inv-ct-error {
  text-align: center;
  padding: 40px 32px;
  border-radius: var(--r-lg, 20px);
  background: linear-gradient(180deg, rgba(248,113,113,.04), rgba(248,113,113,.015));
  box-shadow: inset 0 0 0 1px rgba(248,113,113,.12), 0 2px 8px rgba(0,0,0,.2);
}
.inv-ct-error svg { color: var(--red, #F87171); opacity: .85; margin-bottom: 10px; }
.inv-ct-error h3 {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.01em;
}
.inv-ct-error p {
  margin: 0 0 16px 0;
  font-size: 13px;
  color: var(--ink-3);
}

.inv-ct-table-wrap {
  border-radius: var(--r-lg, 20px);
  background: linear-gradient(180deg, rgba(255,255,255,.03) 0%, rgba(255,255,255,.015) 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 2px 8px rgba(0,0,0,.2);
  overflow: hidden;
}
.inv-ct-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: auto;
}
.inv-ct-table thead th {
  position: sticky;
  top: 0;
  background: rgba(20,20,26,.72);
  backdrop-filter: blur(8px);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  white-space: nowrap;
}
.inv-ct-table tbody td {
  padding: 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,.03);
  color: var(--ink-2);
  vertical-align: middle;
}
.inv-ct-table tbody tr:last-child td { border-bottom: none; }
.inv-ct-table tbody tr.inv-ct-row {
  cursor: pointer;
  transition: background .2s ease;
}
.inv-ct-table tbody tr.inv-ct-row:hover { background: rgba(255,255,255,.02); }
.inv-ct-table tbody tr.inv-ct-row:focus-visible {
  outline: none;
  background: rgba(200,160,76,.04);
  box-shadow: inset 0 0 0 1px rgba(200,160,76,.2);
}

.inv-ct-td-num { white-space: nowrap; }
.inv-ct-num {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.inv-ct-td-loc    { color: var(--ink); font-weight: 500; }
.inv-ct-td-scope  { color: var(--ink-3); }
.inv-ct-td-lines  { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); width: 1%; white-space: nowrap; }
.inv-ct-th-lines  { text-align: right; }
.inv-ct-td-variance {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
  width: 1%;
}
.inv-ct-th-variance { text-align: right; }
.inv-ct-variance-zero { color: var(--ink-3); font-weight: 400; }
.inv-ct-variance-pos  { color: var(--green, #4ADE80); text-shadow: 0 0 10px rgba(74,222,128,.08); }
.inv-ct-variance-neg  { color: var(--red, #F87171);   text-shadow: 0 0 10px rgba(248,113,113,.08); }
.inv-ct-td-date   { color: var(--ink-3); white-space: nowrap; width: 1%; }
.inv-ct-td-status { white-space: nowrap; width: 1%; }

.inv-ct-status-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 20px;
  line-height: 1.5;
  white-space: nowrap;
}
.inv-ct-status-warning {
  background: rgba(251,191,36,.12);
  color: var(--amber, #FBBF24);
  box-shadow: inset 0 0 0 1px rgba(251,191,36,.15), 0 0 10px rgba(251,191,36,.05);
}
.inv-ct-status-info {
  background: rgba(96,165,250,.12);
  color: var(--blue, #60A5FA);
  box-shadow: inset 0 0 0 1px rgba(96,165,250,.15), 0 0 10px rgba(96,165,250,.05);
}
.inv-ct-status-success {
  background: rgba(74,222,128,.14);
  color: var(--green, #4ADE80);
  box-shadow: inset 0 0 0 1px rgba(74,222,128,.15), 0 0 10px rgba(74,222,128,.05);
}
.inv-ct-status-muted {
  background: rgba(248,113,113,.08);
  color: var(--ink-4, #6A6A7A);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  text-decoration: line-through;
  text-decoration-color: rgba(248,113,113,.3);
}

.inv-ct-nomatches {
  padding: 32px 16px;
  text-align: center;
}
.inv-ct-nomatches p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
}

@media (max-width: 720px) {
  .inv-ct-th-scope,
  .inv-ct-td-scope,
  .inv-ct-th-date,
  .inv-ct-td-date,
  .inv-ct-th-lines,
  .inv-ct-td-lines {
    display: none;
  }
  .inv-ct-toolbar { gap: 12px; }
  .inv-ct-search-wrap { flex: 1 1 100%; min-width: 0; }
  .inv-ct-table thead th,
  .inv-ct-table tbody td { padding: 12px 10px; }
}

/* ===========================
   Supplier manager modal
   Reuses .inv-adjust-modal fixed-overlay positioning
   =========================== */

/* Wider panel than adjust-stock modal (suppliers need room) */
.sup-modal .sup-panel {
  position: relative;
  max-width: 620px;
  width: 92vw;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  padding: 28px;
  border-radius: var(--r-xl, 26px);
  background: linear-gradient(180deg, var(--floating, #22222C), var(--elevated, #1A1A22));
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.08),
    0 8px 32px rgba(0,0,0,.5),
    0 40px 80px rgba(0,0,0,.3),
    0 0 60px rgba(200,160,76,.04);
  animation: invAdjSpringIn .55s cubic-bezier(.34, 1.4, .64, 1) forwards;
  overflow: hidden;
}

.sup-view { display: flex; flex-direction: column; min-height: 0; }
.sup-view[hidden] { display: none; }

/* Title block */
.sup-head-titleblock h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--ink);
  text-shadow: 0 0 20px rgba(200,160,76,.05);
}
.sup-head-sub {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: var(--ink-3);
}

/* Toolbar (search + archive toggle + new button) */
.sup-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.sup-search {
  position: relative;
  flex: 1 1 200px;
  min-width: 180px;
}
.sup-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}
.sup-search input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  font-size: 14px;
  font-family: var(--font, inherit);
  color: var(--ink);
  background: rgba(255,255,255,.03);
  border: none;
  border-radius: var(--r-sm, 10px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  transition: all .2s cubic-bezier(.16, 1, .3, 1);
}
.sup-search input:hover {
  background: rgba(255,255,255,.05);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.sup-search input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(200,160,76,.12), inset 0 0 0 1px rgba(200,160,76,.2);
}
.sup-showarchived {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-3);
  cursor: pointer;
  user-select: none;
}
.sup-showarchived input {
  accent-color: var(--gold, #C8A04C);
  cursor: pointer;
}
.sup-add-btn svg { margin-right: 2px; }

/* List */
.sup-listwrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  border-radius: var(--r, 14px);
  background: rgba(255,255,255,.02);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  padding: 6px;
}
.sup-loading, .sup-empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
}
.sup-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sup-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-sm, 10px);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: var(--ink);
  transition: all .2s cubic-bezier(.16, 1, .3, 1);
}
.sup-list-item:hover {
  background: rgba(255,255,255,.03);
  transform: translateX(1px);
}
.sup-list-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(200,160,76,.12), inset 0 0 0 1px rgba(200,160,76,.2);
}
.sup-list-item.is-archived {
  opacity: .55;
}
.sup-li-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold, #C8A04C);
  background: linear-gradient(135deg, rgba(200,160,76,.18), rgba(200,160,76,.06));
  box-shadow: inset 0 0 0 1px rgba(200,160,76,.2), 0 0 12px rgba(200,160,76,.05);
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.sup-li-body { flex: 1 1 auto; min-width: 0; }
.sup-li-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sup-li-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sup-li-badge {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(255,255,255,.04);
  color: var(--ink-3);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.sup-li-chevron { color: var(--ink-4); flex: 0 0 auto; }

/* Form fields */
.sup-view-form form {
  overflow-y: auto;
  padding-right: 2px; /* space for scrollbar */
}
.sup-field {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
}
.sup-field label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.sup-field input,
.sup-field textarea {
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font, inherit);
  color: var(--ink);
  background: rgba(255,255,255,.03);
  border: none;
  border-radius: var(--r-sm, 10px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  transition: all .2s cubic-bezier(.16, 1, .3, 1);
  width: 100%;
}
.sup-field textarea { resize: vertical; min-height: 72px; }
.sup-field input:hover,
.sup-field textarea:hover {
  background: rgba(255,255,255,.05);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.sup-field input:focus,
.sup-field textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(200,160,76,.12), inset 0 0 0 1px rgba(200,160,76,.2);
}
.sup-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.sup-field-row > .sup-field { margin-bottom: 14px; }

/* Message (errors + success) */
.sup-message {
  margin-top: 4px;
  margin-bottom: 12px;
  font-size: 12px;
  min-height: 14px;
}
.sup-message.is-error {
  color: var(--red, #F87171);
  padding: 10px 12px;
  border-radius: var(--r-sm, 10px);
  background: rgba(248,113,113,.08);
  box-shadow: inset 0 0 0 1px rgba(248,113,113,.15);
}
.sup-message.is-success {
  color: var(--green, #4ADE80);
  padding: 10px 12px;
  border-radius: var(--r-sm, 10px);
  background: rgba(74,222,128,.08);
  box-shadow: inset 0 0 0 1px rgba(74,222,128,.15);
}

/* Actions row (override .inv-adjust-actions' flex-end with a spacer) */
.sup-actions { align-items: center; }
.sup-actions-spacer { flex: 1 1 auto; }
.sup-archive-btn, .sup-unarchive-btn { color: var(--red, #F87171) !important; }
.sup-unarchive-btn { color: var(--green, #4ADE80) !important; }

/* Responsive */
@media (max-width: 560px) {
  .sup-modal .sup-panel { padding: 20px; max-height: 92vh; }
  .sup-field-row { grid-template-columns: 1fr; gap: 0; }
  .inv-po-topbar { flex-direction: column; align-items: stretch; }
  .inv-po-topbar-actions { justify-content: flex-start; }
}

/* ============================================================
   PO Wizard Modal (Phase 3c2)
   ------------------------------------------------------------
   Reuses `.inv-adjust-modal` + `.modal-overlay` +
   `invAdjBdropIn` / `invAdjSpringIn` keyframes.
   Adds wizard-specific overrides: wider panel, richer body,
   supplier/location/product pickers, line items table.
   ============================================================ */

/* Body scroll lock while wizard is open */
body.sfy-modal-lock { overflow: hidden; }

/* Wider panel for wizard */
.inv-po-wz-modal { z-index: 1100; }
.inv-po-wz-panel {
  max-width: 720px;
  width: 94vw;
  max-height: 92vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Head */
.inv-po-wz-head {
  margin: 0;
  padding: 22px 26px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  justify-content: space-between;
  align-items: center;
  flex: 0 0 auto;
}
.inv-po-wz-head h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--ink);
  margin: 0;
}
.inv-po-wz-close {
  appearance: none;
  background: rgba(255, 255, 255, .03);
  border: none;
  padding: 8px;
  border-radius: 50%;
  color: var(--ink-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .2s cubic-bezier(.16, 1, .3, 1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.inv-po-wz-close:hover {
  background: rgba(255, 255, 255, .08);
  color: var(--ink);
  transform: scale(1.05);
}
.inv-po-wz-close:active { transform: scale(.95); }

/* Body — scrollable */
.inv-po-wz-body {
  padding: 20px 26px 16px;
  overflow-y: auto;
  flex: 1 1 auto;
  position: relative;
}

/* Restore banner */
.inv-po-wz-restore-slot:empty { display: none; }
.inv-po-wz-restore {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: var(--r, 14px);
  background: linear-gradient(135deg, rgba(200, 160, 76, .12), rgba(200, 160, 76, .04));
  box-shadow: inset 0 0 0 1px rgba(200, 160, 76, .18), 0 2px 12px rgba(200, 160, 76, .05);
}
.inv-po-wz-restore-icon {
  color: var(--gold, #C8A04C);
  flex: 0 0 auto;
}
.inv-po-wz-restore-text { flex: 1 1 auto; }
.inv-po-wz-restore-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.01em;
}
.inv-po-wz-restore-sub {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
}
.inv-po-wz-restore-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}
.inv-po-wz-restore-actions .prod-btn-ghost,
.inv-po-wz-restore-actions .prod-btn-glow {
  padding: 7px 14px;
  font-size: 12px;
}

/* Meta grid */
.inv-po-wz-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  margin-bottom: 18px;
}
.inv-po-wz-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.inv-po-wz-field-full { grid-column: 1 / -1; }
.inv-po-wz-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Picker trigger */
.inv-po-wz-trigger {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font, inherit);
  color: var(--ink);
  background: rgba(255, 255, 255, .03);
  border: none;
  border-radius: var(--r-sm, 10px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  cursor: pointer;
  text-align: left;
  transition: all .2s cubic-bezier(.16, 1, .3, 1);
}
.inv-po-wz-trigger:hover {
  background: rgba(255, 255, 255, .05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.inv-po-wz-trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(200, 160, 76, .12), inset 0 0 0 1px rgba(200, 160, 76, .2);
}
.inv-po-wz-trigger-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inv-po-wz-trigger-text.is-placeholder { color: var(--ink-4); }
.inv-po-wz-trigger-chev {
  flex: 0 0 auto;
  color: var(--ink-3);
  transition: transform .2s cubic-bezier(.16, 1, .3, 1);
}
.inv-po-wz-trigger[aria-expanded="true"] .inv-po-wz-trigger-chev { transform: rotate(180deg); }

/* Archived supplier badge */
.inv-po-wz-archived-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(251, 191, 36, .12), rgba(251, 191, 36, .06));
  color: var(--amber, #FBBF24);
  border-radius: 20px;
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .15);
  align-self: flex-start;
  width: fit-content;
}

/* Native-looking inputs */
.inv-po-wz-input,
.inv-po-wz-textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font, inherit);
  color: var(--ink);
  background: rgba(255, 255, 255, .03);
  border: none;
  border-radius: var(--r-sm, 10px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  transition: all .2s cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}
.inv-po-wz-textarea { resize: vertical; min-height: 58px; font-family: var(--font, inherit); }
.inv-po-wz-input:hover,
.inv-po-wz-textarea:hover {
  background: rgba(255, 255, 255, .05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.inv-po-wz-input:focus,
.inv-po-wz-textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(200, 160, 76, .12), inset 0 0 0 1px rgba(200, 160, 76, .2);
}
.inv-po-wz-input::-webkit-calendar-picker-indicator {
  filter: invert(.7);
  opacity: .6;
  cursor: pointer;
}

/* Items section */
.inv-po-wz-section { margin-top: 6px; margin-bottom: 16px; }
.inv-po-wz-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.inv-po-wz-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}
.inv-po-wz-add-line {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold, #C8A04C);
  background: linear-gradient(135deg, rgba(200, 160, 76, .12), rgba(200, 160, 76, .06));
  border: none;
  border-radius: var(--r-sm, 10px);
  box-shadow: inset 0 0 0 1px rgba(200, 160, 76, .18), 0 2px 8px rgba(200, 160, 76, .06);
  cursor: pointer;
  transition: all .22s cubic-bezier(.16, 1, .3, 1);
}
.inv-po-wz-add-line:hover {
  background: linear-gradient(135deg, rgba(200, 160, 76, .2), rgba(200, 160, 76, .1));
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(200, 160, 76, .26), 0 4px 12px rgba(200, 160, 76, .12);
}
.inv-po-wz-add-line:active { transform: scale(.97); }

/* Lines table */
.inv-po-wz-lines-wrap {
  background: rgba(255, 255, 255, .015);
  border-radius: var(--r, 14px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
  padding: 4px;
  overflow: hidden;
}
.inv-po-wz-lines {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.inv-po-wz-lines thead th {
  padding: 10px 10px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  text-align: left;
}
.inv-po-wz-lines thead th.inv-po-wz-th-num { text-align: right; }
.inv-po-wz-lines tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .03);
  vertical-align: middle;
}
.inv-po-wz-lines tbody tr:last-child td { border-bottom: none; }

/* Line cells */
.inv-po-wz-line { transition: background .2s ease; }
.inv-po-wz-line:hover { background: rgba(255, 255, 255, .015); }
.inv-po-wz-line.is-duplicate { background: rgba(248, 113, 113, .06); }

.inv-po-wz-line-prod-btn {
  appearance: none;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  background: rgba(255, 255, 255, .02);
  border: none;
  border-radius: var(--r-sm, 10px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  transition: all .2s cubic-bezier(.16, 1, .3, 1);
}
.inv-po-wz-line-prod-btn:hover {
  background: rgba(255, 255, 255, .05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.inv-po-wz-line-prod-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inv-po-wz-line-prod-name.is-placeholder { color: var(--ink-4); font-style: italic; }
.inv-po-wz-line-prod-sku {
  font-size: 10px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-po-wz-line-duptag {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--red, #F87171);
  background: rgba(248, 113, 113, .1);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, .2);
}

.inv-po-wz-line-num { text-align: right; }
.inv-po-wz-line-input {
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
  font-family: var(--font, inherit);
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--ink);
  background: rgba(255, 255, 255, .03);
  border: none;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  transition: all .15s cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}
.inv-po-wz-line-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(200, 160, 76, .18), inset 0 0 0 1px rgba(200, 160, 76, .25);
}
/* Hide number input spinners for tidier look */
.inv-po-wz-line-input::-webkit-outer-spin-button,
.inv-po-wz-line-input::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.inv-po-wz-line-input[type="number"] { -moz-appearance: textfield; }

.inv-po-wz-line-total {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.inv-po-wz-line-rm { text-align: center; }
.inv-po-wz-line-rm-btn {
  appearance: none;
  width: 28px;
  height: 28px;
  padding: 0;
  background: rgba(255, 255, 255, .02);
  border: none;
  border-radius: 50%;
  color: var(--ink-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .2s cubic-bezier(.16, 1, .3, 1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
}
.inv-po-wz-line-rm-btn:hover {
  background: rgba(248, 113, 113, .12);
  color: var(--red, #F87171);
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, .2);
}

.inv-po-wz-lines-empty {
  padding: 22px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-4);
  background: rgba(255, 255, 255, .015);
  border-radius: var(--r, 14px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}

/* Totals */
.inv-po-wz-totals {
  margin-top: 14px;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .015));
  border-radius: var(--r, 14px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
}
.inv-po-wz-totals-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.inv-po-wz-totals-grand .inv-po-wz-totals-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.inv-po-wz-totals-grand .inv-po-wz-totals-val {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 16px rgba(200, 160, 76, .1);
}

/* Message */
.inv-po-wz-msg {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm, 10px);
  font-size: 12px;
}
.inv-po-wz-msg.is-error {
  color: var(--red, #F87171);
  background: rgba(248, 113, 113, .08);
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, .15);
}
.inv-po-wz-msg.is-success {
  color: var(--green, #4ADE80);
  background: rgba(74, 222, 128, .08);
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, .15);
}
.inv-po-wz-msg.is-info {
  color: var(--blue, #60A5FA);
  background: rgba(96, 165, 250, .08);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .15);
}

/* Actions bar */
.inv-po-wz-actions {
  margin: 0;
  padding: 14px 26px 22px;
  border-top: 1px solid rgba(255, 255, 255, .05);
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.inv-po-wz-actions-spacer { flex: 1 1 auto; }

/* Picker popup (absolute, inside panel) */
.inv-po-wz-picker-popup {
  position: absolute;
  z-index: 5;
  min-width: 200px;
  max-width: 540px;
  max-height: 320px;
  padding: 4px;
  background: var(--elevated, #1A1A22);
  border-radius: var(--r, 14px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .08),
    0 8px 32px rgba(0, 0, 0, .5),
    0 0 1px rgba(255, 255, 255, .06);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: invAdjSpringIn .22s cubic-bezier(.34, 1.4, .64, 1) forwards;
}
.inv-po-wz-picker-popup-wide { width: 420px; max-width: min(92vw, 520px); }

.inv-po-wz-picker-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  color: var(--ink-3);
}
.inv-po-wz-picker-search input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 4px 6px;
  font-size: 13px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
}
.inv-po-wz-picker-search input::placeholder { color: var(--ink-4); }

.inv-po-wz-picker-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 4px;
}
.inv-po-wz-picker-item {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease;
}
.inv-po-wz-picker-item:hover:not(.is-disabled) {
  background: rgba(255, 255, 255, .04);
}
.inv-po-wz-picker-item.is-selected {
  background: linear-gradient(135deg, rgba(200, 160, 76, .1), rgba(200, 160, 76, .03));
  box-shadow: inset 0 0 0 1px rgba(200, 160, 76, .15);
}
.inv-po-wz-picker-item.is-selected::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold, #C8A04C);
  box-shadow: 0 0 8px rgba(200, 160, 76, .5);
  flex: 0 0 auto;
}
.inv-po-wz-picker-item.is-disabled {
  opacity: .5;
  cursor: not-allowed;
}
.inv-po-wz-picker-item-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inv-po-wz-picker-item-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.inv-po-wz-picker-item-sub {
  font-size: 10px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.inv-po-wz-picker-item-right {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.inv-po-wz-picker-item-right.is-warning { color: var(--amber, #FBBF24); }
.inv-po-wz-picker-item-tag {
  flex: 0 0 auto;
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: rgba(255, 255, 255, .05);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.inv-po-wz-picker-item-tag-default {
  color: var(--gold, #C8A04C);
  background: rgba(200, 160, 76, .08);
  box-shadow: inset 0 0 0 1px rgba(200, 160, 76, .15);
}
.inv-po-wz-picker-empty {
  padding: 16px 12px;
  font-size: 12px;
  color: var(--ink-4);
  text-align: center;
}
.inv-po-wz-picker-hint {
  padding: 8px 10px;
  font-size: 10px;
  color: var(--ink-4);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, .05);
  font-style: italic;
}

/* Supplier picker tabs */
.inv-po-wz-sup-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.inv-po-wz-sup-tab {
  appearance: none;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink-3);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s cubic-bezier(.16, 1, .3, 1);
}
.inv-po-wz-sup-tab:hover { background: rgba(255, 255, 255, .03); color: var(--ink-2); }
.inv-po-wz-sup-tab.is-active {
  background: linear-gradient(135deg, rgba(200, 160, 76, .12), rgba(200, 160, 76, .06));
  color: var(--gold, #C8A04C);
  box-shadow: inset 0 0 0 1px rgba(200, 160, 76, .15);
}

/* Responsive */
@media (max-width: 640px) {
  .inv-po-wz-panel { width: 100vw; max-height: 100vh; border-radius: 0; }
  .inv-po-wz-head { padding: 18px 18px 12px; }
  .inv-po-wz-body { padding: 16px 18px 12px; }
  .inv-po-wz-actions { padding: 12px 18px 18px; }
  .inv-po-wz-meta { grid-template-columns: 1fr; }
  .inv-po-wz-picker-popup-wide { width: calc(100vw - 40px); }
  .inv-po-wz-lines thead th.inv-po-wz-th-num:nth-of-type(3) { display: none; }
}

/* =======================================================
   Phase 3c3 — Detail / Receive / Cancel / Close Modals
   ======================================================= */

/* Detail modal */
.inv-po-detail-panel {
  width: min(600px, 90vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.inv-po-detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.inv-po-detail-head h3 {
  flex: 1;
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.025em;
}
.inv-po-status-badge {
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 20px;
}
.inv-po-status-neutral { background: rgba(255,255,255,.08); color: var(--ink-3); }
.inv-po-status-info    { background: var(--blue-glow, rgba(96,165,250,.12)); color: var(--blue, #60A5FA); }
.inv-po-status-warning { background: var(--amber-glow, rgba(251,191,36,.12)); color: var(--amber, #FBBF24); }
.inv-po-status-success { background: var(--green-glow, rgba(74,222,128,.14)); color: var(--green, #4ADE80); }
.inv-po-status-muted   { background: rgba(255,255,255,.04); color: var(--ink-4); }

.inv-po-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}
.inv-po-detail-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 24px;
  margin-bottom: 20px;
}
.inv-po-detail-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.inv-po-detail-meta-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.inv-po-detail-meta-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.inv-po-detail-notes {
  padding: 12px 14px;
  margin-bottom: 20px;
  background: rgba(255,255,255,.02);
  border-radius: 10px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}
.inv-po-detail-lines-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}
.inv-po-detail-lines-table th {
  text-align: left;
  padding: 10px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.inv-po-detail-lines-table td {
  padding: 12px 8px;
  font-size: 13px;
  color: var(--ink);
  border-bottom: 1px solid rgba(255,255,255,.03);
}
.inv-po-detail-lines-table td.inv-po-partial { color: var(--amber); }
.inv-po-detail-lines-table td.inv-po-complete { color: var(--green); }
.inv-po-detail-total {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 8px;
  font-size: 15px;
  font-weight: 600;
}
.inv-po-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,.05);
}

/* Receive modal */
.inv-po-receive-panel {
  width: min(640px, 90vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.inv-po-receive-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}
.inv-po-receive-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}
.inv-po-receive-table th {
  text-align: left;
  padding: 10px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.inv-po-receive-table td {
  padding: 10px 8px;
  font-size: 13px;
  color: var(--ink);
  border-bottom: 1px solid rgba(255,255,255,.03);
}
.inv-po-receive-table input[disabled] {
  opacity: .4;
  cursor: not-allowed;
}

/* Cancel / Close modals */
.inv-po-cancel-panel,
.inv-po-close-panel {
  max-width: 420px;
  width: 90vw;
}
.inv-po-cancel-body,
.inv-po-close-body {
  padding: 20px 24px;
}
.inv-po-cancel-body p,
.inv-po-close-body p {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.5;
}

/* Danger button variant */
.prod-btn-danger {
  background: linear-gradient(135deg, var(--red, #F87171) 0%, #E05656 100%) !important;
  color: #fff !important;
}
.prod-btn-danger:hover {
  box-shadow: 0 6px 28px rgba(248,113,113,.35), 0 0 60px rgba(248,113,113,.12) !important;
}
.prod-btn-ghost.prod-btn-danger {
  background: rgba(248,113,113,.12) !important;
  color: var(--red, #F87171) !important;
  box-shadow: inset 0 0 0 1px rgba(248,113,113,.15) !important;
}
.prod-btn-ghost.prod-btn-danger:hover {
  background: rgba(248,113,113,.18) !important;
}

/* Message styles */
.inv-po-wz-message-info { color: var(--blue, #60A5FA); }
.inv-po-wz-message-error { color: var(--red, #F87171); }
.inv-po-wz-message-success { color: var(--green, #4ADE80); }

/* Responsive adjustments for 3c3 modals */
@media (max-width: 640px) {
  .inv-po-detail-panel,
  .inv-po-receive-panel { width: 100vw; max-height: 100vh; border-radius: 0; }
  .inv-po-detail-meta { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────────────────────────
   Phase 4c — Cycle Count Review / Post / Cancel-Confirm modals
   Reuses .inv-adjust-modal + .modal-overlay positioning;
   panel-level class is kept by each modal's own root element.
   ─────────────────────────────────────────────────────────── */

/* Shared danger button — ghost + red surface/glow */
.inv-ct-btn-danger {
  background: rgba(248,113,113,.12) !important;
  color: var(--red, #F87171) !important;
  box-shadow: inset 0 0 0 1px rgba(248,113,113,.15), 0 0 0 rgba(248,113,113,0) !important;
  transition: all .22s cubic-bezier(.16,1,.3,1);
}
.inv-ct-btn-danger:hover {
  background: rgba(248,113,113,.18) !important;
  box-shadow: inset 0 0 0 1px rgba(248,113,113,.25), 0 2px 12px rgba(248,113,113,.18) !important;
  transform: translateY(-1px);
}

/* Review modal — warning note strip shown above lines table */
.inv-ct-rv-note {
  margin: 0 0 16px 0;
  padding: 12px 14px;
  border-radius: var(--r-sm, 10px);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2);
  background: linear-gradient(180deg, rgba(255,255,255,.03) 0%, rgba(255,255,255,.015) 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}
.inv-ct-rv-note-warn {
  color: var(--amber, #FBBF24);
  background: rgba(251,191,36,.06);
  box-shadow: inset 0 0 0 1px rgba(251,191,36,.18), 0 0 18px rgba(251,191,36,.04);
}

/* Post modal body */
.inv-ct-pm-body { padding: 20px 24px 24px; }

/* Variance summary strip at top of Post modal */
.inv-ct-pm-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  margin: 0 0 18px 0;
  border-radius: var(--r, 14px);
  background: linear-gradient(180deg, rgba(255,255,255,.04) 0%, rgba(255,255,255,.02) 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.inv-ct-pm-summary-dir {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.inv-ct-pm-summary-val {
  font-size: 24px;
  font-weight: 300;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 20px rgba(0,0,0,.4);
}
.inv-ct-pm-summary-val.inv-ct-variance-pos { color: var(--green, #4ADE80); text-shadow: 0 0 18px rgba(74,222,128,.14); }
.inv-ct-pm-summary-val.inv-ct-variance-neg { color: var(--red, #F87171);   text-shadow: 0 0 18px rgba(248,113,113,.14); }
.inv-ct-pm-summary-val.inv-ct-variance-zero{ color: var(--ink-3); }

/* Zero-variance notice (no journal required) */
.inv-ct-pm-zero-note {
  margin: 0 0 18px 0;
  padding: 12px 14px;
  border-radius: var(--r-sm, 10px);
  font-size: 12px;
  color: var(--ink-2);
  background: rgba(255,255,255,.03);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}

/* Journal preview table — DR/CR rows */
.inv-ct-journal-preview {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 18px 0;
  border-radius: var(--r-sm, 10px);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}
.inv-ct-journal-preview thead th {
  padding: 10px 12px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: left;
  background: rgba(255,255,255,.025);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.inv-ct-journal-preview thead th:nth-child(2),
.inv-ct-journal-preview thead th:nth-child(3) { text-align: right; }
.inv-ct-journal-preview tbody td {
  padding: 11px 12px;
  font-size: 13px;
  color: var(--ink);
  border-bottom: 1px solid rgba(255,255,255,.035);
}
.inv-ct-journal-preview tbody tr:last-child td { border-bottom: none; }
.inv-ct-jp-acc { color: var(--ink-2); }
.inv-ct-jp-amt {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--gold, #C8A04C);
  text-shadow: 0 0 8px rgba(200,160,76,.18);
  font-weight: 600;
}

/* Threshold-exceeded warning banner */
.inv-ct-pm-threshold-warn {
  margin: 0 0 16px 0;
  padding: 14px 16px;
  border-radius: var(--r-sm, 10px);
  background: rgba(251,191,36,.07);
  box-shadow: inset 0 0 0 1px rgba(251,191,36,.22), 0 0 26px rgba(251,191,36,.05);
}
.inv-ct-pm-threshold-warn-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--amber, #FBBF24);
  margin: 0 0 4px 0;
}
.inv-ct-pm-threshold-warn-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0;
}

/* Approval reason textarea label + field (shared shape with cx-reason) */
.inv-ct-pm-reason-label,
.inv-ct-cx-reason-label {
  display: block;
  margin: 0 0 6px 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.inv-ct-pm-reason,
.inv-ct-cx-reason {
  display: block;
  width: 100%;
  min-height: 72px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: rgba(255,255,255,.03);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  border: none;
  border-radius: var(--r-sm, 10px);
  resize: vertical;
  transition: all .2s cubic-bezier(.16,1,.3,1);
  font-family: inherit;
}
.inv-ct-pm-reason:hover,
.inv-ct-cx-reason:hover {
  background: rgba(255,255,255,.05);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.inv-ct-pm-reason:focus,
.inv-ct-cx-reason:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(200,160,76,.12), inset 0 0 0 1px rgba(200,160,76,.2);
  background: rgba(255,255,255,.05);
}

/* Message slot (shared shape with po wizard messages) */
.inv-ct-pm-msg,
.inv-ct-cx-msg {
  margin: 12px 0 0 0;
  min-height: 18px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-3);
}
.inv-ct-pm-msg-error,
.inv-ct-cx-msg-error   { color: var(--red, #F87171); }
.inv-ct-pm-msg-info,
.inv-ct-cx-msg-info    { color: var(--blue, #60A5FA); }
.inv-ct-pm-msg-success,
.inv-ct-cx-msg-success { color: var(--green, #4ADE80); }

/* Cancel-Confirm modal body + description */
.inv-ct-cx-body { padding: 20px 24px 24px; }
.inv-ct-cx-desc {
  margin: 0 0 16px 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
}
