:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f4f7fc;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5eaf2;
  --danger: #dc2626;
  --success: #059669;
  --warning: #d97706;
  --radius: 12px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; }

.desktop-only { display: block; }
.mobile-only { display: none; }

/* ---------- 登录页 ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-shell { width: 100%; max-width: 960px; display: grid; grid-template-columns: 1fr 420px; gap: 72px; align-items: center; }
.login-logo { width: 64px; height: 64px; border-radius: 18px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 600; margin-bottom: 20px; }
.login-title { font-size: 32px; font-weight: 600; margin: 0 0 10px; letter-spacing: -.5px; }
.login-sub { color: var(--muted); margin: 0; font-size: 15px; }
.brand-features { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.brand-features span { background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 6px 13px; font-size: 12px; color: var(--muted); }
.login-tabs { display: flex; background: #e9eef6; border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.login-tab { flex: 1; text-align: center; padding: 10px 0; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 14px; }
.login-tab.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.login-panel { background: var(--card); border-radius: 14px; padding: 26px; border: 1px solid var(--border); }
.hint { color: var(--muted); font-size: 12px; line-height: 1.7; }
.login-foot { margin-top: 16px; text-align: center; }

/* ---------- 主框架 ---------- */
#app { min-height: 100vh; }
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 232px; background: #fff; border-right: 1px solid var(--border); padding: 22px 14px 16px; display: flex; flex-direction: column; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; padding: 0 10px; margin-bottom: 30px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.side-nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border: 0; background: none; border-radius: 9px; color: var(--muted); cursor: pointer; text-align: left; margin-bottom: 4px; font-size: 14px; }
.side-nav button:hover { background: #f5f8ff; color: var(--primary); }
.side-nav button.active { background: #eff4ff; color: var(--primary); font-weight: 600; }
.side-icon { width: 20px; text-align: center; font-size: 17px; }
.main-area { margin-left: 232px; min-height: 100vh; }
.app-header { background: #fff; border-bottom: 1px solid var(--border); padding: 13px 30px; position: sticky; top: 0; z-index: 10; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.header-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.header-avatar { width: 30px; height: 30px; border-radius: 50%; background: #eff4ff; color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex: none; }
.header-user-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-user-role { font-size: 12px; color: var(--muted); background: #f3f6fb; border-radius: 6px; padding: 2px 9px; white-space: nowrap; flex: none; }
.loading-bar { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--primary); opacity: 0; transition: width .3s ease, opacity .3s; }
.loading-bar.show { width: 100%; opacity: .7; animation: loading-sweep 1.2s ease-in-out infinite; }
@keyframes loading-sweep { 0% { opacity: .25; } 50% { opacity: .85; } 100% { opacity: .25; } }
.header-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.header-refresh { background: #fff; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 7px 13px; font-size: 13px; cursor: pointer; transition: border-color .15s, color .15s; }
.header-refresh:hover { border-color: var(--primary); color: var(--primary); }
.logout-btn { background: #eef2fb; border: 0; color: var(--primary); border-radius: 8px; padding: 8px 14px; font-size: 13px; cursor: pointer; }
.content { padding: 24px 30px 48px; max-width: 1500px; margin: 0 auto; }
.tabbar { display: none; }

/* ---------- 通用组件 ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 16px; display: flex; justify-content: space-between; align-items: center; }
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat b { display: block; font-size: 24px; color: var(--primary); font-weight: 600; line-height: 1.3; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.warn b { color: var(--warning); }
.stat-click { cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.stat-click:hover { border-color: var(--primary); box-shadow: 0 2px 10px rgba(37,99,235,.12); }
.stat-active { border-color: var(--primary); background: #eff6ff; box-shadow: 0 0 0 1px var(--primary) inset; }
.stat-active span { color: var(--primary); font-weight: 600; }
.qrcode-box { display: flex; align-items: center; flex-direction: column; justify-content: center; min-height: 300px; }
.qrcode-img { width: 260px; height: 260px; image-rendering: pixelated; }
.qrcode-hint { color: var(--muted); font-size: 13px; }
.qrcode-box .hint { margin-top: 14px; text-align: center; }
.row-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.record-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.record-filter input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; outline: none; background: #fff; }
.record-filter input:focus { border-color: var(--primary); }
.record-filter input[type="text"] { flex: 1; min-width: 140px; }
.filter-sep { color: var(--muted); font-size: 12px; }
.edit-grid { margin-bottom: 4px; }
/* 库存查询快捷入库/出库弹窗：物品信息只读网格 */
.quick-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; background: #f7f9fc; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.quick-info-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.quick-info-item span { font-size: 12px; color: var(--muted); }
.quick-info-item b { font-size: 14px; color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.purpose-cell { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-purpose { font-size: 12px; color: var(--muted); margin-top: 8px; }
@media (max-width: 600px) { .quick-info-grid { grid-template-columns: 1fr; } }
.search-row { display: flex; gap: 10px; margin-bottom: 18px; max-width: 760px; flex-wrap: wrap; }
.search-row input { flex: 1; min-width: 180px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 9px; outline: none; background: #fff; }
.search-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.search-row select { padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; outline: none; background: #fff; color: var(--text); cursor: pointer; }
.search-row select:focus { border-color: var(--primary); }
.search-row button { padding: 0 20px; border: 0; background: var(--primary); color: #fff; border-radius: 9px; cursor: pointer; }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px;
  background: #fff; color: var(--text); outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.field textarea { resize: vertical; min-height: 68px; }
.file-picker { display: flex; align-items: center; gap: 8px; }
.file-picker input[type="file"] { flex: 1; min-width: 0; }
.file-clear { flex: none; padding: 9px 12px; border: 1px solid var(--danger); border-radius: 9px; background: #fff; color: var(--danger); font-size: 12px; white-space: nowrap; cursor: pointer; }
.file-clear:hover { background: #fef2f2; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; margin-top: 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 9px; padding: 10px 16px; cursor: pointer; font-weight: 600; font-size: 14px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-block { width: 100%; }
.btn-ghost { background: #eef2fb; color: var(--primary); }
.btn-danger { background: #fef2f2; color: var(--danger); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.form-submit { min-width: 160px; }

.content-cols { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; gap: 18px; align-items: start; }

/* ---------- 用户管理页 ---------- */
.users-layout { display: flex; flex-direction: column; gap: 18px; }
.users-add-form { row-gap: 14px; }
.users-add-form .field { margin-bottom: 0; }
.users-add-form + .form-submit { margin-top: 16px; }
.users-extra-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding-top: 15px; border-top: 1px dashed var(--border); }

/* ---------- 数据表格 ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 12px 14px; background: #f8fafc; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid #f1f4f8; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafcff; }
.data-table .num { font-weight: 600; color: var(--primary); }
.data-table .plus { color: var(--success); font-weight: 600; }
.data-table .minus { color: var(--danger); font-weight: 600; }
.table-title { font-size: 14px; font-weight: 600; padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.table-empty { padding: 34px; text-align: center; color: var(--muted); font-size: 13px; }

.tag { display: inline-block; background: #eff4ff; color: var(--primary); border-radius: 5px; padding: 2px 8px; font-size: 11px; }
.tag.warn { background: #fff7e6; color: var(--warning); }
.tag.danger { background: #fef2f2; color: var(--danger); }
.tag.green { background: #ecfdf5; color: var(--success); }
.tag.keeper { background: #eff4ff; color: var(--primary); }
.tag.gray { background: #f3f4f6; color: var(--muted); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; }
.badge.keeper { background: #eff4ff; color: var(--primary); }
.badge.admin { background: #fef3c7; color: #b45309; font-weight: 600; }
.cleanup-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border: 1px dashed #d1d5db; border-radius: 8px; background: #fafafa; }
.cleanup-bar .hint { margin: 0; flex: 1 1 100%; }
.cleanup-bar input[type="date"] { padding: 6px 8px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; }
.badge.normal { background: #f3f4f6; color: var(--muted); }
.badge.off { background: #fef2f2; color: var(--danger); }

/* ---------- 移动端卡片（窄屏显示） ---------- */
.item { border: 1px solid var(--border); border-radius: 10px; padding: 13px; margin-bottom: 10px; background: #fff; }
.item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.item-name { font-weight: 600; font-size: 15px; }
.item-sku { color: var(--muted); font-size: 12px; margin-top: 2px; }
.qty { font-size: 18px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.qty small { font-size: 11px; color: var(--muted); font-weight: 400; }
.item-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 11px; font-size: 12px; color: var(--muted); }
.user-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.user-row:last-child { border-bottom: 0; }
.user-name { font-weight: 600; }
.user-sub { font-size: 12px; color: var(--muted); }

/* ---------- 登录二维码 / 弹窗 / 提示 ---------- */
.qr-box { display: flex; flex-direction: column; align-items: center; text-align: center; }
.qr-box svg { width: 190px; height: 190px; border: 8px solid #fff; border-radius: 8px; box-shadow: 0 0 0 1px var(--border); }
.qr-caption { color: var(--muted); font-size: 13px; margin: 14px 0 12px; }
.qr-choices { width: 100%; display: flex; gap: 10px; }
.qr-choices .btn { flex: 1; font-size: 13px; padding: 10px 6px; }
.notice { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 9px; padding: 10px 12px; font-size: 12px; line-height: 1.6; margin-bottom: 14px; }
.empty { text-align: center; color: var(--muted); padding: 34px 12px; font-size: 13px; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 14px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.paging-info b { color: var(--text); }
.paging-size { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.paging-size select { padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px; background: #fff; color: var(--text); font-size: 12px; cursor: pointer; outline: none; }
.paging-size select:focus { border-color: var(--primary); }
.paging-btns { display: inline-flex; gap: 6px; }
.paging-btns .btn { padding: 5px 11px; }
.paging-btns .btn:disabled { opacity: .4; cursor: not-allowed; }
.sync-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--success); margin-right: 5px; }
.sync-dot.off { background: var(--danger); }
.toast { position: fixed; top: 22px; left: 50%; transform: translateX(-50%) translateY(-18px); background: rgba(17,24,39,.94); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: 86vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.modal-mask { position: fixed; inset: 0; background: rgba(17,24,39,.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: #fff; width: 100%; max-width: 440px; border-radius: 14px; padding: 24px; }
.modal.modal-wide { max-width: 760px; max-height: 86vh; overflow: auto; }
.modal.modal-low-stock { display: flex; flex-direction: column; max-width: 760px; min-height: 280px; }
.modal.modal-low-stock .form-actions { justify-content: flex-end; margin-top: auto; padding-top: 16px; }
.modal h3 { margin: 0 0 14px; font-size: 17px; }
.request-card { border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.request-head { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.request-note { margin: 8px 0 4px; font-size: 13px; }

/* ---------- 批量打印标签 ---------- */
.labels-page { display: flex; flex-direction: column; gap: 14px; }
.labels-toolbar { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; border-radius: 12px; background: #fff; box-shadow: 0 2px 12px rgba(31,35,41,.05); }
.labels-title { margin: 0 0 6px; font-size: 17px; }
.labels-toolbar .hint { margin: 0; max-width: 620px; }
.labels-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.labels-controls select, .labels-controls input { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); font-size: 13px; cursor: pointer; outline: none; }
.labels-controls input { width: 210px; cursor: text; }
.labels-controls select:focus, .labels-controls input:focus { border-color: var(--primary); }
.labels-count { font-size: 13px; color: var(--muted); padding: 0 4px; }
.labels-count b { color: var(--primary); }
.label-select-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 14px; border-radius: 12px; background: #fff; box-shadow: 0 2px 12px rgba(31,35,41,.05); max-height: 460px; overflow: auto; }
.label-option { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; cursor: pointer; font-size: 13px; transition: border-color .15s, background .15s; }
.label-option:hover { border-color: var(--primary); }
.label-option.checked { border-color: var(--primary); background: #eff4ff; }
.label-option input { width: 16px; height: 16px; margin-top: 3px; accent-color: var(--primary); cursor: pointer; flex: none; }
.label-option-body { min-width: 0; flex: 1; }
.label-option-name { font-weight: 600; line-height: 1.45; word-break: break-all; white-space: normal; }
.label-option-spec { margin-top: 2px; color: var(--text); font-size: 12px; line-height: 1.4; word-break: break-all; white-space: normal; }
.label-option-meta { margin-top: 3px; color: var(--muted); font-size: 11px; white-space: normal; word-break: break-all; }
.labels-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.label-preview { margin-top: 4px; }
.label-preview-hint { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.label-print-actions { margin-top: 14px; }
.label-sheet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px; border-radius: 12px; background: #fff; box-shadow: 0 2px 12px rgba(31,35,41,.05); }
.label-card { display: flex; align-items: center; gap: 10px; border: 1px dashed #c9ced6; border-radius: 8px; padding: 8px; min-width: 0; }
.label-qr { width: 84px; height: 84px; flex: none; image-rendering: pixelated; }
.label-text { min-width: 0; }
.label-name { font-size: 14px; font-weight: 700; word-break: break-all; }
.label-sku { margin-top: 3px; font-size: 12px; color: var(--muted); }
.label-loc { margin-top: 3px; font-size: 12px; color: var(--muted); }

/* ---------- 出入库页面布局 ---------- */
.page-stack { display: flex; flex-direction: column; gap: 18px; }
.form-grid-wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mode-tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.mode-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 14px; font-size: 13px; color: var(--muted); cursor: pointer; }
.mode-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.batch-common { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; margin-bottom: 14px; }
.batch-table input, .batch-table select { width: 100%; min-width: 88px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; }
.batch-table th, .batch-table td { padding: 6px; }
.batch-stock { color: var(--muted); white-space: nowrap; font-size: 12px; }
.batch-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.import-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.import-result { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; font-size: 13px; }
.import-result-head { font-weight: 600; margin-bottom: 6px; }
.import-result ul { margin: 6px 0 0; padding-left: 20px; color: var(--danger); line-height: 1.7; }

/* ---------- 首页消耗看板 ---------- */
.stats-home { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-grid { display: grid; grid-template-columns: minmax(360px, 1.15fr) minmax(300px, .85fr); gap: 18px; align-items: start; }
.range-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.range-tab { border: 1px solid var(--border); background: #fff; color: var(--muted); border-radius: 7px; padding: 6px 14px; font-size: 12px; cursor: pointer; }
.range-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.donut { width: 200px; height: 200px; max-width: 100%; }
.donut-num { font-size: 27px; font-weight: 700; fill: var(--text); }
.donut-label { font-size: 11px; fill: var(--muted); }
.donut-legend { width: 100%; }
.legend-row { display: flex; align-items: center; gap: 8px; padding: 6px 2px; font-size: 12px; border-bottom: 1px solid #f1f3f7; }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-pct { color: var(--muted); width: 44px; text-align: right; }

/* ---------- 窄屏自适应 ---------- */
@media (max-width: 1200px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .content-cols, .home-grid { grid-template-columns: 1fr; }
  .label-select-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .label-select-list { grid-template-columns: 1fr; }
  .labels-controls input { width: 100%; }
}

/* ===== 消耗分析 / 组织设置 ===== */
.page-stack { display: flex; flex-direction: column; gap: 16px; }
.report-filter { display: flex; flex-direction: column; gap: 18px; margin: 18px 0 20px; padding: 18px 20px; background: #f7f9fc; border: 1px solid var(--border); border-radius: 10px; }
.report-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 20px; }
.report-fields .field { min-width: 0; margin-bottom: 0; }
.report-fields .field label { margin-bottom: 7px; }
.report-actions { display: flex; gap: 10px; justify-content: flex-end; }
.stats-report { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stats-report .stat.up b, .num.up { color: var(--danger); }
.stats-report .stat.down b, .num.down { color: var(--success); }
.chart-box { width: 100%; overflow: hidden; }
.chart-box svg { width: 100%; height: auto; max-height: 220px; display: block; }
.chart-label { fill: var(--muted); font-size: 11px; }
.chart-num { fill: var(--text); font-size: 12px; font-weight: 600; }
.bar-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.bar-row:last-child { border-bottom: 0; }
.bar-name { width: 120px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 10px; background: #eef2f8; border-radius: 6px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--primary); border-radius: 6px; }
.bar-value { width: 52px; text-align: right; }
.bar-pct { width: 46px; text-align: right; color: var(--muted); font-size: 12px; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.org-add-form { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; margin: 0 0 18px; padding: 18px 20px; background: #f7f9fc; border: 1px solid var(--border); border-radius: 10px; }
.org-add-form .field { flex: 0 1 260px; min-width: 180px; }
.org-add-form .btn { margin-bottom: 0; padding: 10px 18px; }

@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; max-width: 440px; gap: 0; }
  .login-brand { text-align: center; margin-bottom: 26px; }
  .login-logo { margin-left: auto; margin-right: auto; }
  .login-title { font-size: 26px; }
  .brand-features { justify-content: center; }
  .sidebar { display: none; }
  .main-area { margin-left: 0; }
  .app-header { padding: 12px 16px; }
  .header-user-name { font-size: 14px; }
  .content { padding: 14px 14px 90px; }
  .tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; display: flex; background: #fff; border-top: 1px solid var(--border); padding: 7px 4px calc(7px + env(safe-area-inset-bottom)); z-index: 20; }
  .tabbar button { flex: 1; background: none; border: 0; color: var(--muted); font-size: 11px; padding: 4px 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; }
  .tabbar button.active { color: var(--primary); font-weight: 600; }
  .tab-icon { font-size: 20px; line-height: 1; }
  .desktop-only { display: none !important; }
  .mobile-only { display: block; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stats-home { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .stat { padding: 13px 8px; text-align: center; }
  .stat b { font-size: 20px; }
  .form-grid, .form-grid-wide, .batch-common { grid-template-columns: 1fr; }
  .batch-table { min-width: 760px; }
  .form-submit { width: 100%; }
  .modal-mask { align-items: flex-end; }
  .modal { max-width: none; border-radius: 18px 18px 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .label-sheet { grid-template-columns: repeat(2, 1fr); }
  .labels-controls { width: 100%; }
  .stats-report { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-grid { grid-template-columns: 1fr; }
  .bar-name { width: 88px; }
  .report-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-actions { justify-content: stretch; }
  .report-actions .btn { flex: 1; min-width: 0; padding: 10px 8px; }
  .org-add-form .field { flex: 1 1 100%; }
}

/* ---------- 测试模式 ---------- */
/* 总闸控件：超管在正常模式下显示于导航栏下方（与手机端同一套规则） */
.gate-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 9px 20px; background: #fff; border-bottom: 1px solid var(--border); }
.gate-state { font-size: 13px; color: var(--muted); }
.gate-state.on { color: #8a6d1f; font-weight: 600; }
.gate-bar .btn { flex: 0 0 auto; }
.mode-toggle { display: flex; align-items: flex-start; gap: 9px; margin: 2px 0 18px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-size: 13px; color: var(--text); line-height: 1.5; }
.mode-toggle input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--warning); flex: 0 0 auto; }
.mode-toggle em { font-style: normal; color: var(--muted); font-size: 12px; }
.test-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 20px; background: #fff8e1; border-bottom: 1px solid #f0e0a8; color: #7a5d12; font-size: 13px; }
.test-banner strong { color: #8a6d1f; }
.test-banner-dot { width: 9px; height: 9px; border-radius: 50%; background: #e0a800; flex: 0 0 auto; box-shadow: 0 0 0 3px rgba(224,168,0,.18); }
.test-banner-btn { margin-left: auto; background: #8a6d1f; color: #fff; border: 0; border-radius: 7px; padding: 5px 12px; font-size: 12px; cursor: pointer; }
.test-banner-tools { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.test-banner-tools .test-banner-btn { margin-left: 0; }
.test-banner-btn.tseed { background: #2f855a; }
.test-banner-btn.tclear { background: #b7791f; }
.test-banner-btn:hover { filter: brightness(.94); }
.test-data-panel { margin-top: 14px; padding: 14px 16px; border: 1px solid #e6d48a; border-radius: 10px; background: linear-gradient(180deg, #fffdf3, #fffbf0); }
.test-data-head { display: flex; align-items: center; gap: 12px; }
.test-data-icon { width: 40px; height: 40px; border-radius: 10px; background: #fdf1c4; display: flex; align-items: center; justify-content: center; font-size: 20px; flex: 0 0 auto; }
.test-data-title { font-size: 14px; font-weight: 700; color: #7a5d12; }
.test-data-desc { font-size: 12px; color: #8a6d1f; margin-top: 3px; }
.test-data-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.test-data-tip { font-size: 11px; color: #9a8340; margin-top: 10px; line-height: 1.6; }
.test-card { border-color: #e0c878; background: #fffdf5; }
@media (max-width: 860px) {
  .test-banner { padding: 10px 14px; font-size: 12px; }
  .test-banner-btn { margin-left: 0; }
}

/* ===== 库存查询页勾选 + 批量操作 ===== */
.inv-check-cell { width: 40px; text-align: center !important; }
.inv-check { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; vertical-align: middle; }
.data-table tr.inv-checked { background: #eff4ff; }
.item.inv-checked { border-color: var(--primary); background: #eff4ff; }
.inv-check-card { flex: none; display: flex; align-items: center; padding-right: 2px; }
.inv-batch-bar { display: none; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 14px; padding: 12px 16px; border: 1px solid var(--primary); border-radius: 10px; background: #f5f8ff; }
.inv-batch-bar.show { display: flex; }
.inv-batch-count { font-size: 13px; color: var(--text); }
.inv-batch-count b { color: var(--primary); font-size: 15px; }
.inv-batch-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.inv-batch-preview { padding: 10px 12px; background: #f5f8ff; border-radius: 9px; font-size: 13px; }
.inv-batch-preview > div { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.inv-pill { display: inline-block; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; font-size: 12px; color: var(--text); }

/* ===== 勾选出库（出库单） ===== */
.sheet-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 10px; }
.sheet-toolbar input { flex: 1; min-width: 180px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; background: #fff; color: var(--text); }
.sheet-toolbar select { padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; background: #fff; color: var(--text); }
.sheet-pick-count { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.sheet-pick-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-height: 52vh; overflow-y: auto; padding-right: 2px; }
.sheet-pick-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; }
.sheet-pick-item:hover { border-color: var(--primary); }
.sheet-pick-item.checked { border-color: var(--primary); background: #eff4ff; }
.sheet-pick-item.out { opacity: .55; cursor: not-allowed; }
.sheet-pick-item input[type="checkbox"] { width: 17px; height: 17px; flex: none; accent-color: var(--primary); cursor: pointer; }
.sheet-pick-item.out input { cursor: not-allowed; }
.sp-body { flex: 1; min-width: 0; }
.sp-name { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-meta { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.sp-stock { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }
.sp-stock b { color: var(--text); font-size: 14px; }
.sheet-pick-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.sheet-confirm-table .sheet-qty-input { width: 92px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; }
.sheet-confirm-table .muted { color: var(--muted); font-size: 12px; }
.sheet-success { display: flex; align-items: center; gap: 14px; padding: 16px; margin-bottom: 14px; border-radius: 12px; background: #ecfdf5; border: 1px solid #a7f3d0; }
.sheet-success-tick { width: 42px; height: 42px; flex: none; border-radius: 50%; background: var(--success); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.sheet-success h2 { margin: 0 0 2px; font-size: 18px; color: #065f46; }
.sheet-success p { margin: 0; font-size: 13px; color: #047857; }
.sheet-detail-actions { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 14px; }
/* 单据打印区（屏幕预览） */
.sheet-print-area { background: #fff; color: #111; padding: 28px 32px; border: 1px solid var(--border); border-radius: 8px; }
.sheet-print-area h1 { font-size: 22px; text-align: center; margin: 0 0 4px; }
.sheet-print-sub { text-align: center; font-size: 13px; color: #555; margin-bottom: 18px; }
.sheet-print-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; font-size: 13px; margin-bottom: 16px; }
.sheet-print-meta div { border-bottom: 1px solid #ddd; padding-bottom: 5px; }
.sheet-print-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sheet-print-table th, .sheet-print-table td { border: 1px solid #999; padding: 8px 7px; text-align: left; }
.sheet-print-table th { background: #f2f2f2; }
.sheet-print-total { text-align: right; font-size: 15px; font-weight: 600; margin: 12px 0; }
.sheet-print-note { font-size: 13px; margin-top: 8px; }
.sheet-print-sign { display: flex; justify-content: space-between; margin-top: 40px; font-size: 14px; }
/* 出库单记录列表 */
.sheet-order-list { display: flex; flex-direction: column; gap: 8px; }
.sheet-order-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.sheet-order-row:hover { border-color: var(--primary); background: #f8faff; }
.so-no { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; color: var(--primary); }
.so-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.so-r { font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; }
.so-r b { color: var(--text); }
.so-r span { color: var(--primary); margin-left: 10px; }
@media (max-width: 860px) {
  .sheet-pick-list { grid-template-columns: 1fr; }
}

/* ===== 库存查询：操作列固定右侧 + 更多下拉 ===== */
.inv-table th.inv-actions-head,
.inv-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  box-shadow: -8px 0 14px -10px rgba(15,23,42,.28);
}
.inv-table th.inv-actions-head { background: #f8fafc; z-index: 3; }
.inv-table tbody tr:hover td:last-child { background: #fafcff; }
.inv-table tbody tr.inv-checked td:last-child { background: #eff4ff; }
.inv-table .row-actions { flex-wrap: nowrap; gap: 6px; }
.row-more { position: relative; display: inline-flex; }
.row-more-btn { white-space: nowrap; }
.row-more-caret { font-size: 10px; margin-left: 2px; }
.row-more-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 108px;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: 0 10px 26px rgba(15,23,42,.16);
  z-index: 30;
}
.row-more.open .row-more-menu { display: block; }
.row-more.drop-up .row-more-menu { top: auto; bottom: calc(100% + 6px); }
.row-more-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.row-more-item:hover { background: #f1f5f9; }
.row-more-item.danger { color: var(--danger); }
.row-more-item.danger:hover { background: #fef2f2; }
.inv-table tbody tr.more-open td:last-child { z-index: 30; }

/* ===== 库存勾选：出库并生成单据弹窗 ===== */
.modal.modal-outbound-sheet { max-width: 980px; max-height: 90vh; padding: 24px 28px; display: flex; flex-direction: column; }
.modal.modal-outbound-sheet h3 { margin-bottom: 18px; font-size: 18px; }
.ob-meta-grid { gap: 14px 18px; }
.ob-meta-grid .field label { font-weight: 600; color: var(--text); }
.ob-meta-grid input, .ob-meta-grid select { padding: 10px 12px; font-size: 14px; }
.ob-section-title { margin: 20px 0 10px; font-size: 14px; font-weight: 600; color: var(--text); }
.ob-table-wrap { border: 1px solid var(--border); border-radius: 10px; overflow: auto; max-height: 48vh; }
.ob-table { min-width: 640px; }
.ob-table th, .ob-table td { padding: 11px 14px; vertical-align: middle; white-space: nowrap; }
.ob-table thead th { position: sticky; top: 0; z-index: 1; }
.ob-table .ob-name-main { font-weight: 600; }
.ob-table .ob-name-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.ob-table .ob-stock { color: var(--primary); font-weight: 600; }
.ob-table .ob-unit { color: var(--muted); font-weight: 400; }
.ob-table input { width: 100%; min-width: 110px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); font-size: 13px; }
.ob-table input:focus { outline: none; border-color: var(--primary); }
.ob-table .ob-note { min-width: 190px; }
.modal.modal-outbound-sheet .form-actions { justify-content: space-between; align-items: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.ob-summary { font-size: 14px; color: var(--text); }
.ob-summary b { color: var(--primary); font-size: 16px; }
.ob-actions-right { display: flex; gap: 10px; }
.ob-actions-right .btn { min-width: 96px; padding: 9px 16px; }
.ob-success { text-align: center; padding: 8px 0 4px; }
.ob-success p { margin: 6px 0; }
@media (max-width: 860px) {
  .modal.modal-outbound-sheet { max-width: none; max-height: 94vh; padding: 18px; }
  .ob-table-wrap { max-height: 54vh; }
}

/* ===== 物资档案 & 入库自动带出信息 ===== */
.item-readonly-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; padding: 14px 16px; border: 1px dashed var(--border); border-radius: 10px; background: #f8fafc; margin-top: 4px; }
.item-readonly-item { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.item-readonly-item span { font-size: 12px; color: var(--muted); }
.item-readonly-item b { font-size: 13px; color: var(--text); word-break: break-all; }
.batch-table td.muted { color: var(--muted); background: #fafbfc; }
@media (max-width: 1100px) { .item-readonly-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .item-readonly-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ===== 入库单：搜索 / 即时校验 / 危险操作降权 ===== */
.ni-search { display: flex; flex-direction: column; gap: 3px; min-width: 170px; }
.ni-search input { width: 100%; }
.ni-sku { font-size: 11px; color: var(--muted); white-space: nowrap; }
.ni-table { min-width: 1180px; }
.ni-qty-cell { position: relative; }
.ni-qty-cell input.invalid { border-color: var(--danger); background: #fff5f5; }
.ni-err { display: block; color: var(--danger); font-size: 11px; line-height: 1.3; }
[data-form="new-inbound-sheet"] button[type="submit"]:disabled { opacity: .5; cursor: not-allowed; }
.btn-outline-danger { background: transparent !important; color: var(--danger) !important; border: 1px solid var(--danger) !important; }
.btn-outline-danger:hover { background: #fff5f5 !important; }
.view-switch { display: flex; gap: 6px; border-top: 1px solid var(--border); padding-top: 12px; }

/* ===== 新建出库单：模糊搜索 / 即时校验 / 导入 / 部分失败 ===== */
.ns-search { display: flex; flex-direction: column; gap: 3px; min-width: 170px; }
.ns-search input { width: 100%; }
.ns-sku { font-size: 11px; color: var(--muted); white-space: nowrap; }
.ns-table { min-width: 1180px; }
.ns-qty-cell { position: relative; }
.ns-qty-cell input.invalid { border-color: var(--danger); background: #fff5f5; }
.ns-err { display: block; color: var(--danger); font-size: 11px; line-height: 1.3; min-height: 0; }
.ns-file-label { display: inline-flex; cursor: pointer; }
.ns-table tr.row-error td { background: #fff8f8; }
[data-form="new-sheet"] button[type="submit"]:disabled { opacity: .5; cursor: not-allowed; }
.ob-row-failed td { background: #fff5f5 !important; }
.ob-row-err { color: var(--danger); font-size: 11px; margin-top: 3px; }
.ob-done { color: var(--success); font-size: 12px; font-weight: 600; }
.ob-fail-summary { margin-top: 10px; padding: 8px 12px; border-radius: 6px; background: #fff5f5; color: var(--danger); font-size: 13px; }
.modal-outbound-sheet .ob-table { min-width: 760px; }

/* ===== 附录改造：侧边栏分组/折叠、顶栏下拉、测试徽标 ===== */
.sidebar.collapsed { width: 64px; padding: 18px 8px 14px; }
.sidebar.collapsed .brand-text, .sidebar.collapsed .side-label, .sidebar.collapsed .side-group-title, .sidebar.collapsed .side-foot-meta { display: none; }
.sidebar.collapsed .brand { justify-content: center; padding: 0; margin-bottom: 24px; position: relative; }
.sidebar.collapsed .brand-mark { width: 34px; height: 34px; }
.sidebar.collapsed .side-collapse { position: absolute; top: 42px; right: 50%; transform: translateX(50%); }
.sidebar.collapsed .side-item { justify-content: center; padding: 11px 0; }
.sidebar.collapsed .side-icon { font-size: 19px; }
.sidebar.collapsed .side-foot-item { justify-content: center; }
.main-area { transition: margin-left .18s ease; }
.main-area.nav-collapsed { margin-left: 64px; }
.brand { position: relative; }
.brand-text { white-space: nowrap; }
.side-collapse { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border: 1px solid var(--border); background: #fff; color: var(--muted); border-radius: 6px; cursor: pointer; font-size: 14px; line-height: 1; }
.side-collapse:hover { color: var(--primary); border-color: var(--primary); }
.side-group { margin-bottom: 14px; }
.side-group-title { font-size: 11px; color: #9aa3b2; padding: 0 14px 6px; text-transform: uppercase; letter-spacing: .5px; }
.side-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border: 0; background: none; border-radius: 9px; color: var(--muted); cursor: pointer; text-align: left; margin-bottom: 3px; font-size: 14px; position: relative; }
.side-item:hover { background: #f5f8ff; color: var(--primary); }
.side-item.active { background: #eff4ff; color: var(--primary); font-weight: 600; }
.side-item.active::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; background: var(--primary); border-radius: 0 3px 3px 0; }
.sidebar .side-nav button.side-item { margin-bottom: 3px; }
.side-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.side-foot-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 14px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; text-align: left; border-radius: 8px; }
.side-foot-item:hover { background: #f5f8ff; color: var(--primary); }
.side-foot-item > span:first-child { width: 20px; text-align: center; }
.side-foot-meta { font-size: 11px; color: #a5adbb; padding: 6px 14px 0; }
.breadcrumb { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.breadcrumb i { font-style: normal; color: #cbd2dc; }
.breadcrumb b { color: var(--text); font-weight: 600; }
.header-actions { margin-left: auto; }
.header-caret { font-size: 11px; color: var(--muted); margin-left: 2px; }
.header-user { cursor: pointer; background: none; border: 0; }
.header-user:hover .header-user-name { color: var(--primary); }
.user-menu-wrap, .test-badge-wrap { position: relative; }
.dropdown-menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 190px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 28px rgba(31,35,41,.14); padding: 6px; z-index: 50; }
.dropdown-menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; border-radius: 7px; font-size: 13px; color: var(--text); cursor: pointer; }
.dropdown-menu button:hover { background: #f5f8ff; color: var(--primary); }
.dropdown-menu button.danger { color: var(--danger); }
.dropdown-menu button.danger:hover { background: #fef2f2; }
.test-badge { background: #fff7e0; border: 1px solid #f0d98a; color: #8a6d1f; border-radius: 20px; padding: 6px 13px; font-size: 12px; font-weight: 600; cursor: pointer; }
.test-badge:hover { background: #fff1c4; }
.test-dropdown .td-title { color: #8a6d1f; font-weight: 600; padding: 6px 12px 2px; font-size: 13px; }
.test-dropdown .td-hint { color: var(--muted); font-size: 11px; padding: 0 12px 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }

/* ===== 附录一：统计卡 / 低库存 / 批量栏 / 标签页 ===== */
.stat.stat-static { background: #f4f6f9; border-color: transparent; }
.stat.stat-static b { color: #5b6472; }
.low-stat.alert { background: #fff1f2; border-color: #fecdd3; }
.low-stat.alert b { color: var(--danger); }
.low-stat.alert span { color: var(--danger); }
.active-filters { font-size: 12px; color: var(--muted); margin: 0 0 12px; padding: 7px 12px; background: #f5f8ff; border-radius: 8px; display: inline-block; }
.af-clear { background: none; border: 0; color: var(--primary); cursor: pointer; font-size: 12px; margin-left: 8px; text-decoration: underline; }
.ls-sku { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ls-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.modal-low-stock .modal { width: 900px; max-width: 94vw; }
.row-more-item.disabled { opacity: .45; cursor: not-allowed; }
.row-more-item.disabled:hover { background: none; }
.inv-batch-bar { position: sticky; bottom: 16px; z-index: 20; box-shadow: 0 8px 28px rgba(31,35,41,.16); }
.inv-batch-quick { margin-left: 10px; font-size: 12px; color: var(--muted); }
.link-btn { background: none; border: 0; color: var(--primary); cursor: pointer; font-size: inherit; text-decoration: underline; padding: 0 2px; }
.link-btn:hover { color: #1749b3; }
/* 标签页：左右分栏 + 配置面板 + 预览 */
.labels-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.labels-columns { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 18px; align-items: start; }
.labels-left { display: flex; flex-direction: column; gap: 12px; }
.labels-right { background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(31,35,41,.05); padding: 16px; position: sticky; top: 76px; }
.lr-head { font-size: 15px; font-weight: 600; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.label-config { border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.label-config-toggle { width: 100%; text-align: left; padding: 10px 14px; border: 0; background: none; cursor: pointer; font-size: 13px; color: var(--text); }
.label-config-toggle span { float: right; color: var(--muted); }
.label-config-body { display: none; padding: 4px 14px 14px; border-top: 1px solid var(--border); }
.label-config-body.open { display: block; }
.label-config-checks { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--text); }
.label-config-checks label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.label-cat { margin-top: 3px; font-size: 11px; color: var(--primary); }
.label-history-items { white-space: normal; word-break: break-all; max-width: 420px; color: var(--muted); }
.label-sheet.cfg-size-A5 { grid-template-columns: repeat(2, 1fr); }
.label-sheet.cfg-size-热敏80 { grid-template-columns: repeat(2, 1fr); }
/* 库存调整/盘点弹窗 */
.stock-adjust-info { display: flex; gap: 24px; flex-wrap: wrap; padding: 12px 16px; background: #f5f8ff; border-radius: 9px; }
.stock-adjust-info > div { display: flex; flex-direction: column; gap: 4px; }
.stock-adjust-info span { font-size: 12px; color: var(--muted); }
.stock-adjust-info b { font-size: 15px; color: var(--text); }
.stock-adjust-info .sa-cur { color: var(--primary); }

/* ===== 附录四：出库流水视图 ===== */
.record-filter.flow-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.record-filter.flow-filter input, .record-filter.flow-filter select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: #fff; color: var(--text); outline: none; }
.record-filter.flow-filter input[type="text"] { width: 150px; }
.record-filter.flow-filter input:focus, .record-filter.flow-filter select:focus { border-color: var(--primary); }
.flow-table td { white-space: nowrap; }
.flow-table .flow-time { color: var(--muted); font-size: 12px; }
.flow-table .flow-no { min-width: 150px; }
.flow-table tbody tr:not(:first-child) td.flow-no { border-left: 3px solid var(--primary); }
.flow-table .flow-summary { text-align: left; font-weight: 600; color: var(--primary); background: #f5f8ff; padding: 12px 14px; }
.flow-table .flow-summary b { font-size: 15px; }
.flow-foot { margin-top: 10px; text-align: right; }

/* ===== 本轮改进：只读文本、用途下拉+其他 ===== */
.readonly-text { padding: 9px 12px; background: #f5f7fa; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font-size: 14px; min-height: 38px; }
.purpose-row { display: flex; gap: 8px; align-items: center; }
.purpose-row select { flex: 0 0 200px; }
.purpose-row input { flex: 1; }
/* 组织设置删除硬阻止 */
.btn-danger-solid { background: var(--danger) !important; color: #fff !important; border-color: var(--danger) !important; }
.btn-danger.disabled, .btn.btn-danger:disabled { opacity: .45; cursor: not-allowed; }
.org-dep-list { margin: 10px 0; padding-left: 22px; color: var(--text); font-size: 13px; }
.org-dep-list li { margin: 4px 0; }
.org-highlight { background: #fff7e0 !important; box-shadow: inset 3px 0 0 #e0a800; }

/* ===== 首页驾驶舱：运营概览 + 告警中心 ===== */
.dash-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash-card { cursor: pointer; position: relative; transition: box-shadow .15s, transform .15s; }
.dash-card:hover { box-shadow: 0 4px 16px rgba(37,99,235,.14); transform: translateY(-2px); }
.dash-card b { font-size: 26px; }
.dash-card small { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.dash-card.alert { background: #fff1f2; border-color: #fecdd3; }
.dash-card.alert b, .dash-card.alert span { color: var(--danger); }
.dash-card.alert small { color: var(--danger); opacity: .8; }
.dash-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; }
.dash-full { margin-top: 18px; }
.alert-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.alert-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #fff8f8; border: 1px solid #fecdd3; border-radius: 9px; }
.alert-main { flex: 1; min-width: 0; }
.alert-main b { display: block; font-size: 13px; word-break: break-all; }
.alert-sub { font-size: 11px; color: var(--muted); }
.alert-num { font-size: 13px; color: var(--text); white-space: nowrap; }
.alert-gap { font-size: 13px; color: var(--danger); font-weight: 600; white-space: nowrap; }
.empty.ok { color: var(--success); }
.todo-counts { display: flex; gap: 10px; flex-wrap: wrap; }
.todo-item { flex: 1; min-width: 130px; text-align: left; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; }
.todo-item:hover { border-color: var(--primary); }
.todo-item b { display: block; font-size: 22px; color: var(--primary); }
.todo-item span { font-size: 12px; color: var(--muted); }
.timeline-title { font-size: 13px; font-weight: 600; margin: 16px 0 8px; }
.timeline { display: flex; flex-direction: column; gap: 6px; }
.timeline-row { display: flex; gap: 10px; align-items: center; font-size: 12px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.tl-time { color: var(--muted); width: 78px; flex: none; }
.tl-no { color: var(--primary); margin-left: auto; word-break: break-all; }
.timeline-foot { margin-top: 10px; text-align: right; }
.trend-legend { display: flex; gap: 18px; justify-content: center; font-size: 12px; color: var(--muted); margin-top: 4px; }
.trend-legend span { display: inline-flex; align-items: center; gap: 5px; }
.trend-legend i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.dash-foot { margin-top: 12px; text-align: right; }
.top5-list { display: flex; flex-direction: column; gap: 10px; }
.top5-row { display: flex; align-items: center; gap: 12px; }
.top5-name { width: 130px; flex: none; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top5-track { flex: 1; height: 12px; background: #eef1f6; border-radius: 6px; overflow: hidden; }
.top5-fill { display: block; height: 100%; background: linear-gradient(90deg, #60a5fa, #2563eb); border-radius: 6px; }
.top5-qty { width: 50px; text-align: right; font-size: 13px; color: var(--primary); }
.top5-pct { width: 48px; text-align: right; font-size: 12px; color: var(--muted); }
@media (max-width: 1200px) {
  .dash-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
}
@media print {
  .ns-file-label, .import-toolbar { display: none !important; }
}
.toast-link { background: none; border: 0; color: #93c5fd; text-decoration: underline; cursor: pointer; font-size: 14px; padding: 0 0 0 6px; }
.modal.modal-sheet-preview { max-width: 900px; max-height: 90vh; overflow: auto; padding: 22px 26px; }
.modal.modal-sheet-preview .sheet-preview-body { max-height: 72vh; overflow: auto; }
.modal.modal-sheet-preview .sheet-print-area { border: 1px solid var(--border); border-radius: 8px; }

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  .sidebar, .tabbar, .app-header, .loading-bar, .toast,
  .labels-toolbar, .labels-count, .label-select-list, .labels-actions,
  .label-preview-hint, .label-print-actions, .labels-tabs, .labels-left,
  .label-config, .lr-head, .user-menu-wrap, .test-badge-wrap, .dropdown-menu, .breadcrumb,
  .mode-tabs, .test-banner, .sheet-detail-actions, .sheet-success { display: none !important; }
  .labels-columns { display: block !important; }
  .labels-right { box-shadow: none !important; padding: 0 !important; position: static !important; }
  .main-area, .content { margin: 0 !important; padding: 0 !important; }
  .labels-page, .label-preview { margin: 0 !important; padding: 0 !important; }
  .card, .sheet-detail-card { box-shadow: none !important; border: 0 !important; padding: 0 !important; margin: 0 !important; }
  .sheet-print-area { border: 0 !important; padding: 0 !important; }
  .label-sheet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; padding: 0; box-shadow: none; background: none; }
  .label-card { border: 1px solid #999; border-radius: 0; padding: 2mm; break-inside: avoid; page-break-inside: avoid; }
  .label-qr { width: 26mm; height: 26mm; }
  .label-name { font-size: 12pt; }
  .label-sku, .label-loc { font-size: 9pt; }
  /* 从弹窗预览打印：只输出单据区 */
  .modal-mask { position: static !important; background: none !important; display: block !important; }
  .modal { max-width: none !important; max-height: none !important; overflow: visible !important; padding: 0 !important; }
  .modal h3, .modal .form-actions, .modal .sheet-preview-body > .hint { display: none !important; }
  .modal .sheet-preview-body { max-height: none !important; overflow: visible !important; }
  .modal .sheet-print-area { border: 0 !important; }
  body.sheet-preview-open #app { display: none !important; }
}

/* ===== 通知中心：铃铛 + 未读角标 + 通知面板 + 弹窗卡片 ===== */
.bell-wrap { position: relative; }
.header-bell { position: relative; border: 0; background: none; font-size: 18px; cursor: pointer; padding: 6px 8px; line-height: 1; }
.bell-badge { position: absolute; top: 0; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; line-height: 16px; text-align: center; }
.notif-panel { position: absolute; top: 38px; right: 0; z-index: 60; width: 340px; max-width: calc(100vw - 24px); background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 36px rgba(0,0,0,.16); overflow: hidden; }
.notif-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif-item:hover { background: #f8fafc; }
.notif-item.unread { background: #eff6ff; }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: transparent; flex: none; margin-top: 6px; }
.notif-item.unread .notif-dot { background: var(--primary); }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 600; }
.notif-summary { font-size: 12px; color: var(--muted); margin-top: 3px; word-break: break-all; }
.notif-time { font-size: 11px; color: var(--muted); margin-top: 4px; }
.notif-empty { padding: 28px; text-align: center; color: var(--muted); font-size: 13px; }
.notif-toast { position: fixed; top: 18px; right: 18px; z-index: 200; display: none; width: 340px; max-width: calc(100vw - 24px); gap: 10px; align-items: flex-start; padding: 14px; background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 12px; box-shadow: 0 12px 36px rgba(0,0,0,.18); }
.notif-toast.show { display: flex; animation: nt-in .25s ease; }
@keyframes nt-in { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.nt-icon { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 700; flex: none; }
.nt-icon.new { background: #2563eb; }
.nt-icon.pass { background: #16a34a; }
.nt-icon.rej { background: #dc2626; }
.nt-body { flex: 1; min-width: 0; }
.nt-title { font-size: 14px; font-weight: 600; }
.nt-summary { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.nt-actions { display: flex; flex-direction: column; gap: 6px; }
@media print { .bell-wrap, .notif-panel, .notif-toast { display: none !important; } }
