/* ==========================================================================
 * 物品进销存（精简版） —— 仅补充平台通用样式之外、本模块专属的样式。
 * 通用类（card / tbl / btn / tag / filterbar / control / field / grid2 / empty /
 * muted / toast / login-tip 等）复用平台 assets/css/style.css，此处不重复定义。
 * ========================================================================== */

/* 模块内二级 Tab 栏 */
.inv-tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.inv-tab {
  border: 1px solid var(--border-strong); background: #fff; color: var(--text-2);
  border-radius: 999px; height: 34px; padding: 0 18px; font-size: 13.5px; cursor: pointer;
  transition: all .15s; white-space: nowrap;
}
.inv-tab:hover { border-color: var(--c-primary); color: var(--c-primary); }
.inv-tab.active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; font-weight: 600; }

/* KPI 卡片 */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.kpi__ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 10px; }
.kpi__v { font-size: 25px; font-weight: 750; line-height: 1.1; }
.kpi__l { color: var(--muted); font-size: 12.5px; margin-top: 3px; }

/* 双栏 / 三一栏布局 */
.section2 { display: grid; gap: 16px; }
.section2.c2 { grid-template-columns: 1fr 1fr; }
.section2.c31 { grid-template-columns: 1.4fr 1fr; }

/* 强调按钮（区别于主色） */
.btn--accent { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.btn--accent:hover { background: #0c8a7c; color: #fff; }

/* 低库存行高亮 */
.warn-row td { background: #fff7f7 !important; }

/* 扫码 / 领取 */
.scanner { position: relative; background: #0a1020; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; display: grid; place-items: center; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner__hint { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 12px; background: rgba(0,0,0,.55); color: #fff; font-size: 12.5px; text-align: center; }
.scanner__hint.scanning { background: rgba(14,159,143,.85); }
.claim-item { padding: 12px 14px; background: var(--c-primary-050); border-radius: 10px; }
.claim-item__name { font-size: 17px; font-weight: 700; }
.claim-stock { margin-top: 10px; font-size: 14px; }
.claim-stock b { font-size: 20px; font-weight: 750; }
.claim-ok { text-align: center; padding: 14px 0; }
.claim-ok__ic { width: 52px; height: 52px; border-radius: 50%; background: var(--c-success-050); color: var(--c-success); font-size: 28px; display: grid; place-items: center; margin: 0 auto 10px; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .section2.c2, .section2.c31 { grid-template-columns: 1fr; }
}

/* ---------- 页头 / 筛选栏：模块级统一定义（此前无样式导致控件纵向堆叠、间隔混乱） ---------- */
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 2px 0 18px; }
.page-head .t { font-size: 19px; font-weight: 750; letter-spacing: .2px; }
.page-head .d { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.page-head .spacer, .filterbar .spacer { flex: 1; }

.filterbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; margin-bottom: 16px; }
.filterbar .control { height: 38px; min-width: 160px; }
.filterbar .control input { min-width: 210px; }
.filterbar .btn { height: 38px; flex: none; }
.filterbar__count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.filterbar__count b { color: var(--text); font-weight: 700; }

/* 新建分类：颜色选择 */
.cat-swatch { width: 26px; height: 26px; border-radius: 8px; cursor: pointer; display: inline-block;
  position: relative; border: 2px solid #fff; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); transition: transform .12s; }
.cat-swatch:hover { transform: scale(1.08); }
.cat-swatch.on { border-color: var(--c-primary); box-shadow: 0 0 0 2px var(--c-primary-050); }
.cat-swatch--custom { display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; text-shadow: 0 0 2px rgba(0,0,0,.4); }

/* 设置页：审批开关 */
.setting-row { display: flex; align-items: flex-start; gap: 16px; }
.setting-row__txt { flex: 1; }
.setting-row__t { font-size: 14.5px; font-weight: 600; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; margin-top: 2px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: #cdd3e0; border-radius: 999px; transition: .2s; }
.switch .slider:before { content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--c-primary, #2f5bd8); }
.switch input:checked + .slider:before { transform: translateX(20px); }
