:root {
  --brand-900: #0a332c;
  --brand-800: #0d4038;
  --brand-700: #11544a;
  --brand-500: #1a8b78;
  --brand-100: #dff0ec;
  --gold: #c9a227;
  --bg: #f2f6f5;
  --card: #ffffff;
  --text: #22312e;
  --muted: #7b8b87;
  --line: #e4ebe9;
  --danger: #d1493f;
  --ok: #2f9e63;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(16, 64, 56, .07);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c6d4d1; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 登录页 ============ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 15% 10%, rgba(26,139,120,.35), transparent 60%),
    radial-gradient(900px 500px at 90% 90%, rgba(201,162,39,.22), transparent 60%),
    linear-gradient(135deg, #0a332c 0%, #0d4038 45%, #11463d 100%);
  padding: 20px;
}
.login-box {
  width: 100%;
  max-width: 940px;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  min-height: 480px;
}
.login-brand {
  background: linear-gradient(160deg, #0d4038, #14625a 70%, #1a8b78);
  color: #fff;
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}
.login-brand::after {
  content: "";
  position: absolute; right: -60px; top: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: rgba(201, 162, 39, .16);
}
.login-brand h1 { font-size: 30px; margin: 0 0 10px; letter-spacing: 3px; font-weight: 600; }
.login-brand .sub { color: rgba(255,255,255,.72); letter-spacing: 4px; font-size: 13px; }
.login-brand .desc { margin-top: 26px; line-height: 2; color: rgba(255,255,255,.8); font-size: 13px; }
.login-brand .foot { font-size: 12px; color: rgba(255,255,255,.45); }
.login-form { padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; }
.login-form h2 { margin: 0 0 6px; font-size: 22px; font-weight: 600; }
.login-form .tip { color: var(--muted); margin-bottom: 26px; font-size: 13px; }
@media (max-width: 780px) {
  .login-box { grid-template-columns: 1fr; }
  .login-brand { padding: 32px; }
  .login-form { padding: 32px; }
}

/* ============ 布局 ============ */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  flex: 0 0 220px;
  background: linear-gradient(180deg, #0a332c, #0f4a41 60%, #11544a);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
}
.brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 11px;
}
.brand .logo {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #c9a227, #e3c561);
  display: grid; place-items: center;
  color: #0a332c; font-weight: 700; font-size: 17px;
  box-shadow: 0 4px 12px rgba(201,162,39,.35);
}
.brand .txt b { display: block; font-size: 15px; letter-spacing: 1.5px; font-weight: 600; }
.brand .txt span { font-size: 11px; color: rgba(255,255,255,.55); letter-spacing: 2px; }
.menu { flex: 1; padding: 14px 12px; overflow-y: auto; }
.menu-group-title {
  font-size: 11px; color: rgba(255,255,255,.4);
  padding: 12px 10px 6px; letter-spacing: 1px;
}
.menu-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px; margin-bottom: 4px;
  border-radius: 9px; cursor: pointer;
  color: rgba(255,255,255,.78);
  transition: .18s; font-size: 14px;
  border-left: 3px solid transparent;
}
.menu-item svg { width: 18px; height: 18px; flex: 0 0 18px; opacity: .85; }
.menu-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.menu-item.active {
  background: linear-gradient(90deg, rgba(26,139,120,.55), rgba(26,139,120,.12));
  color: #fff; border-left-color: var(--gold);
}
/* 二级菜单（账户管理分支） */
.menu-item.has-sub .caret { width: 14px; height: 14px; flex: 0 0 14px; margin-left: auto; opacity: .6; transition: transform .2s; }
.menu-branch.open .menu-item.has-sub .caret { transform: rotate(90deg); }
.sub-menu { display: none; position: relative; padding: 2px 0 2px 0; margin-bottom: 4px; }
.sub-menu::before {
  content: ''; position: absolute; left: 27px; top: 6px; bottom: 6px;
  width: 1.5px; background: rgba(255,255,255,.14); border-radius: 2px;
}
.menu-branch.open .sub-menu { display: block; }
.menu-item.sub {
  padding: 8px 12px 8px 40px; margin-bottom: 2px;
  font-size: 13.5px; color: rgba(255,255,255,.65);
  border-left: 2px solid transparent; border-radius: 8px; min-height: 0;
}
.menu-item.sub svg { width: 15px; height: 15px; flex: 0 0 15px; opacity: .8; }
.menu-item.sub:hover { background: rgba(255,255,255,.07); color: #fff; }
.menu-item.sub.active {
  background: linear-gradient(90deg, rgba(26,139,120,.5), rgba(26,139,120,.1));
  color: #fff; border-left-color: var(--gold);
}
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: rgba(255,255,255,.45); line-height: 1.8; word-break: break-all; }

