/* ================= 资产管理系统（仓储）样式 =================
   独立于 styles.css（Codex 在改那个文件），避免互相覆盖。
   沿用项目既有的玻璃材质配方与深色场景约定（body.app-mode 前缀）。

   ⚠️ 三个页面都**不使用背板**（不套 .card）：表单根节点带 `bill-form bill-form-standalone`，
   与「记一笔」完全同一套写法，内容直接铺在右侧主背景上。   */

/* 无背板的区块：只负责间距，不画背景/边框/阴影 */
.w-block { margin-top: 16px; }

/* ---------- ① 出入库操作 ---------- */
.w-form-card { position: relative; margin-top: 4px; }
.w-form-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.w-kind-hint { font-size: 12px; color: var(--text-2); }
.w-kind-seg { display: inline-flex; }
.w-kind-seg button { min-width: 92px; }

.w-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px;
}
.w-grid .form-field { min-width: 0; }
.w-with-add { display: flex; gap: 6px; align-items: center; }
.w-with-add select { flex: 1; min-width: 0; }
.w-with-add .btn { flex: 0 0 auto; padding: 4px 10px; }

.w-items td { padding-top: 6px; padding-bottom: 6px; }
.w-items .td-handle { padding-left: 4px; }
.w-form-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* ---------- ② 出入库记录（左入 ‖ 右出） ---------- */
.w-ledger-wrap { overflow-x: auto; }
.w-ledger { table-layout: fixed; }
.w-ledger th, .w-ledger td { vertical-align: top; }
.w-ledger .w-meta-cell { width: 190px; }
.w-ledger .w-side-cell { width: auto; }
/* 中缝：一条狭长的竖向细线（借贷分栏线，不显示任何内容） */
.w-ledger .w-divider {
  width: 18px; padding: 0 !important;
  border-left: 1px solid rgba(140,220,222,.34);
}
.w-ledger .w-in-head { color: #12808f; }
.w-ledger .w-out-head { color: #b45309; }
.w-ledger-row > td { border-bottom: 1px solid rgba(0,60,72,.08); }

.w-meta-date { font-weight: 650; font-size: 13px; }
.w-meta-no { font-size: 12px; font-weight: 650; letter-spacing: .02em; margin-top: 2px; }
.w-meta-no.is-in { color: #12808f; }
.w-meta-no.is-out { color: #b45309; }
.w-meta-sub { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.w-row-actions { margin-top: 6px; display: flex; gap: 10px; }

.w-side { display: flex; flex-direction: column; gap: 6px; }
.w-side-head { font-size: 12px; font-weight: 600; }
.w-side.is-in .w-side-head { color: #0f6f7c; }
.w-side.is-out .w-side-head { color: #a2570a; }
.w-lines { display: flex; flex-direction: column; gap: 3px; }
.w-line { display: flex; align-items: baseline; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.w-line-name { font-weight: 600; }
.w-line-spec { font-size: 12px; color: var(--text-2); }
.w-line-qty { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; }
.w-side-empty { color: var(--text-2); opacity: .45; text-align: center; padding: 6px 0; }

.w-filter { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 16px; align-items: end; }
.w-filter .form-field { min-width: 0; }
.w-filter-foot { display: flex; justify-content: flex-end; }
.w-check { display: flex; align-items: center; }
.w-check-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }

/* ---------- ③ 在库资产总览 ---------- */
.w-stock .w-onhand { font-weight: 750; }
.w-stock .w-onhand.is-neg { color: #b45309; }
.w-stock tr.is-zero { opacity: .55; }
.w-tag {
  display: inline-block; min-width: 20px; text-align: center;
  padding: 1px 6px; border-radius: 6px; font-size: 11px; font-weight: 700;
}
.w-tag.is-in { background: rgba(18,128,143,.12); color: #0f6f7c; }
.w-tag.is-out { background: rgba(180,83,9,.12); color: #a2570a; }

/* ---------- ④ 出库：从「在库剩余」中选择 ---------- */
.cell-handle select.w-pick { flex: 1 1 auto; width: auto; min-width: 0; font-size: 13px; }
.cell-handle select.w-pick option { background: #fff; color: #10242b; }
.w-items input.is-ro { color: var(--text-2); cursor: default; }
.w-items input.is-ro:focus { border-color: var(--border); }
.w-th-note { font-size: 10.5px; font-weight: 400; color: var(--text-2); margin-left: 2px; }
.w-remain { font-size: 11px; margin-top: 3px; color: var(--text-2); white-space: nowrap; }
.w-remain.is-over { color: #b45309; font-weight: 650; }
.w-qty.is-over { border-color: #b45309 !important; color: #b45309; }

/* ---------- ⑤ 编辑记录（谁改过这张单） ---------- */
.w-edits { margin-top: 18px; }
.w-edits-list { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.w-edit-row {
  display: flex; gap: 10px; align-items: baseline; padding: 7px 10px;
  font-size: 12.5px; border-top: 1px solid var(--border); flex-wrap: wrap;
}
.w-edit-row:first-child { border-top: 0; }
.w-edit-who { font-weight: 650; min-width: 72px; }
.w-edit-when { color: var(--text-2); font-variant-numeric: tabular-nums; min-width: 148px; }
.w-edit-what { flex: 1 1 200px; color: var(--text-2); }
.w-edits-empty { font-size: 12.5px; color: var(--text-2); padding: 4px 2px; }
.w-edits-note { font-size: 13px; margin-bottom: 10px; }

/* ---------- 深色场景 ---------- */
body.app-mode .w-kind-hint { color: rgba(211,234,236,.62); }
body.app-mode .w-grid .form-field label { color: rgba(215,238,240,.72); }
body.app-mode .w-ledger .w-divider { border-left-color: rgba(170,244,240,.3); }
body.app-mode .w-ledger-row > td { border-bottom-color: rgba(255,255,255,.07); }
body.app-mode .w-meta-no.is-in { color: #7fe6df; }
body.app-mode .w-meta-no.is-out { color: #ffc46b; }
body.app-mode .w-side-head { color: rgba(238,252,252,.9); }
body.app-mode .w-side.is-in .w-side-head { color: #7fe6df; }
body.app-mode .w-side.is-out .w-side-head { color: #ffc46b; }
body.app-mode .w-line-spec, body.app-mode .w-meta-sub, body.app-mode .w-side-empty { color: rgba(203,229,232,.62); }
body.app-mode .w-tag.is-in { background: rgba(127,230,223,.16); color: #9ff3ec; }
body.app-mode .w-tag.is-out { background: rgba(255,196,107,.16); color: #ffd894; }
body.app-mode .w-in-head { color: #7fe6df; }
body.app-mode .w-out-head { color: #ffc46b; }
body.app-mode .w-stock .w-onhand.is-neg { color: #ffc46b; }

/* 出库选料 + 编辑记录（深色） */
body.app-mode .cell-handle select.w-pick option { background: #0b2732; color: #eafcfa; }
body.app-mode .w-items input.is-ro,
body.app-mode .w-remain,
body.app-mode .w-edits-empty,
body.app-mode .w-edit-when,
body.app-mode .w-edit-what { color: rgba(203,229,232,.62); }
body.app-mode .w-remain.is-over,
body.app-mode .w-qty.is-over { color: #ffc46b; }
body.app-mode .w-th-note { color: rgba(203,229,232,.5); }
body.app-mode .w-edits-list { border-color: rgba(255,255,255,.1); }
body.app-mode .w-edit-row { border-top-color: rgba(255,255,255,.07); }

/* ---------- 窄屏 ---------- */
@media (max-width: 980px) {
  .w-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .w-grid { grid-template-columns: 1fr; }
  .w-ledger .w-meta-cell { width: 140px; }
}
