:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #16202c;
  --text-2: #475569;
  --muted: #7b8794;
  --brand: #14385c;
  --brand-2: #1e5a8a;
  --brand-soft: #e8f0f8;
  --amber: #b45309;
  --amber-soft: #fdf3e3;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --ok: #15803d;
  --ok-soft: #e9f6ee;
  --shadow: 0 1px 2px rgba(16, 32, 48, 0.06), 0 4px 14px rgba(16, 32, 48, 0.05);
  --radius: 10px;
  --sidebar-w: 208px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
a { color: var(--brand-2); text-decoration: none; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12.5px; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 20% 10%, #1b4a74 0%, #102a44 45%, #0b1f33 100%);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px; background: var(--surface); border-radius: 14px;
  padding: 34px 32px 28px; box-shadow: 0 24px 60px rgba(3, 15, 28, 0.45);
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-brand .logo { width: 34px; height: 34px; }
.login-card h1 { font-size: 19px; margin: 12px 0 4px; letter-spacing: .3px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.login-card .field { margin-bottom: 14px; }
.login-foot { margin-top: 18px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.7; }
.login-foot a { color: var(--muted); text-decoration: none; }
.login-foot a:hover { text-decoration: underline; }

/* ---------- 布局 ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: #102a44; color: #cfe0f0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; }
.sidebar .brand .logo { width: 30px; height: 30px; flex: 0 0 30px; }
.sidebar .brand b { color: #fff; font-size: 14px; letter-spacing: .2px; line-height: 1.3; display: block; }
.sidebar .brand span { font-size: 11px; color: #7fa3c4; letter-spacing: .5px; }
.nav { padding: 6px 10px; flex: 1; overflow: auto; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  color: #b9cfe3; font-size: 13.5px; margin-bottom: 2px; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.active { background: #1d4e78; color: #fff; font-weight: 600; }
.nav a svg { width: 17px; height: 17px; opacity: .85; flex: 0 0 17px; }
.sidebar .me { border-top: 1px solid rgba(255,255,255,.09); padding: 12px 14px; font-size: 12.5px; }
.sidebar .me .name { color: #fff; font-weight: 600; }
.sidebar .me .role { color: #8fb4d4; font-size: 11.5px; }
.sidebar .me button { margin-top: 8px; width: 100%; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: none; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px; background: #102a44; color: #fff; position: sticky; top: 0; z-index: 30;
}
.topbar .t-title { font-weight: 600; font-size: 14px; }
.topbar .t-user { font-size: 12px; color: #a9c6de; }
.mnav { display: none; }

.content { padding: 20px 24px 40px; max-width: 1560px; width: 100%; }

/* ---------- 通用组件 ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { font-size: 19px; margin: 0 0 2px; letter-spacing: .2px; }
.page-head .desc { color: var(--muted); font-size: 12.5px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 650; }
.card-body { padding: 14px 16px; }
.card-body.tight { padding: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 13px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: #fff; color: var(--text-2); cursor: pointer; font-size: 13.5px; white-space: nowrap;
  transition: all .15s;
}
.btn:hover { border-color: #94a3b8; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand-2); border-color: var(--brand-2); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #1b4f78; border-color: #1b4f78; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand-2); padding: 6px 8px; }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.danger { color: var(--danger); border-color: #f0c4c0; background: #fff; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.field label .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--muted); }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(30, 90, 138, .12); }
input[readonly] { background: var(--surface-2); color: var(--text-2); }
textarea { resize: vertical; min-height: 62px; }
select { appearance: none; background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%237b8794' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 12px; padding-right: 26px; }
/* 打印格式选择（详情弹窗/录单页工具行内联使用，不占满宽） */
select.slip-fmt { width: auto; padding: 5px 26px 5px 9px; font-size: 13px; }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 12px; align-items: end; }
.filters .field.wide { grid-column: span 2; }
.filter-actions { display: flex; gap: 8px; align-items: center; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 3px 9px; border-radius: 999px; background: #eef2f7; color: var(--text-2); font-size: 12px; border: 1px solid transparent; cursor: pointer; }
.chip:hover { background: #e3eaf3; }
.chip.on { background: var(--brand-soft); border-color: #b9d3e8; color: var(--brand); font-weight: 600; }

/* ---------- 表格 ---------- */
.table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  position: sticky; top: 0; background: #f7f9fc; color: var(--text-2); font-weight: 600;
  text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; z-index: 1;
}
table.data td { padding: 8px 10px; border-bottom: 1px solid #eef2f7; vertical-align: middle; }
table.data tbody tr:hover { background: #f8fafd; }
table.data tfoot td { font-weight: 650; background: #f7f9fc; border-top: 1px solid var(--border); }
table.data .right { text-align: right; }
table.data .nowrap { white-space: nowrap; }
table.data tr.void td { color: var(--muted); text-decoration: line-through; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 13px; }

.tag { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11.5px; line-height: 1.7; white-space: nowrap; }
.tag.gray { background: #eef2f7; color: #55636f; }
.tag.blue { background: #e8f0f8; color: #1e5a8a; }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.red { background: var(--danger-soft); color: var(--danger); }
.tag.green { background: var(--ok-soft); color: var(--ok); }
.tag.outline { background: #fff; border: 1px solid var(--border-strong); color: var(--text-2); }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand-2); }
.kpi.amber::before { background: #d97706; }
.kpi.red::before { background: var(--danger); }
.kpi.green::before { background: var(--ok); }
.kpi .k-label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .k-value { font-size: 25px; font-weight: 660; letter-spacing: -.4px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .k-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi .k-foot { font-size: 12px; color: var(--muted); margin-top: 4px; }

.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 1150px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* 趋势图 */
.spark { width: 100%; height: 150px; display: block; }
.spark .bar { transition: opacity .15s; }
.spark .bar:hover { opacity: .75; }

.rank-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed #eef2f7; }
.rank-row:last-child { border-bottom: 0; }
.rank-row .rname { flex: 0 0 34%; font-size: 12.8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .rbar { flex: 1; height: 7px; background: #eef2f7; border-radius: 4px; overflow: hidden; }
.rank-row .rbar i { display: block; height: 100%; background: linear-gradient(90deg, #2b6f9e, #1e5a8a); border-radius: 4px; }
.rank-row .rval { flex: 0 0 92px; text-align: right; font-size: 12.8px; font-variant-numeric: tabular-nums; font-weight: 600; }

.list-simple { display: flex; flex-direction: column; }
.list-simple .li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #eef2f7; font-size: 13px; }
.list-simple .li:last-child { border-bottom: 0; }
.list-simple .li .lt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-simple .li .lv { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- 弹窗 ---------- */
.modal-root { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 4vh 16px; overflow: auto; background: rgba(12, 24, 38, .45); backdrop-filter: blur(1px); }
.modal {
  background: var(--surface); border-radius: 12px; width: 100%; max-width: 720px;
  box-shadow: 0 24px 70px rgba(8, 20, 34, .35); animation: pop .16s ease-out;
}
.modal.wide { max-width: 1040px; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 15.5px; }
.modal-head .x { border: 0; background: transparent; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.modal-body { padding: 16px 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 12px 12px; }

/* ---------- 出库单编辑 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.form-grid .span2 { grid-column: span 2; }
.items-table { width: 100%; border-collapse: collapse; }
.items-table th { text-align: left; font-size: 12px; color: var(--text-2); font-weight: 600; padding: 7px 6px; border-bottom: 1px solid var(--border); background: #f8fafd; white-space: nowrap; }
.items-table td { padding: 5px 4px; border-bottom: 1px solid #f0f4f8; vertical-align: top; }
.items-table input, .items-table select { padding: 6px 8px; font-size: 13px; }
.items-table .col-code { width: 150px; }
.items-table .col-name { min-width: 150px; }
.items-table .col-qty { width: 90px; }
.items-table .col-unit { width: 82px; }
.items-table .col-aux { width: 84px; }
.items-table .col-note { min-width: 110px; }
.items-table .col-del { width: 34px; }
.line-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.lookup-tip { font-size: 11.5px; color: var(--amber); margin-top: 2px; }
/* 委外加工：顶部三个汇总指标 */
.os-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.os-metric {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 2px;
}
.os-metric span { font-size: 12px; color: var(--muted); }
.os-metric b { font-size: 22px; font-weight: 600; color: var(--text); line-height: 1.2; }
.os-metric.warn b { color: var(--amber); }
.os-metric small { font-size: 11px; color: var(--muted); }

/* 产品编号候选面板：自绘，支持片段匹配并把编号显示出来（原生 datalist 只显示名称，重名分不清） */
.code-suggest {
  position: fixed; z-index: 400; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 8px; box-shadow: 0 10px 28px rgba(16, 32, 48, 0.16);
  max-height: 300px; overflow-y: auto; padding: 4px;
}
.code-suggest .cs-item {
  display: flex; gap: 10px; align-items: baseline; padding: 7px 10px;
  border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1.35;
}
.code-suggest .cs-item:hover { background: var(--surface-2); }
.code-suggest .cs-item.active { background: var(--brand-soft); }
.code-suggest .cs-item b { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 600; color: var(--brand-2); white-space: nowrap; }
.code-suggest .cs-item span { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-suggest mark { background: #ffe58f; color: inherit; padding: 0; border-radius: 2px; }
.code-suggest .cs-foot { font-size: 11.5px; color: var(--muted); padding: 6px 10px 4px; border-top: 1px solid var(--border); margin-top: 4px; }
/* 就地新建产品的行：浅琥珀底色提示「这行会建档」 */
.items-table tr.row-newprod td { background: rgba(230, 162, 60, 0.08); }
.price-cell { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }

/* ---------- 提示 ---------- */
.toast-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 9px 16px; border-radius: 9px; background: #16202c; color: #fff; font-size: 13px; box-shadow: 0 8px 26px rgba(8, 20, 34, .3); animation: tin .18s ease-out; max-width: 90vw; }
.toast.ok { background: #14532d; }
.toast.err { background: #7f1d1d; }
.toast.warn { background: #78350f; }
@keyframes tin { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 13px; border-radius: 9px; font-size: 13px; margin-bottom: 14px; }
.banner.warn { background: var(--amber-soft); color: #7c3f06; border: 1px solid #f3d9ae; }
.banner.err { background: var(--danger-soft); color: #7f1d1d; border: 1px solid #f0c4c0; }
.banner.info { background: var(--brand-soft); color: #14385c; border: 1px solid #c5dcef; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 9px 13px; font-size: 13.5px; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--brand-2); border-bottom-color: var(--brand-2); font-weight: 600; }

.sec-title { font-size: 13px; font-weight: 650; color: var(--text-2); margin: 18px 0 8px; }
.mini-muted { font-size: 12px; color: var(--muted); }

/* ---------- 手机端 ---------- */
@media (max-width: 860px) {
  .sidebar { display: none; }
  .topbar { display: flex; }
  .content { padding: 14px 12px 84px; }
  .mnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: #fff; border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .mnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; font-size: 11px; color: var(--muted); }
  .mnav a svg { width: 20px; height: 20px; }
  .mnav a.active { color: var(--brand-2); font-weight: 600; }
  .page-head h2 { font-size: 17px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .kpi .k-value { font-size: 21px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .modal-root { padding: 0; align-items: flex-end; }
  .modal, .modal.wide { max-width: 100%; border-radius: 14px 14px 0 0; max-height: 94vh; overflow: auto; }
  .modal-foot { position: sticky; bottom: 0; border-radius: 0; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .field.wide { grid-column: span 1; }
  table.data { min-width: 620px; }
  .desktop-only { display: none !important; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .span2 { grid-column: span 2; }
}
@media (min-width: 861px) { .mobile-only { display: none !important; } }

/* 手机卡片列表 */
.mcards { display: flex; flex-direction: column; gap: 10px; }
.mcard { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 13px; box-shadow: var(--shadow); }
.mcard .mc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.mcard .mc-doc { font-weight: 650; font-size: 13.5px; letter-spacing: .2px; }
.mcard .mc-amt { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.mcard .mc-meta { font-size: 12.3px; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.mcard .mc-sub { font-size: 12px; color: var(--muted); margin-top: 5px; }
.mcard .mc-tags { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; }

.stat-inline { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.8px; color: var(--text-2); }
.stat-inline b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- 批量导入 ---------- */
.imp-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.imp-hint { flex: 1; min-width: 180px; font-size: 12.4px; line-height: 1.65; }
.imp-dl { font-weight: 700; }
.imp-filters { margin-bottom: 14px; }
.imp-stat { border-radius: 8px; padding: 10px 13px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 3px; border: 1px solid transparent; }
.imp-stat b { font-size: 13.5px; }
.imp-stat span { color: var(--text-2); font-size: 12.4px; }
.imp-stat.ok { background: var(--ok-soft); border-color: #c9e6d5; }
.imp-stat.ok b { color: var(--ok); }
.imp-stat.warn { background: var(--amber-soft); border-color: #f0dcb8; }
.imp-stat.warn b { color: var(--amber); }
.imp-stat.err { background: var(--danger-soft); border-color: #f3c9c5; }
.imp-stat.err b { color: var(--danger); }
.imp-note { font-size: 12.4px; line-height: 1.7; color: var(--text-2); background: var(--amber-soft); border: 1px solid #f0dcb8; border-radius: 8px; padding: 9px 12px; margin: -4px 0 12px; }
.imp-note b { color: var(--amber); }
.imp-table { max-height: 46vh; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.imp-table table.data { margin: 0; }
tr.imp-bad td { background: #fef7f6; }
tr.imp-bad td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
tr.imp-warn td { background: #fffdf7; }
tr.imp-warn td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.imp-issues { font-size: 12px; line-height: 1.6; min-width: 170px; }
.imp-e { color: var(--danger); display: block; }
.imp-w { color: var(--amber); display: block; }
@media (max-width: 860px) {
  .imp-filters { grid-template-columns: 1fr; }
  .imp-table { max-height: 40vh; }
}

/* ---------- 构建号标识 ---------- */
.build-tag { font-size: 10.5px; color: #7c93a9; margin-top: 3px; letter-spacing: .3px; cursor: help; }
/* ICP 备案号：侧边栏深底，用浅灰蓝保证可读；登录页沿用 .login-foot 的字色 */
.icp-tag { font-size: 10.5px; margin-top: 2px; }
.icp-tag a { color: #7c93a9; text-decoration: none; }
.icp-tag a:hover { color: #cbd5e1; text-decoration: underline; }

/* ---------- 工资核算 ---------- */
/* 录入网格：一屏铺一个车间，限高滚动，表头吸顶（沿用 table.data 的 sticky th） */
.pay-grid { max-height: calc(100vh - 330px); min-height: 220px; }
.pay-grid td { padding: 4px 6px; }
.pay-grid td input { width: 100%; padding: 6px 8px; font-size: 13px; }
.pay-grid tbody tr:hover { background: #f8fafd; }
/* 工资表列多，给一个最小宽度，窄屏横向滚动而不是挤压换行 */
.pay-slip { min-width: 1160px; }
/* 工资模块字段少：默认 grid 会把输入框拉满、把操作按钮推到最右。
   这里改成 flex，字段按固定宽度排列，按钮紧跟其后 */
.filters.compact { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.filters.compact .field { width: 200px; }
.filters.compact .field.wide { width: 300px; }
.filters.compact .field.narrow { width: 120px; }
/* 录入网格列宽：零件号要放得下 20 多位的图号，靠输入框最小宽度把列撑开 */
.pay-grid .f-code { min-width: 268px; }
.pay-grid .f-note { min-width: 150px; }
.pay-grid .f-qty, .pay-grid .f-hours { min-width: 72px; }
/* 列表类表格用固定列宽，避免个别长内容把整列撑开、其余列被挤扁 */
.pay-fix { table-layout: fixed; }

/* ---------- 侧边栏二级菜单 ---------- */
.nav-group { margin-bottom: 2px; }
.nav-parent { position: relative; }
.nav-parent .caret {
  margin-left: auto; font-style: normal; font-size: 10px; line-height: 1;
  opacity: .55; padding: 4px 2px; border-radius: 4px;
}
.nav-parent .caret:hover { opacity: 1; background: rgba(255, 255, 255, .12); }
.nav-parent.in-path { color: #fff; }
.nav-sub { display: none; margin: 2px 0 6px 16px; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, .13); }
.nav-group.open .nav-sub { display: block; }
.nav-sub a { display: block; padding: 6px 10px; border-radius: 6px; font-size: 12.8px; color: #a7c2d8; }
.nav-sub a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-sub a.active { background: #1d4e78; color: #fff; font-weight: 600; }