.main { margin-left: 220px; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.topbar .title { font-size: 17px; font-weight: 600; }
.topbar .crumb { font-size: 12px; color: var(--muted); margin-top: 2px; }
.user-box { display: flex; align-items: center; gap: 12px; }
.user-info { text-align: right; line-height: 1.35; }
.user-info b { font-size: 13px; font-weight: 600; }
.user-info span { display: block; font-size: 11px; color: var(--muted); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 14px;
}
.content { padding: 22px 24px 40px; flex: 1; }
@media (max-width: 860px) {
  .sidebar { width: 62px; flex-basis: 62px; }
  .sidebar .txt, .menu-item span, .menu-group-title, .sidebar-foot { display: none; }
  .menu-item { justify-content: center; border-left: none; }
  .menu-item.sub { padding-left: 12px; padding-right: 12px; }
  .menu-item.sub span { display: block; font-size: 11px; }
  .menu-item.has-sub .caret { display: none; }
  .sub-menu::before { left: 10px; }
  .brand { justify-content: center; padding: 18px 0; }
  .main { margin-left: 62px; }
}

/* ============ 通用组件 ============ */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.card-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-body { padding: 18px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--text); cursor: pointer; font-size: 13px;
  transition: .15s; white-space: nowrap; font-family: inherit;
}
.btn:hover { border-color: var(--brand-500); color: var(--brand-700); }
.btn svg { width: 15px; height: 15px; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-500));
  color: #fff; border-color: transparent;
}
.btn-primary:hover { filter: brightness(1.08); color: #fff; }
.btn-danger { background: #fff; color: var(--danger); border-color: #f0cdc9; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; justify-content: center; padding: 11px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; font-family: inherit; color: var(--text); background: #fff; transition: .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(26,139,120,.12); }
textarea { resize: vertical; line-height: 1.7; }
.policy-view {
  white-space: pre-wrap; word-break: break-all; line-height: 1.9; font-size: 13px;
  background: #f7faf9; border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 16px; max-height: 420px; overflow: auto;
}
.thumb {
  width: 52px; height: 38px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--line); cursor: zoom-in; display: block;
}
img { border: 0; }
.toolbar input[type=date] { width: 140px; }
label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 5px; }
.form-group { margin-bottom: 14px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; line-height: 18px; }
.badge-ok { background: #e6f5ec; color: var(--ok); }
.badge-off { background: #f1f3f2; color: var(--muted); }
.badge-role { background: var(--brand-100); color: var(--brand-700); }
.badge-gold { background: #fbf3da; color: #96760d; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
th { background: #f7faf9; color: var(--muted); font-weight: 500; font-size: 12px; white-space: nowrap; position: sticky; top: 0; z-index: 5; }
tbody tr:hover { background: #f8fbfa; }
.table-wrap { overflow: auto; max-height: calc(100vh - 300px); }
td .ops { display: flex; gap: 6px; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .search { position: relative; flex: 1; min-width: 220px; max-width: 340px; }
.toolbar .search input { padding-left: 34px; }
.toolbar .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
.toolbar select { width: auto; min-width: 110px; }

.pager { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; gap: 12px; flex-wrap: wrap; }
.pager .info { color: var(--muted); font-size: 12px; }
.pager .pages { display: flex; gap: 5px; align-items: center; }
.pager button { min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; font-size: 12px; font-family: inherit; }
.pager button.active { background: var(--brand-700); color: #fff; border-color: var(--brand-700); }
.pager button:disabled { opacity: .45; cursor: not-allowed; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card { padding: 16px 20px; }
.stat-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stat-value { font-size: 24px; font-weight: 600; line-height: 1.2; }
.stat {
  background: #fff; border-radius: var(--radius); padding: 18px; border: 1px solid var(--line);
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; position: relative; overflow: hidden;
}
.stat .icon { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; }
.stat .icon svg { width: 22px; height: 22px; }
.stat .num { font-size: 24px; font-weight: 600; line-height: 1.1; }
.stat .lbl { font-size: 12px; color: var(--muted); margin-top: 3px; }
.stat::after { content: ""; position: absolute; right: -20px; bottom: -20px; width: 80px; height: 80px; border-radius: 50%; background: rgba(26,139,120,.05); }

.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-item .top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.bar-item .top span:last-child { color: var(--muted); }
.bar-bg { height: 7px; background: #eef3f2; border-radius: 4px; overflow: hidden; }
.bar-in { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--brand-700), var(--brand-500)); }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty svg { width: 46px; height: 46px; opacity: .35; margin-bottom: 10px; }
.coming { text-align: center; padding: 70px 20px; color: var(--muted); }
.coming svg { width: 54px; height: 54px; opacity: .3; color: var(--brand-700); margin-bottom: 14px; }
.coming .t { font-size: 16px; color: var(--text); font-weight: 600; margin-bottom: 8px; }
.coming .s { font-size: 13px; line-height: 1.8; }

/* 商品配货表（仿 Excel 可编辑表格） */
.sheet-paper { background: #fff; padding: 0 0 14px; }
.sheet-title { text-align: center; font-size: 20px; font-weight: 700; letter-spacing: 4px; padding: 18px 0 10px; }
.sheet-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 0 18px 12px; font-size: 13px; color: var(--muted); }
.sheet-meta b { color: var(--text); }
.sheet-meta b.gold { color: #96760d; }
.meta-input {
  width: 150px; padding: 5px 8px !important; border: 1px solid transparent !important;
  border-bottom: 1px solid var(--line) !important; border-radius: 4px; font-size: 13px; background: #fbfdfc;
}
.meta-input:focus { border-color: var(--brand-500) !important; background: #fff; }
.sheet-wrap { overflow: auto; max-height: 62vh; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
table.sheet-table { border-collapse: separate; border-spacing: 0; min-width: 1860px; }
table.sheet-table th {
  position: sticky; top: 0; z-index: 2; background: #e2efda; color: #375623;
  font-size: 12px; text-align: center; padding: 8px 6px; border-right: 1px solid #c5d9b8; white-space: nowrap;
  border-bottom: 1px solid #9bbb59;
}
table.sheet-table td { padding: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fffdf6; }
table.sheet-table tbody tr:hover td { background: #fffceb; }
/* 配货表：Excel 式区域选定（含金额格 span） */
#allocBody [data-f].sel {
  background: #dce9f7; outline: 2px solid #2563eb; outline-offset: -2px;
}
#allocBody span.amt-cell { display: block; }
#allocBody input.sel:focus { outline: 2px solid #1d4ed8; outline-offset: -2px; }
.alloc-hint {
  font-size: 12px; color: var(--muted); background: #f6f8f5; border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 10px; margin-bottom: 8px;
}
.alloc-hint kbd {
  background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px;
  font-family: inherit; font-size: 11px; margin: 0 1px;
}
/* 表格首行：固定合计行 */
table.sheet-table tbody.alloc-total td {
  background: #f1f7ec; border-bottom: 1px solid #9bbb59; padding: 7px 8px; font-size: 12.5px;
}
table.sheet-table tbody.alloc-total .t-label { text-align: center; font-weight: 600; color: #375623; }
table.sheet-table tbody.alloc-total .t-qty { text-align: right; font-weight: 600; color: #375623; }
table.sheet-table tbody.alloc-total .t-amt { text-align: right; font-weight: 700; color: #96760d; background: #fff8e6; }
table.sheet-table td input {
  width: 100%; border: 0; padding: 7px 8px; font-size: 12.5px; background: transparent; border-radius: 0; color: var(--text);
}
table.sheet-table td input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--brand-500); background: #fff; }
table.sheet-table td input:disabled { background: #fafbfb; color: var(--muted); }
table.sheet-table td input[type=number] { text-align: right; -moz-appearance: textfield; }
table.sheet-table td input[type=number]::-webkit-outer-spin-button,
table.sheet-table td input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* 第 1 列助理、第 2 列序号：居中灰字；第 11 列金额：右对齐金色，不接收输入 */
table.sheet-table td:nth-child(1),
table.sheet-table td:nth-child(2) { background: #fcfefe; }
table.sheet-table td:nth-child(1) input,
table.sheet-table td:nth-child(2) input { text-align: center; color: var(--muted); }
table.sheet-table td:nth-child(11) { text-align: right; padding: 7px 8px; font-size: 12.5px; color: #96760d; background: #fffdf5; }
table.sheet-table td:nth-child(17) { text-align: center; padding: 0 4px; }
/* 行末尾的删除按钮：平时隐形，鼠标划过这一行才出现 */
table.sheet-table .row-del {
  opacity: 0; border: 0; background: transparent; cursor: pointer; font-size: 16px; line-height: 1;
  color: var(--muted); padding: 0 4px; border-radius: 4px; transition: .15s;
}
table.sheet-table tr:hover .row-del { opacity: 1; }
table.sheet-table .row-del:hover { color: #fff; background: var(--danger); }
.sheet-foot { padding: 12px 18px 0; display: flex; align-items: center; flex-wrap: wrap; }
.save-flag { font-size: 12px; color: var(--ok); opacity: 0; transition: .3s; }
.save-flag.show { opacity: 1; }
/* 列宽：按表格位置（1 序号 … 16 删除）指定，单元格不带任何自定义类名 */
table.sheet-table th:nth-child(1) { width: 80px; min-width: 80px; }
table.sheet-table th:nth-child(2) { width: 46px; min-width: 46px; }
table.sheet-table th:nth-child(3) { width: 108px; }
table.sheet-table th:nth-child(4) { width: 150px; }
table.sheet-table th:nth-child(5) { width: 210px; }
table.sheet-table th:nth-child(6) { width: 56px; }
table.sheet-table th:nth-child(7),
table.sheet-table th:nth-child(8) { width: 92px; }
table.sheet-table th:nth-child(9),
table.sheet-table th:nth-child(10),
table.sheet-table th:nth-child(11) { width: 78px; }
table.sheet-table th:nth-child(12) { width: 76px; }
table.sheet-table th:nth-child(13) { width: 280px; }
table.sheet-table th:nth-child(14) { width: 86px; }
table.sheet-table th:nth-child(15) { width: 110px; }
table.sheet-table th:nth-child(16) { width: 150px; }
table.sheet-table th:nth-child(17) { width: 46px; }

/* 弹窗 */
.mask { position: fixed; inset: 0; background: rgba(10, 40, 35, .45); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 620px;
  max-height: 90vh; overflow: auto; box-shadow: 0 24px 60px rgba(0,0,0,.28);
  animation: pop .18s ease-out;
}
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0 } to { transform: none; opacity: 1 } }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.modal-head .close { cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.modal-head .close:hover { background: #f1f5f4; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* 配货表整屏预览 */
.pv-mask { position: fixed; inset: 0; background: rgba(10, 40, 35, .5); display: none; z-index: 120; padding: 18px; }
.pv-mask.show { display: block; }
.pv-panel {
  background: #fff; border-radius: 12px; width: 100%; height: 100%;
  display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); overflow: hidden;
}
.pv-head {
  padding: 12px 18px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; flex: none;
}
.pv-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.pv-actions { display: flex; align-items: center; gap: 10px; }
.pv-zoom {
  height: 30px; border: 1px solid var(--line); border-radius: 7px; background: #fff;
  padding: 0 6px; font-size: 12.5px; color: var(--text); cursor: pointer; outline: none;
}
.pv-zoom:focus { border-color: var(--brand-500); }
.pv-actions .close { cursor: pointer; color: var(--muted); font-size: 22px; line-height: 1; padding: 2px 8px; border-radius: 6px; }
.pv-actions .close:hover { background: #f1f5f4; }
.pv-body { flex: 1; overflow: auto; padding: 14px 18px 24px; }
.pv-meta { display: flex; gap: 26px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.pv-meta b { color: var(--text); font-weight: 600; }
.pv-table { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 12.5px; }
.pv-table th, .pv-table td { border: 1px solid #bfcfc9; padding: 5px 6px; word-break: break-all; }
.pv-table th { background: #e2efda; color: #375623; text-align: center; font-weight: 600; }
.pv-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pv-table .pv-total td { background: #f1f7ec; font-weight: 700; }
.pv-table .pv-total .t-label { text-align: center; }
.pv-table .pv-total td.num { color: #96760d; }

@media print {
  body > *:not(.pv-mask) { display: none !important; }
  .pv-mask { position: static; background: none; padding: 0; display: none; }
  .pv-mask.show { display: block; }
  .pv-panel { box-shadow: none; border-radius: 0; height: auto; }
  .pv-head { display: none; }
  .pv-body { overflow: visible; padding: 0; zoom: 1 !important; }
  .pv-table { font-size: 10px; }
}

.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { padding: 10px 18px; border-radius: 8px; background: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.16); font-size: 13px; border-left: 4px solid var(--brand-500); animation: pop .18s; }
.toast.err { border-left-color: var(--danger); color: #a3322a; }
.toast.ok { border-left-color: var(--ok); }

.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
/* 已存配货表查询：结果列表 + 命中行高亮 */
.alloc-hist { margin: 0 18px 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.alloc-hist .hist-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 14px; background: #f6f9f7; border-bottom: 1px solid var(--line); font-size: 13px;
}
.alloc-hist .hist-head .hint { margin: 0; }
.alloc-hist table td { text-align: center; }
.alloc-hist table td:nth-child(2) { text-align: left; }
.alloc-hist table td:nth-child(4),
.alloc-hist table td:nth-child(5) { text-align: right; font-variant-numeric: tabular-nums; }
.alloc-hist table td:nth-child(7) > * { margin: 0 3px; }
.alloc-hit {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; margin: 8px 0 0; font-size: 12.5px; color: #7a5c12;
  background: #fff8e6; border: 1px solid #f0dca4; border-radius: 8px;
}
table.sheet-table tbody tr.hit td { background: #fff3cd; }
table.sheet-table tbody tr.hit:hover td { background: #ffeec0; }
.chk { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 13px; transition: .15s; }
.chk:hover { border-color: var(--brand-500); }
.chk input { width: 15px; height: 15px; accent-color: var(--brand-700); margin: 0; }
.perm-group-title { font-size: 12px; color: var(--muted); margin: 14px 0 8px; font-weight: 600; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.7; }
.view { display: none; }
.view.active { display: block; }

/* 付款审批表预览（与导出 Excel 样式一致：白底+浅青 E6FEFF、黑色细框、宋体/Times New Roman） */
.pay-panel { width: min(860px, 100%); margin: 0 auto; }
.pay-body { padding: 20px 26px 30px; }
.pay-title { text-align: center; font-size: 26px; font-weight: 700; letter-spacing: 2px; margin: 4px 0 10px; font-family: '宋体', 'SimSun', serif; }
.pay-meta { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.pay-meta b { font-weight: 600; font-size: 15px; }
.pay-table { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 13px; font-family: '宋体', 'SimSun', 'Times New Roman', serif; }
.pay-table td { border: 1px solid #000; padding: 6px 8px; word-break: break-all; background: #fff; }
.pay-table .lbl { font-size: 12px; font-family: 'Times New Roman', '宋体', serif; color: #000; text-align: center; vertical-align: middle; }
.pay-table .val { font-size: 14px; text-align: center; vertical-align: middle; }
.pay-table .val.bg { background: #e6feff; }
.pay-table .val.strong { font-size: 17px; font-weight: 700; }
.pay-table .val.big { font-size: 16px; }
.pay-table .val.num { font-variant-numeric: tabular-nums; font-family: 'Times New Roman', serif; font-size: 17px; text-align: left; padding-left: 10px; }
.pay-table .val.cross {
  background:
    linear-gradient(to top right, transparent calc(50% - 0.8px), #000 50%, transparent calc(50% + 0.8px)),
    linear-gradient(to bottom right, transparent calc(50% - 0.8px), #000 50%, transparent calc(50% + 0.8px)), #fff;
  padding: 0;
}
.pay-table .val.reason { text-align: left; vertical-align: middle; line-height: 1.9; padding: 8px 12px; }
.pay-table .val.reason p { margin: 0; }
.pay-table .val.sign { color: #938953; font-size: 16px; }
.pay-table .val.center { font-size: 16px; font-family: 'Times New Roman', serif; }
.pay-table .blank { height: 64px; vertical-align: top; font-size: 12px; color: #000; }
.pay-table .sign-row td { border-bottom: 1px solid #000; }
@media (max-width: 720px) {
  .pay-table { font-size: 11px; }
}
.pay-table .pay-input {
  width: 100%; box-sizing: border-box; border: 0; background: transparent;
  text-align: center; font-size: 14px; font-family: inherit; color: inherit;
  padding: 2px 0; outline: none;
}
.pay-table .pay-input:focus { background: #fff; border-radius: 3px; box-shadow: inset 0 0 0 1px var(--brand-500); }
.pay-table .pay-input.sign { font-size: 16px; color: #938953; }
.pay-table .pay-input.attach { display: inline-block; width: 42px; text-align: right; margin-right: 2px; }
.pay-table .pay-input.attach::-webkit-outer-spin-button,
.pay-table .pay-input.attach::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
