/* ============================================================
   吊篮租赁费计算系统 — 样式
   ============================================================ */
:root {
  --navy-900: #0b1220;
  --navy-800: #101a2c;
  --navy-700: #16233a;
  --brand: #1d4ed8;
  --brand-600: #2563eb;
  --brand-50: #eff5ff;
  --accent: #f59e0b;
  --accent-600: #d97706;
  --accent-50: #fff8eb;

  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --ink-400: #94a3b8;
  --line: #e6eaf1;
  --line-2: #eef2f7;
  --bg: #f5f7fb;
  --card: #ffffff;

  --green: #16a34a;
  --green-bg: #eafaf0;
  --red: #dc2626;
  --red-bg: #fdecec;
  --amber: #d97706;
  --amber-bg: #fff6e5;
  --blue: #2563eb;
  --blue-bg: #eaf1fe;
  --slate-bg: #f1f5f9;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow: 0 4px 16px rgba(15, 23, 42, .07), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", ui-monospace, Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink-900);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cfd8e6; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b6c2d6; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================ 登录 ============================ */
.login-screen {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background: radial-gradient(1200px 600px at 15% 10%, #1b2c4b 0%, #0b1220 55%, #070c15 100%);
  overflow: hidden;
}
.login-bg { position: absolute; inset: 0; }
.login-grid {
  position: absolute; inset: -20%;
  background-image: linear-gradient(rgba(148, 163, 184, .09) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(148, 163, 184, .09) 1px, transparent 1px);
  background-size: 46px 46px;
  transform: perspective(700px) rotateX(52deg) translateY(12%);
  mask-image: radial-gradient(circle at 50% 40%, #000 10%, transparent 72%);
}
.crane { position: absolute; border-radius: 999px; filter: blur(2px); opacity: .5; }
.crane.c1 { width: 420px; height: 420px; background: radial-gradient(circle, rgba(245,158,11,.30), transparent 65%); top: -120px; right: -60px; }
.crane.c2 { width: 520px; height: 520px; background: radial-gradient(circle, rgba(37,99,235,.28), transparent 65%); bottom: -200px; left: -100px; }

.login-card {
  position: relative; z-index: 2;
  width: 400px; max-width: calc(100vw - 32px);
  background: #fff; border-radius: 20px;
  padding: 30px 30px 22px;
  box-shadow: 0 40px 90px rgba(2, 6, 23, .55);
}
.login-brand { display: flex; gap: 13px; align-items: center; margin-bottom: 24px; }
.login-brand h1 { font-size: 19px; letter-spacing: .3px; }
.login-brand p { font-size: 12px; color: var(--ink-500); margin-top: 4px; }
.logo-mark {
  width: 46px; height: 46px; border-radius: 13px; flex: none;
  background: linear-gradient(150deg, #1e293b, #0b1220);
  display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 6px 16px rgba(11,18,32,.28);
}
.logo-mark.sm { width: 34px; height: 34px; border-radius: 10px; }

.login-form { display: grid; gap: 14px; }
.login-error { color: var(--red); font-size: 12.5px; min-height: 16px; margin-top: -4px; }
.btn-block { width: 100%; justify-content: center; height: 42px; font-size: 15px; letter-spacing: 2px; }
.login-demo {
  margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line);
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  font-size: 12px; color: var(--ink-500);
}
.login-demo div { background: var(--slate-bg); padding: 5px 10px; border-radius: 7px; }
.login-demo b { color: var(--ink-700); font-weight: 600; margin-right: 4px; }

/* ============================ 布局 ============================ */
.app { display: grid; grid-template-columns: 236px 1fr; grid-template-rows: 100%; height: 100vh; overflow: hidden; }

.sidebar {
  background: linear-gradient(180deg, var(--navy-800), var(--navy-900) 60%);
  display: flex; flex-direction: column;
  padding: 18px 12px 12px;
  color: #cbd5e1;
  position: relative;
}
.sidebar::after {
  content: ""; position: absolute; inset: 0 0 0 auto; width: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), transparent 40%);
}
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 18px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { color: #fff; font-size: 14.5px; letter-spacing: .4px; }
.brand-text small { color: #64748b; font-size: 10.5px; letter-spacing: .8px; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; min-height: 0; padding-right: 2px; }
.nav::-webkit-scrollbar { width: 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 9px;
  color: #a9b8cf; text-decoration: none; font-size: 13.5px;
  transition: background .16s, color .16s; position: relative;
}
.nav a svg { flex: none; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.055); color: #e6edf7; }
.nav a.active { background: rgba(245,158,11,.13); color: #fff; }
.nav a.active::before {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav a.active svg { color: var(--accent); opacity: 1; }
.nav .nav-sep { height: 1px; background: rgba(255,255,255,.07); margin: 8px 10px; }
.nav .nav-label { font-size: 10.5px; color: #56637d; letter-spacing: 1.2px; padding: 10px 11px 4px; }

.sidebar-foot {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 8px 4px; margin-top: 8px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: linear-gradient(140deg, #334155, #1e293b);
  color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600;
}
.who { display: flex; flex-direction: column; line-height: 1.3; overflow: hidden; flex: 1; }
.who strong { color: #e2e8f0; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { color: #64748b; font-size: 11px; }
.icon-btn {
  background: transparent; border: 0; color: #7c8aa3; padding: 6px; border-radius: 8px;
  display: grid; place-items: center; transition: .16s;
}
.icon-btn:hover { background: rgba(255,255,255,.08); color: #e2e8f0; }

.main { display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.topbar {
  height: 62px; flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.crumb { display: flex; align-items: baseline; gap: 12px; }
.crumb span { font-size: 17px; font-weight: 600; letter-spacing: .2px; }
.crumb small { color: var(--ink-400); font-size: 12.5px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.today { font-size: 12.5px; color: var(--ink-500); }
.pill {
  font-size: 12px; padding: 4px 11px; border-radius: 999px;
  background: var(--brand-50); color: var(--brand); font-weight: 500;
}
.pill.admin { background: var(--accent-50); color: var(--accent-600); }

.view { padding: 22px 26px 40px; overflow-y: auto; flex: 1; }
.view > .page { animation: fadeUp .28s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

/* ============================ 通用组件 ============================ */
.card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; border-bottom: 1px solid var(--line-2); gap: 12px;
}
.card-head h3 { font-size: 14.5px; font-weight: 600; }
.card-head small { color: var(--ink-400); font-size: 12px; }
.card-body { padding: 16px 18px; }
.card-body.tight { padding: 10px 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 35px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; color: var(--ink-700);
  font-size: 13px; font-weight: 500; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #cfd8e6; background: #fbfcfe; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--brand-600), var(--brand));
  border-color: var(--brand); color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .26);
}
.btn-primary:hover { background: linear-gradient(180deg, #2f6bf0, #1a45c6); border-color: #1a45c6; }
.btn-accent {
  background: linear-gradient(180deg, #fbbf24, #f59e0b); border-color: #f59e0b;
  color: #422006; box-shadow: 0 2px 8px rgba(245, 158, 11, .3);
}
.btn-accent:hover { filter: brightness(1.04); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-500); }
.btn-ghost:hover { background: var(--slate-bg); color: var(--ink-700); }
.btn-danger { color: var(--red); border-color: #f5c9c9; background: #fff; }
.btn-danger:hover { background: var(--red-bg); border-color: #f0b3b3; }
.btn-sm { height: 29px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar .spacer { flex: 1; }
.search {
  position: relative; display: flex; align-items: center;
}
.search svg { position: absolute; left: 10px; color: var(--ink-400); pointer-events: none; }
.search input {
  height: 35px; padding: 0 12px 0 32px; width: 236px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  outline: none; transition: .15s;
}
.search input:focus { border-color: var(--brand-600); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
select.ctl, input.ctl {
  height: 35px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; outline: none;
}
select.ctl:focus, input.ctl:focus { border-color: var(--brand-600); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

/* 表格 */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data thead th {
  text-align: left; font-weight: 500; color: var(--ink-500);
  background: #fafbfd; padding: 10px 14px; white-space: nowrap;
  border-bottom: 1px solid var(--line); font-size: 12.5px;
}
table.data tbody td {
  padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle;
  white-space: nowrap;
}
table.data tbody td.cell-wrap { white-space: normal; }
.cell-clip { max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fafcff; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12.5px; }
table.data .strong { font-weight: 600; }
table.data .muted { color: var(--ink-400); }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; flex-wrap: nowrap; }
.link-btn {
  background: none; border: 0; color: var(--brand-600); font-size: 12.5px;
  padding: 3px 6px; border-radius: 6px;
}
.link-btn:hover { background: var(--brand-50); }
.link-btn.danger { color: var(--red); }
.link-btn.danger:hover { background: var(--red-bg); }

.empty {
  padding: 46px 20px; text-align: center; color: var(--ink-400); font-size: 13px;
}
.empty svg { display: block; margin: 0 auto 10px; opacity: .5; }

/* 徽标 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2.5px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.b-green { background: var(--green-bg); color: var(--green); }
.b-red { background: var(--red-bg); color: var(--red); }
.b-amber { background: var(--amber-bg); color: var(--amber); }
.b-blue { background: var(--blue-bg); color: var(--blue); }
.b-slate { background: var(--slate-bg); color: var(--ink-500); }
.b-violet { background: #f3edff; color: #7c3aed; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 13px; margin-bottom: 18px; }
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi .k-label { font-size: 12.5px; color: var(--ink-500); display: flex; align-items: center; gap: 6px; }
.kpi .k-value { font-size: 24px; font-weight: 650; margin-top: 9px; letter-spacing: -.4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .k-value small { font-size: 13px; font-weight: 500; color: var(--ink-400); margin-left: 3px; }
.kpi .k-foot { font-size: 12px; color: var(--ink-400); margin-top: 7px; display: flex; gap: 8px; align-items: center; }
.kpi .k-icon {
  position: absolute; right: 14px; top: 14px;
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand-50); color: var(--brand);
}
.kpi.accent .k-icon { background: var(--accent-50); color: var(--accent-600); }
.kpi.green .k-icon { background: var(--green-bg); color: var(--green); }
.kpi.red .k-icon { background: var(--red-bg); color: var(--red); }
.kpi.green .k-value { color: var(--green); }
.kpi.red .k-value { color: var(--red); }

.grid-2 { display: grid; grid-template-columns: 1.32fr 1fr; gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* 图表 */
.chart { display: flex; align-items: flex-end; gap: 14px; height: 168px; padding: 6px 4px 0; }
.chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.chart .bar {
  width: 100%; max-width: 44px; border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  transition: height .5s cubic-bezier(.22,1,.36,1), filter .15s;
  position: relative; min-height: 3px;
}
.chart .bar:hover { filter: brightness(1.08); }
.chart .bar.hi { background: linear-gradient(180deg, #fbbf24, #f59e0b); }
.chart .bar-val { font-size: 11px; color: var(--ink-500); font-variant-numeric: tabular-nums; }
.chart .bar-x { font-size: 11.5px; color: var(--ink-400); }

/* 列表项 */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px; border-bottom: 1px solid var(--line-2);
}
.list-item:last-child { border-bottom: 0; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-main strong { font-size: 13px; font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .li-main small { color: var(--ink-400); font-size: 12px; }
.list-item .li-val { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ============================ 表单 ============================ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; color: var(--ink-700); font-weight: 500; }
.field > span .req { color: var(--red); margin-left: 2px; }
.field input, .field select, .field textarea {
  height: 37px; padding: 0 11px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; outline: none;
  transition: .15s; width: 100%;
}
.field textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 66px; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand-600); box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.field input[readonly] { background: #f8fafc; color: var(--ink-500); }
.field .hint { font-size: 11.5px; color: var(--ink-400); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section {
  grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: var(--ink-500);
  letter-spacing: .6px; padding-top: 6px; margin-top: 2px; border-top: 1px dashed var(--line);
}
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }

/* 模态框 */
.modal-mask {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(3px);
  /* 必须是 flex 不能是 grid：grid 的隐式轨道按 max-content 撑开，
     弹窗上的 max-width:100% 就是相对这条被撑大的轨道算的，等于没约束，
     手机上一开 wide/xwide 弹窗就横向溢出到屏幕外（实测 420px 屏弹出 900px 宽）。 */
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fadeIn .18s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 18px; width: 620px; max-width: 100%;
  max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: pop .22s cubic-bezier(.22,1,.36,1) both;
}
.modal.wide { width: 900px; }
.modal.xwide { width: 1120px; }
.modal.narrow { width: 440px; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head {
  padding: 17px 22px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.modal-head h3 { font-size: 15.5px; font-weight: 600; }
.modal-head .sub { font-size: 12px; color: var(--ink-400); margin-top: 3px; }
.modal-close { background: none; border: 0; color: var(--ink-400); padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.modal-close:hover { background: var(--slate-bg); color: var(--ink-700); }
/* 表单是 .modal 与 .modal-body 之间的一层，必须一起进 flex 高度链，
   否则它会撑到内容高度，.modal-body 永远没有可滚动空间（长表单翻不到底） */
.modal-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; }
.modal-foot {
  padding: 14px 22px; border-top: 1px solid var(--line-2);
  display: flex; justify-content: flex-end; gap: 10px; align-items: center;
}
.modal-foot .left { margin-right: auto; font-size: 12.5px; color: var(--ink-500); }

/* Toast */
.toast-host { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #0f172a; color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13px; box-shadow: var(--shadow-lg); animation: toastIn .24s ease both;
  display: flex; align-items: center; gap: 8px;
}
.toast.ok { background: #14532d; }
.toast.err { background: #7f1d1d; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; } }

/* ============================ 结算单 ============================ */
.bill-sheet { font-size: 13px; }
.bill-sheet .sheet-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-bottom: 14px; border-bottom: 2px solid var(--ink-900); margin-bottom: 14px;
}
.bill-sheet .sheet-head h2 { font-size: 18px; letter-spacing: 2px; }
.bill-sheet .sheet-head .meta { text-align: right; font-size: 12px; color: var(--ink-500); line-height: 1.7; }
.bill-info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 22px; margin-bottom: 16px; }
.bill-info div { display: flex; gap: 8px; font-size: 12.5px; }
.bill-info span { color: var(--ink-400); flex: none; width: 62px; }
.bill-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bill-table th, .bill-table td { border: 1px solid var(--line); padding: 8px 10px; }
.bill-table th { background: #f8fafc; font-weight: 500; color: var(--ink-700); }
.bill-table td.num { text-align: right; font-family: var(--mono); }
.bill-total {
  margin-top: 12px; display: flex; justify-content: flex-end; gap: 26px;
  padding: 12px 14px; background: var(--accent-50); border-radius: 10px;
  border: 1px solid #fde8bd;
}
.bill-total .t-item { text-align: right; }
.bill-total .t-item span { font-size: 12px; color: var(--ink-500); display: block; }
.bill-total .t-item strong { font-size: 19px; font-variant-numeric: tabular-nums; color: var(--accent-600); }
.bill-note { margin-top: 14px; font-size: 11.5px; color: var(--ink-400); line-height: 1.8; border-top: 1px dashed var(--line); padding-top: 10px; }

/* ============================ 地图 ============================ */
.map-layout { display: grid; grid-template-columns: 1fr 268px; gap: 16px; align-items: start; }
@media (max-width: 1150px) { .map-layout { grid-template-columns: 1fr; } }
.map-canvas-wrap {
  background: #fbfcfe; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; overflow: hidden; position: relative;
}
.map-canvas-wrap svg { display: block; width: 100%; height: auto; touch-action: none; user-select: none; }
.map-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.map-bar .ctl, .map-bar .btn { height: 32px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--ink-500); padding: 10px 2px 0; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: middle; }
.basket-list { display: flex; flex-direction: column; gap: 7px; max-height: 430px; overflow-y: auto; }
.basket-chip {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 9px; font-size: 12.5px; background: #fff;
  cursor: pointer; transition: .15s;
}
.basket-chip:hover { border-color: #c9d6ea; background: #fbfdff; }
.basket-chip .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.basket-chip .bc-main { flex: 1; min-width: 0; }
.basket-chip .bc-main strong { display: block; font-weight: 600; font-size: 12.5px; }
.basket-chip .bc-main small { color: var(--ink-400); font-size: 11px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

table.data.dense thead th, table.data.dense tbody td { padding-left: 10px; padding-right: 10px; }

/* ============================ 月结算单 ============================ */
.modal.sheet { width: 1120px; }
.sheet-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.sheet-bar .sb-left { display: flex; gap: 8px; align-items: center; }
.sheet-bar .sb-left .ctl { height: 32px; }
.sheet-bar .sb-right { display: flex; gap: 8px; }
.sheet-bar .pill { font-size: 12px; }
.sheet-bar .pill b { font-variant-numeric: tabular-nums; }
.sb-hint { font-size: 12px; color: var(--ink-400); }
.sheet-paper { background: #fff; border: 1px solid #cfd8e3; border-radius: 6px; padding: 16px 18px 14px; }
.sp-company { text-align: center; font-size: 19px; font-weight: 600; letter-spacing: 2px; }
.sp-title { text-align: center; font-size: 15px; letter-spacing: 7px; margin: 5px 0 14px; }
.sp-meta { display: flex; justify-content: space-between; gap: 16px; font-size: 12.5px; margin-bottom: 8px; }
.sp-meta b { font-weight: 600; }
.sp-month { letter-spacing: 1px; }
.sheet-tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sheet-tbl td, .sheet-tbl th { border: 1px solid #93a3b8; height: 28px; text-align: center; font-size: 11.5px; padding: 0 2px; }
.day-tbl { margin-bottom: -1px; }
.day-tbl th { background: #f4f7fb; font-weight: 500; font-size: 11px; }
.day-tbl th.lbl, .sum-tbl td.lbl { background: #f4f7fb; font-weight: 500; font-size: 11.5px; white-space: nowrap; }
.day-tbl td.day { font-variant-numeric: tabular-nums; }
.day-tbl td.day.pre, .day-tbl td.day.post { background: #fafafa; color: #cbd5e1; }
.day-tbl td.day.zero { color: #dfe5ee; }
.sum-tbl td.v { font-variant-numeric: tabular-nums; }
.sum-tbl td.v.strong { font-weight: 600; }
.sum-tbl td.u { color: #64748b; font-size: 11px; }
.sum-tbl td.big { text-align: left; padding-left: 10px; font-size: 11.5px; letter-spacing: .5px; }
.sum-tbl td.note { text-align: left; padding: 4px 8px; font-size: 11.5px; color: #475569; }
.sp-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 30px; margin-top: 14px; font-size: 12.5px; line-height: 2.1; }

/* 设备勾选器 */
.unit-picker { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.up-head { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; background: #f8fafc; font-size: 12px; color: var(--ink-500); border-bottom: 1px solid var(--line-2); }
.up-head b { color: var(--ink-900); font-variant-numeric: tabular-nums; }
.up-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 6px; padding: 10px; max-height: 186px; overflow-y: auto; }
.up-item { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 12px; cursor: pointer; transition: .15s; }
.up-item.on { border-color: var(--brand-600); background: #f5f9ff; }
.up-item input { width: auto; height: auto; margin: 0; accent-color: var(--brand-600); }
.up-code { font-family: var(--mono); font-weight: 600; }
.up-state { margin-left: auto; font-size: 10.5px; color: var(--ink-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 94px; }

/* ============================ 实时计费看板 ============================ */
.live-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.lb-month { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 6px 10px; }
.lb-month b { font-size: 14px; letter-spacing: .5px; }
.lb-today { font-size: 11.5px; color: var(--ink-400); border-left: 1px solid var(--line-2); padding-left: 8px; white-space: nowrap; }
.lb-tabs { display: flex; gap: 2px; background: #eef2f7; border-radius: 10px; padding: 3px; }
.seg { border: 0; background: transparent; font-size: 12.5px; color: var(--ink-500); padding: 6px 13px; border-radius: 8px; cursor: pointer; font-family: inherit; transition: .15s; }
.seg:hover { color: var(--ink-900); }
.seg.on { background: #fff; color: var(--ink-900); font-weight: 600; box-shadow: 0 1px 3px rgba(15, 23, 42, .1); }
.lb-actions { margin-left: auto; }
.live-kpi { grid-template-columns: repeat(auto-fit, minmax(188px, 1fr)); }

.live-head-card { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 13px 16px; margin-bottom: 12px; }
.lh-left { display: flex; gap: 14px; flex-wrap: wrap; }
.lh-field { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--ink-500); }
.lh-field select { min-width: 250px; }
.lh-right { display: flex; gap: 8px; flex-wrap: wrap; }

.sheet-card { padding: 16px; }
.sp-live { font-size: 9.5px; letter-spacing: 1px; border: 1px solid var(--red); color: var(--red); border-radius: 4px; padding: 1px 5px; margin-left: 8px; vertical-align: 3px; font-weight: 500; }
.day-tbl th.today { background: #fff1ee; color: var(--red); }
.day-tbl td.day.future { background: #fbfcfe; color: #e2e8f0; }

.live-foot { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.lf-item { display: flex; flex-direction: column; gap: 3px; }
.lf-item span { font-size: 11px; color: var(--ink-400); }
.lf-item b { font-size: 14px; font-variant-numeric: tabular-nums; }

/* 多项目矩阵 */
.mx-wrap { overflow-x: auto; }
.mx-table { border-collapse: separate; border-spacing: 1px; width: 100%; font-size: 11px; }
.mx-table th, .mx-table td { text-align: center; padding: 5px 2px; white-space: nowrap; }
.mx-table thead th { background: #f6f8fb; color: var(--ink-500); font-weight: 500; font-size: 10.5px; }
.mx-table th.today { background: #ffe9e4; color: var(--red); }
.mx-table th.future { color: var(--ink-300); }
.mx-name { text-align: left !important; min-width: 186px; padding-left: 10px !important; background: #fff; }
.mx-cell { color: var(--ink-300); font-variant-numeric: tabular-nums; background: #fafbfd; border-radius: 3px; }
.mx-cell.future { background: #fdfefe; }
.mx-cell.sum { background: #eef2f7; color: var(--ink-600); font-weight: 600; }
.mx-total { font-weight: 600; font-variant-numeric: tabular-nums; background: #f6f8fb; min-width: 68px; }
.mx-table tfoot td { background: #f0f4fa; font-weight: 600; }

/* 起算单 / 报停单纸面 */
.modal.narrow { width: 640px; }
.doc-paper { background: #fff; border: 1px solid #cfd8e3; border-radius: 6px; padding: 22px 26px; font-size: 12.5px; }
.doc-company { text-align: center; font-size: 18px; font-weight: 600; letter-spacing: 2px; }
.doc-title { text-align: center; font-size: 15px; letter-spacing: 6px; margin: 8px 0 18px; }
.doc-tbl { width: 100%; border-collapse: collapse; margin-bottom: 16px; table-layout: fixed; }
.doc-tbl td { border: 1px solid #93a3b8; height: 38px; padding: 6px 10px; font-size: 12.5px; word-break: break-all; }
.doc-tbl td.k { width: 92px; background: #f4f7fb; text-align: center; white-space: nowrap; }
.doc-tbl td.v { width: auto; }
.doc-tbl td.note { line-height: 1.85; color: #475569; font-size: 11.5px; }
.doc-tbl .extra { margin-top: 4px; color: var(--ink-700); }
.doc-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; font-size: 12.5px; line-height: 2.4; }
.doc-date { color: var(--ink-500); }
.doc-foot { margin-top: 18px; font-size: 10.5px; color: var(--ink-400); text-align: right; }

/* 打印 */
@media print {
  body.printing-page .sidebar, body.printing-page .topbar, body.printing-page .live-bar,
  body.printing-page .live-kpi, body.printing-page .live-head-card, body.printing-page .live-foot,
  body.printing-page .no-print { display: none !important; }
  body.printing-page .app { display: block; height: auto; }
  body.printing-page .main, body.printing-page .view { padding: 0; overflow: visible; }
  body.printing-page .card { border: 0; box-shadow: none; padding: 0; }
  body.printing-page .sheet-paper { border: 0; padding: 0; }
  body.printing-page .mx-table thead th { background: #f4f7fb !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}


@media print {
  .sidebar, .topbar, .modal-head, .modal-foot, .no-print { display: none !important; }
  .app { display: block; height: auto; }
  .modal-mask { position: static; background: #fff; padding: 0; backdrop-filter: none; }
  .modal { box-shadow: none; width: 100%; max-height: none; }
  .modal-body { overflow: visible; padding: 0; }
  .view { padding: 0; }
  body { background: #fff; }
}

/* 打印结算单：只输出纸面 */
@media print {
  body.printing #app, body.printing #loginScreen, body.printing .toast-host { display: none !important; }
  body.printing #modalHost { position: static; }
  body.printing .modal-mask {
    position: static; inset: auto; display: block; padding: 0;
    background: none; backdrop-filter: none; animation: none;
  }
  body.printing .modal.sheet { width: auto; max-width: none; max-height: none; border-radius: 0; box-shadow: none; }
  body.printing .modal-head, body.printing .modal-foot, body.printing .no-print { display: none !important; }
  body.printing .modal-body { padding: 0; overflow: visible; }
  body.printing .modal, body.printing .modal-mask { animation: none !important; opacity: 1 !important; transform: none !important; }
  body.printing .sheet-paper { border: 0; border-radius: 0; padding: 0; }
  @page { size: A4 landscape; margin: 12mm 10mm; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .view { padding: 16px; }
  .topbar { padding: 0 16px; }
}

/* 无障碍：尊重系统「减弱动态效果」设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001s !important;
    animation-delay: 0s !important;
    transition-duration: .001s !important;
  }
}

/* ============================ 首页待办 ============================ */
.todo-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 11px; margin-bottom: 18px; }
@media (max-width: 1280px) { .todo-strip { grid-template-columns: repeat(auto-fit, minmax(172px, 1fr)); } }
.ts-item {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); text-decoration: none; color: inherit; transition: .15s;
}
.ts-item:hover { border-color: #c9d6ea; transform: translateY(-1px); box-shadow: var(--shadow); }
.ts-num { font-size: 21px; font-weight: 650; font-variant-numeric: tabular-nums; min-width: 26px; }
.ts-main { flex: 1; min-width: 0; }
.ts-main strong { display: block; font-size: 12.5px; font-weight: 600; }
.ts-main small { display: block; font-size: 11px; color: var(--ink-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-unit { font-size: 11px; color: var(--ink-400); }
.ts-item.red { border-color: #f7d4d4; background: linear-gradient(180deg, #fff, #fff8f8); }
.ts-item.red .ts-num { color: var(--red); }
.ts-item.amber { border-color: #fbe6c0; background: linear-gradient(180deg, #fff, #fffcf5); }
.ts-item.amber .ts-num { color: var(--accent-600); }
.ts-item.ok .ts-num { color: var(--green); }

/* ============================ 范本中心 ============================ */
.tpl-hero {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 18px 20px; margin-bottom: 16px; border-radius: var(--radius);
  background: linear-gradient(120deg, #101a2c, #1b2c4b 62%, #16233a);
  color: #e2e8f0; border: 1px solid #1d2942;
  box-shadow: 0 10px 30px rgba(11, 18, 32, .22);
}
.th-main { flex: 1; min-width: 260px; }
.th-main h2 { font-size: 15.5px; display: flex; align-items: center; gap: 8px; color: #fff; }
.th-main h2 svg { color: var(--accent); }
.th-main p { font-size: 12.5px; color: #94a3b8; margin-top: 6px; line-height: 1.75; max-width: 720px; }
.th-main p b { color: #fbbf24; font-weight: 600; }
.th-stat { display: flex; gap: 22px; }
.th-stat div { text-align: center; }
.th-stat b { display: block; font-size: 21px; color: #fbbf24; font-variant-numeric: tabular-nums; }
.th-stat span { font-size: 11.5px; color: #7c8aa3; }

.chip {
  height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-size: 12.5px; color: var(--ink-500); transition: .15s;
}
.chip:hover { border-color: #cfd8e6; color: var(--ink-900); }
.chip.on { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tpl-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px 14px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; transition: .16s;
}
.tpl-card:hover { border-color: #c9d6ea; box-shadow: var(--shadow); transform: translateY(-2px); }
.tc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.tc-cat { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--brand-50); color: var(--brand); }
.tc-tag { font-size: 10.5px; padding: 2px 7px; border-radius: 999px; background: var(--slate-bg); color: var(--ink-400); }
.tc-tag.custom { background: var(--accent-50); color: var(--accent-600); }
.tpl-card h3 { font-size: 14.5px; font-weight: 600; letter-spacing: .2px; }
.tpl-card > p { font-size: 12px; color: var(--ink-400); line-height: 1.7; margin-top: 6px; min-height: 34px; }
.tc-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--ink-400); margin: 11px 0 13px; }
.tc-actions { display: flex; gap: 8px; align-items: center; margin-top: auto; }
.tc-actions .link-btn { margin-left: auto; }

/* 纸面：同时用于编辑与打印预览 */
.doc-paper2 { background: #fff; border: 1px solid #cfd8e3; border-radius: 6px; padding: 30px 34px; }
.tpl-paper {
  font-family: "Songti SC", "SimSun", "宋体", serif;
  font-size: 12.5px; line-height: 1.95; color: #111;
}
.tpl-paper .co { text-align: center; font-size: 16px; font-weight: 700; letter-spacing: 2px; }
.tpl-paper h1 { text-align: center; font-size: 19px; letter-spacing: 6px; margin: 8px 0 14px; font-weight: 700; }
.tpl-paper h2 { font-size: 13.5px; font-weight: 700; margin: 14px 0 6px; letter-spacing: .5px; }
.tpl-paper p { margin: 5px 0; text-indent: 2em; }
.tpl-paper p.no { text-indent: 0; }
.tpl-paper p.foot { font-size: 11px; color: #444; text-indent: 0; margin-top: 10px; }
.tpl-paper .sub { text-align: right; font-size: 11.5px; color: #333; margin-bottom: 10px; }
.tpl-paper table { width: 100%; border-collapse: collapse; margin: 8px 0; table-layout: fixed; }
.tpl-paper td, .tpl-paper th {
  border: 1px solid #333; padding: 5px 8px; font-size: 12px; line-height: 1.7;
  vertical-align: middle; word-break: break-all;
}
.tpl-paper th { background: #f2f2f2; font-weight: 600; text-align: center; white-space: nowrap; }
.tpl-paper td.k { background: #fafafa; text-align: center; white-space: nowrap; }
.tpl-paper td.note { text-indent: 0; color: #222; font-size: 11.5px; }
.tpl-paper .sign { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 26px; margin-top: 18px; }
.tpl-paper .sign p { text-indent: 0; margin: 4px 0; }
.tpl-paper ul, .tpl-paper ol { margin: 6px 0 6px 1.6em; padding: 0; }
.tpl-paper li { margin: 3px 0; }

/* 编辑器 */
.modal.doc { width: 940px; }
.ed-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ed-bar .ctl { height: 32px; }
.ed-name { flex: 1; min-width: 200px; font-weight: 600; }
.ed-state { font-size: 11.5px; color: var(--ink-400); margin-left: auto; padding: 4px 9px; border-radius: 999px; background: var(--slate-bg); white-space: nowrap; }
.ed-state.dirty { background: var(--amber-bg); color: var(--amber); }
.ed-state.saving { background: var(--blue-bg); color: var(--blue); }
.ed-state.ok { background: var(--green-bg); color: var(--green); }
.ed-state.err { background: var(--red-bg); color: var(--red); }

.ed-tools { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; padding: 6px 8px; background: #f8fafc; border: 1px solid var(--line); border-radius: 9px 9px 0 0; border-bottom: 0; }
.ed-tools button {
  height: 27px; min-width: 28px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; font-size: 12px; color: var(--ink-700);
}
.ed-tools button:hover { background: #fff; border-color: var(--line); }
.ed-tools .sep { width: 1px; height: 16px; background: var(--line); margin: 0 4px; }

.ed-wrap { border: 1px solid var(--line); border-radius: 0 0 10px 10px; background: #eef2f7; padding: 12px; max-height: calc(100vh - 300px); overflow: auto; }
.ed-wrap .doc-paper2 { max-width: 820px; margin: 0 auto; box-shadow: 0 2px 10px rgba(15,23,42,.08); }
.tpl-edit { outline: none; min-height: 520px; }
.tpl-edit:focus { outline: none; }
.tpl-edit:empty::before { content: "在此输入范本内容…"; color: #bbb; }

.ed-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.ed-foot .muted { font-size: 12px; }
.ef-right { display: flex; gap: 8px; }
.ap-hint { font-size: 12px; color: var(--ink-400); line-height: 1.8; }

/* ============================ 检查项表格 ============================ */
.chk-wrap { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.chk-head { display: flex; align-items: baseline; gap: 10px; padding: 9px 12px; background: #f8fafc; border-bottom: 1px solid var(--line-2); font-size: 12px; }
.chk-head b { font-size: 12.5px; }
.chk-head .muted { font-size: 11.5px; }
.chk-tbl { width: 100%; border-collapse: collapse; }
.chk-tbl thead th { background: #fbfcfe; font-size: 11.5px; font-weight: 500; color: var(--ink-500); padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line-2); }
.chk-tbl td { padding: 5px 8px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.chk-tbl tr:last-child td { border-bottom: 0; }
.chk-tbl .ai-k { font-size: 12px; line-height: 1.6; padding-right: 12px; }
.chk-tbl .ctl { height: 30px; font-size: 12px; width: 100%; }
.chk-tbl td:nth-child(2) .ctl { padding: 0 4px; }

/* ============================ 库存 / 押金 / 到期 ============================ */
.row-warn { background: #fffafa; }
.row-warn:hover { background: #fff5f5 !important; }
.low-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--red); vertical-align: 2px; margin-left: 4px; }
.chk-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-500); }
.chk-inline input { accent-color: var(--brand-600); }

table.data tfoot td { background: #f7f9fc; font-size: 12.5px; padding: 11px 14px; border-top: 1px solid var(--line); }
table.data tfoot .num { font-family: var(--mono); }

.todo-list { display: flex; flex-direction: column; }
.todo-item { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.todo-item:last-child { border-bottom: 0; }
.todo-item.warn { background: linear-gradient(90deg, #fffdf7, #fff); }
.todo-item.danger { background: linear-gradient(90deg, #fff8f8, #fff); }
.td-day { width: 66px; text-align: center; flex: none; }
.td-day b { display: block; font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
.todo-item.danger .td-day b { color: var(--red); font-size: 15px; }
.todo-item.warn .td-day b { color: var(--accent-600); }
.td-day span { font-size: 10.5px; color: var(--ink-400); }
.td-main { flex: 1; min-width: 0; }
.td-main strong { display: block; font-size: 13px; }
.td-main small { font-size: 11.5px; color: var(--ink-400); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-val { text-align: right; }
.td-val span { display: block; font-size: 11px; color: var(--ink-400); }
.td-val b { font-size: 13px; font-variant-numeric: tabular-nums; }

/* 打印：只输出弹窗纸面（A4 纵向，可跨页） */
@media print {
  body.printing-doc #app, body.printing-doc #loginScreen, body.printing-doc .toast-host { display: none !important; }
  body.printing-doc #modalHost { position: static; }
  body.printing-doc .modal-mask {
    position: static; inset: auto; display: block; padding: 0; background: none;
    backdrop-filter: none; animation: none;
  }
  body.printing-doc .modal {
    width: auto; max-width: none; max-height: none; border-radius: 0; box-shadow: none;
    animation: none !important; opacity: 1 !important; transform: none !important;
  }
  body.printing-doc .modal-head, body.printing-doc .modal-foot { display: none !important; }
  body.printing-doc .modal-body { padding: 0; overflow: visible; }
  body.printing-doc .doc-paper2 { border: 0; border-radius: 0; padding: 0; box-shadow: none; }
  body.printing-doc .tpl-paper { font-size: 11pt; line-height: 1.75; }
  body.printing-doc .tpl-paper td, body.printing-doc .tpl-paper th { font-size: 10pt; padding: 4px 6px; }
  body.printing-doc .tpl-paper h1 { font-size: 15pt; }
  body.printing-doc .tpl-paper .co { font-size: 13pt; }
  body.printing-doc .tpl-paper tr, body.printing-doc .tpl-paper .sign { break-inside: avoid; }
  body.printing-doc .tpl-paper table { break-inside: auto; }
}

/* ============================================================
   v5 进出库管理 / 结算报表
   ============================================================ */

/* ---- 工地在用配件 ---- */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; align-items: start; }
.site-card { padding: 0; overflow: hidden; }
.site-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 16px 10px; border-bottom: 1px solid var(--line-2);
}
.site-head h3 { margin: 0; font-size: 14px; }
.site-head p { margin: 3px 0 0; font-size: 11.5px; color: var(--ink-400); }
.site-val { font-size: 15px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; white-space: nowrap; }
.site-card .table-wrap { max-height: 320px; overflow: auto; }

/* ---- 表体紧凑 ---- */
table.data.compact th, table.data.compact td { padding: 5px 8px; font-size: 12px; }
table.data.compact input[type="number"] { padding: 3px 6px; font-size: 12px; text-align: right; }
table.data.compact td.num { white-space: nowrap; }
.site-card table.data.compact td:first-child { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- 单据表单（弹窗内） ---- */
.doc-form { display: flex; flex-direction: column; gap: 16px; }
.doc-sec { border-top: 1px dashed var(--line); padding-top: 12px; }
.doc-sec:first-of-type { border-top: 0; padding-top: 0; }
.doc-sec-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.doc-sec-head h4 { margin: 0; font-size: 12.5px; color: var(--ink-700); font-weight: 600; }
.doc-sec-tools { display: flex; align-items: center; gap: 8px; }
.doc-fee-foot {
  display: flex; gap: 22px; justify-content: flex-end; padding: 8px 4px 0;
  font-size: 12.5px; color: var(--ink-500);
}
.doc-fee-foot b { font-variant-numeric: tabular-nums; color: var(--ink-900); }
.fee-table input, .fee-table select { width: 100%; }
.fee-table td { vertical-align: middle; }

/* ---- 报表参数条 ---- */
.rp-arg {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.rp-arg label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-500); }
.rp-arg select, .rp-arg input {
  padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px;
  font-size: 12.5px; background: var(--card); color: var(--ink-900); min-width: 120px;
}

/* ---- 31 列矩阵表 ---- */
table.data.matrix th, table.data.matrix td { padding: 3px 4px; font-size: 11.5px; text-align: center; }
table.data.matrix thead th { font-size: 10.5px; font-weight: 600; color: var(--ink-500); }
table.data.matrix tbody td { font-variant-numeric: tabular-nums; }
table.data.matrix .cell-zero { color: var(--ink-300); }
table.data.matrix .sum-col { background: #fafbfe; font-variant-numeric: tabular-nums; }
table.data.matrix .sticky-l {
  position: sticky; left: 0; z-index: 2; background: var(--card); text-align: left;
  box-shadow: 1px 0 0 var(--line);
}
table.data.matrix .sticky-l2 {
  position: sticky; left: 130px; z-index: 2; background: var(--card); text-align: left;
  box-shadow: 1px 0 0 var(--line);
}
table.data.matrix thead .sticky-l, table.data.matrix thead .sticky-l2 { z-index: 3; background: #fbfcfe; }
table.data.matrix tfoot .sticky-l { background: #fbfcfe; }

/* ---- 利润/年度 双栏 ---- */
.rp-split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; }
@media (max-width: 1080px) { .rp-split { grid-template-columns: 1fr; } }
.rp-foot { margin-top: 10px; }
.rp-shift { font-size: 12px; color: var(--ink-500); line-height: 2; }
.chip-mini {
  display: inline-block; padding: 1px 8px; margin: 0 4px 4px 0;
  background: var(--slate-bg); border-radius: 999px; font-size: 11px; color: var(--ink-700);
}

/* ---- 报表矩阵压缩：31 天 + 台班/日租金/月合计 一屏可见 ---- */
table.data.matrix.rp-matrix thead th.num { padding: 3px 1px; width: 17px; min-width: 17px; font-size: 10px; }
table.data.matrix.rp-matrix tbody td.num { padding: 3px 1px; font-size: 11px; }
table.data.matrix.rp-matrix .sum-col { white-space: nowrap; padding: 3px 7px; }
table.data.matrix.rp-matrix thead .sum-col { font-size: 10.5px; }
table.data.matrix.rp-month th.sticky-l, table.data.matrix.rp-month td.sticky-l {
  width: 118px; min-width: 118px; max-width: 118px;
}
table.data.matrix.rp-month th.sticky-l2, table.data.matrix.rp-month td.sticky-l2 {
  width: 118px; min-width: 118px; max-width: 118px; left: 118px;
}
table.data.matrix.rp-matrix tfoot td.muted { text-align: left; }

/* ---- 结算单：计费区间工具条 ---- */
.cf-tool {
  display: flex; flex-direction: column; align-items: stretch; gap: 9px;
  padding: 10px 12px; margin-bottom: 12px;
  background: var(--slate-bg, #f6f8fb); border: 1px solid var(--line); border-radius: 10px;
}
.cf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cf-tag { font-size: 12px; color: var(--ink-500); }
.cf-f { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-500); }
.cf-f select, .cf-f input {
  padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px;
  font-size: 12.5px; background: #fff; color: var(--ink-900);
}
.cf-f input[type="date"] { min-width: 138px; }
.cf-sep { color: var(--ink-400); }
.cf-hint { font-size: 12px; color: var(--ink-500); margin-left: auto; }
.cf-range {
  margin: 4px 0 10px; padding: 6px 10px; font-size: 12px; color: #475569;
  background: #f8fafc; border-left: 3px solid var(--brand-600); border-radius: 3px;
}
.cf-range b { color: #0f172a; font-weight: 600; }
table.stk-table.cf-table.dense th, table.stk-table.cf-table.dense td {
  padding: 2px 0; font-size: 8.5px; border-right: 1px solid #e8eef6;
}
table.stk-table.cf-table.dense thead th { font-size: 8px; }

/* ---- 单据纸面（打印用，屏幕预览也一致） ---- */
.stk-title {
  text-align: center; font-size: 17px; font-weight: 700; letter-spacing: 3px;
  margin: 0 0 10px; font-family: "SimSun", "宋体", serif;
}
.stk-meta {
  display: flex; flex-wrap: wrap; gap: 8px 26px; font-size: 12px;
  margin-bottom: 6px; color: var(--ink-900);
}
.stk-meta b { font-weight: 600; }
table.stk-table {
  width: 100%; border-collapse: collapse; margin-bottom: 10px;
  font-size: 11.5px; font-family: "SimSun", "宋体", serif;
}
table.stk-table th, table.stk-table td {
  border: 1px solid #334155; padding: 3px 5px; line-height: 1.5;
}
table.stk-table th { background: #f1f5f9; font-weight: 600; white-space: nowrap; text-align: center; }
table.stk-table td.c { text-align: center; }
table.stk-table td.r { text-align: right; }
table.stk-table tfoot td { background: #fafbfe; }
.stk-fees { margin: 8px 0; }
.stk-fees .sf-title { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.stk-sign {
  display: flex; gap: 30px; flex-wrap: wrap; font-size: 12px;
  margin-top: 10px; font-family: "SimSun", "宋体", serif;
}
.stk-sign u { display: inline-block; min-width: 110px; text-decoration: none; border-bottom: 1px solid #334155; padding: 0 6px; }
/* 手写横线：一条到底，不再叠一层下划线字符 */
.stk-sign .su {
  display: inline-block; min-width: 108px; height: 15px; vertical-align: -3px;
  border-bottom: 1px solid #334155;
}
.stk-sign .su-filled { min-width: 108px; height: auto; padding: 0 6px; }
.stk-sign .su-date { min-width: 168px; }
.stk-note { margin-top: 8px; font-size: 11px; color: var(--ink-500); }

/* 租费确认单 */
table.stk-table.cf-table th, table.stk-table.cf-table td { padding: 3px 2px; font-size: 10.5px; }
table.stk-table.cf-sum td { padding: 5px 6px; }
table.stk-table.cf-sum .lbl { background: #f8fafc; font-weight: 600; white-space: nowrap; }
table.stk-table.cf-sum .total-row td { background: #fffaf0; font-weight: 600; }

/* 打印时的单据微调 */
@media print {
  body.printing-doc table.stk-table th,
  body.printing-doc table.stk-table td { border-color: #000; }
  body.printing-doc .stk-title { font-size: 15pt; }
  body.printing-doc table.stk-table { font-size: 8.6pt; }
  body.printing-doc table.stk-table.cf-table th,
  body.printing-doc table.stk-table.cf-table td { font-size: 7.6pt; padding: 2px 1px; }
  body.printing-doc .stk-sign, body.printing-doc .stk-meta { font-size: 9pt; }
  body.printing-doc table.stk-table tr { break-inside: avoid; }
}

/* 打印时弹窗必须整张纸输出：解除 flex 高度链与滚动，避免长单据被裁 */
@media print {
  .modal-form { display: block !important; overflow: visible !important; flex: none !important; }
  .modal-body { display: block !important; overflow: visible !important; flex: none !important; max-height: none !important; }
  .modal { display: block !important; }
}

/* 出库单明细：按 BOM 类别分组（篮体 / 主机部分 / 悬挂机构 / 配件） */
table.data.line-table tbody tr.line-grp td {
  background: #eef2f7; padding: 5px 9px; font-size: 11.5px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line-2);
}
/* 批量录入（新增配件 / 批量出入库）：表格里直接填，行高压缩一档 */
table.data.line-table input,
table.data.line-table select {
  width: 100%; padding: 4px 7px; font-size: 12px; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; color: var(--ink-900);
}
table.data.line-table input:focus,
table.data.line-table select:focus { outline: none; border-color: var(--brand-600); }
table.data.line-table td { padding: 5px 6px; }
.batch-bar { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; flex-wrap: wrap; }
.batch-bar .bf { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-500); }
.batch-bar .bf > span { white-space: nowrap; }
.batch-bar .bf select {
  padding: 5px 9px; font-size: 12.5px; border: 1px solid var(--line); border-radius: 7px;
  background: #fff; color: var(--ink-900);
}
.batch-hint { font-size: 11.5px; color: var(--ink-400); }
.batch-sum { margin-left: auto; font-size: 12px; color: var(--ink-500); }
.batch-head {
  display: flex; flex-wrap: wrap; gap: 10px 14px; padding: 2px 0 12px;
  border-bottom: 1px dashed var(--line-2); margin-bottom: 12px;
}
.batch-head .bf { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-500); }
.batch-head .bf > span { white-space: nowrap; }
.batch-head .bf input, .batch-head .bf select {
  padding: 5px 9px; font-size: 12.5px; border: 1px solid var(--line); border-radius: 7px;
  background: #fff; color: var(--ink-900); min-width: 130px;
}
.batch-head .bf-wide { flex: 1 1 220px; }
.batch-head .bf-wide input, .batch-head .bf-wide select { width: 100%; }

/* 报损凭据：平时收起，选「报损」才出现 —— 没凭据的报损不能进成本 */
.modal-body .loss-only { display: none; }
.modal-body.loss-on .loss-only.bf { display: flex; }
.modal-body.loss-on .loss-note { display: block; }
.line-table .loss-col { display: none; }
.line-table.is-loss .loss-col { display: table-cell; }
.loss-note {
  margin-top: 10px; padding: 8px 11px; font-size: 12px; line-height: 1.6;
  color: var(--amber-700, #92400e); background: var(--amber-bg, #fffbeb);
  border: 1px solid #fde68a; border-radius: 8px;
}
.loss-tag { font-size: 11px; line-height: 1.4; color: var(--amber-700, #92400e); margin-top: 2px; }
.loss-tag.bad { color: var(--ink-400); }
/* 损失来源：工地丢失 vs 库房报废 —— 一个扣在手量、一个扣库存，单上要看得清 */
.loss-src { font-size: 10.5px; line-height: 1.4; color: var(--ink-400); }

/* ---------- 退租盘点：客户手上的配件与进退差异 ---------- */
.seg-n {
  font-style: normal; font-size: 10.5px; font-weight: 600; margin-left: 5px;
  padding: 0 5px; line-height: 16px; border-radius: 8px;
  background: var(--brand-50, #eff6ff); color: var(--brand-700, #1d4ed8);
}
.seg.on .seg-n { background: rgba(255, 255, 255, .22); color: #fff; }
.mini-sel {
  height: 32px; padding: 0 8px; font-size: 12.5px; color: var(--ink-800);
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface, #fff);
}
.hold-wrap { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 12px; }
.hold-blk { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.hold-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px; background: var(--slate-bg, #f8fafc); border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.hh-l { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
.hh-no { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink-900); }
.hh-cu { font-weight: 600; color: var(--ink-800); }
.hh-pj { color: var(--ink-500); }
.hh-r { display: flex; align-items: center; gap: 10px; }
.hh-sum { font-size: 12px; color: var(--ink-500); }
.hh-sum b { color: var(--ink-900); font-weight: 600; }
.hold-blk .table-wrap { border: 0; border-radius: 0; }

/* 盘点弹窗：填实回，差额当场算成报废 */
.settle-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 2px 0 10px; margin-bottom: 8px; border-bottom: 1px dashed var(--line);
  font-size: 12.5px; color: var(--ink-600);
}
.settle-bar label { display: flex; align-items: center; gap: 6px; }
.settle-bar input, .settle-bar select {
  height: 30px; padding: 0 8px; font-size: 12.5px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--surface, #fff);
}
.settle-sum {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: flex-end;
  margin-top: 10px; padding: 9px 12px; font-size: 12.5px; color: var(--ink-600);
  background: var(--slate-bg, #f8fafc); border-radius: 8px;
}
.settle-sum b { color: var(--ink-900); font-weight: 600; }
.settle-sum .ss-net { padding-left: 14px; border-left: 1px solid var(--line); color: var(--ink-700); }
.settle-sum .ss-net b { color: var(--red); font-size: 13.5px; }
.diff-on { color: var(--red); font-weight: 600; }
/* 盘点表可能有几十行（一期整机出库就是 35 项）：表头吸顶、表体自己滚，汇总行始终看得见 */
.settle-wrap { max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.settle-wrap table.data thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface, #fff);
  box-shadow: inset 0 -1px 0 var(--line);
}
.settle-wrap table.data input[type="number"] { width: 100%; }

/* 费用明细脚下的一句：整机出库为什么没计成本 */
.parts-note {
  margin: 2px 12px 12px; padding: 8px 11px; font-size: 12px; line-height: 1.7;
  color: var(--ink-500); background: var(--slate-bg, #f8fafc);
  border-left: 3px solid var(--line); border-radius: 0 8px 8px 0;
}
.parts-note b { color: var(--ink-700); font-weight: 600; }
.req { color: var(--red); font-style: normal; }
.line-grp .grp-name { font-weight: 600; color: var(--ink-900); letter-spacing: .3px; }
.line-grp .grp-name::before {
  content: ''; display: inline-block; width: 3px; height: 11px; background: var(--brand-600);
  border-radius: 2px; margin-right: 6px; vertical-align: -1px;
}
.line-grp .grp-sum { margin-left: 12px; color: var(--ink-500); font-variant-numeric: tabular-nums; }

/* ============ 配件档案：五类筛选条 ============ */
.cat-chips {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 12px 18px 2px; border-bottom: 1px solid var(--line-2); margin-bottom: 2px;
}
.cat-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink-700);
  font-size: 12.5px; font-family: inherit; transition: all .14s;
}
.cat-chip:hover { border-color: var(--brand-600); color: var(--ink-900); }
.cat-chip.on { background: var(--brand-50, #eef4ff); border-color: var(--brand-400, #7f9df5); color: var(--brand-700, #2f4fd8); }
.cat-chip b { font-weight: 600; }
.cat-chip .cc-n { color: var(--ink-500); font-size: 11.5px; }
.cat-chip .cc-v { color: var(--ink-400); font-size: 11px; font-variant-numeric: tabular-nums; }
.cat-chip .cc-low {
  font-style: normal; min-width: 16px; height: 16px; line-height: 16px; text-align: center;
  border-radius: 8px; background: var(--red); color: #fff; font-size: 10.5px; padding: 0 4px;
}
.line-grp .grp-hint { margin-left: 10px; color: var(--ink-400); font-size: 11px; }

/* ============ 出库单：套数选择框 + 篮筐组合 + 米数核对 ============ */
.setgrid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px; margin-top: 4px;
}
.setcell {
  display: flex; align-items: center; gap: 6px; padding: 5px 9px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.setcell em { font-style: normal; font-size: 12px; color: var(--ink-500); white-space: nowrap; }
.setcell input {
  width: 100%; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-900); text-align: right;
}
.setcell:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.setgrid-sum { margin-top: 6px; font-size: 12.5px; color: var(--ink-600); }
.setgrid-sum b { font-size: 14px; color: var(--ink-900); font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .setgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.frame-sec .frame-input-row { display: flex; align-items: center; gap: 12px; padding: 2px 0 8px; }
.frame-sec .frame-input-row input {
  flex: 1 1 auto; max-width: 520px; height: 34px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 13px;
}
.frame-sec .frame-tip { color: var(--ink-400); font-size: 11.5px; white-space: nowrap; }
.frame-sec .frame-presets {
  margin: -4px 0 8px; padding: 5px 9px; border-radius: 7px;
  background: var(--slate-bg); color: var(--ink-500);
  font-size: 11.5px; line-height: 1.8; letter-spacing: .1px;
}
.frame-check { font-size: 12.5px; line-height: 1.7; }
.frame-check .fc-line { display: flex; gap: 18px; flex-wrap: wrap; }
.frame-check .fc-ok { color: var(--green-600, #1a9e5c); }
.frame-check .fc-short { color: var(--red); font-weight: 600; }
.frame-check .fc-over { color: var(--amber, #c47f00); font-weight: 600; }
.frame-check .fc-plan { color: var(--ink-500); font-size: 11.5px; margin-top: 2px; }
.frame-check .fc-warn { color: var(--amber, #c47f00); font-size: 11.5px; }
.stk-frame { color: var(--ink-700); }

/* ---------------------------- 现场照片上传 ---------------------------- */
.photo-field { display: block; }
.pf-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.pf-item {
  position: relative; width: 96px; height: 96px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--slate-bg);
}
.pf-item img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.pf-del {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  border: 0; background: rgba(15,23,42,.6); color: #fff; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.pf-del:hover { background: var(--red); }
.pf-add {
  width: 96px; height: 96px; border: 1px dashed var(--line); border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-400); cursor: pointer; background: #fbfcfe;
}
.pf-add:hover { border-color: var(--brand-600); color: var(--brand-600); background: #f6f9ff; }
.pf-plus { font-size: 19px; line-height: 1; }
.pf-txt { font-size: 11px; }
.pf-hint { margin-top: 8px; font-size: 11.5px; color: var(--ink-400); line-height: 1.6; }
.pf-hint.busy { color: var(--brand-600); font-weight: 600; }
.pf-thumbs { display: flex; gap: 3px; flex-wrap: wrap; }
.photo-viewer { display: flex; flex-direction: column; gap: 16px; }
.photo-viewer figure { margin: 0; text-align: center; }
.photo-viewer img { max-width: 100%; max-height: 64vh; border-radius: 10px; border: 1px solid var(--line); }
.photo-viewer figcaption { margin-top: 6px; font-size: 11.5px; color: var(--ink-400); }

/* ------------------------- 试算页：合同口径信息条 ------------------------- */
.c-info { margin-top: 14px; }
.ci-grid {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px;
  background: var(--slate-bg); border-radius: 10px; padding: 10px 12px;
}
.ci-cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ci-cell span { font-size: 11px; color: var(--ink-500); white-space: nowrap; }
.ci-cell b { font-size: 13.5px; font-variant-numeric: tabular-nums; color: var(--ink-900); }
@media (max-width: 1180px) { .ci-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ------------------ 报表：项目多选 chips + 筛选范围提示 ------------------ */
.proj-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.proj-chips .pc-lbl { font-size: 12.5px; color: var(--ink-500); margin-right: 2px; }
.proj-chips .pc {
  padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-700); font-size: 12px; cursor: pointer;
  transition: background .14s, border-color .14s, color .14s;
}
.proj-chips .pc:hover { border-color: var(--brand-600); color: var(--brand-600); }
.proj-chips .pc.on {
  background: var(--brand-600); border-color: var(--brand-600); color: #fff; font-weight: 600;
}
.proj-chips .pc-tip { font-size: 11.5px; color: var(--ink-400); }
.scope-tip {
  margin: 0 0 10px; padding: 8px 12px; border-radius: 8px;
  background: var(--blue-bg); color: var(--ink-700); font-size: 12px; line-height: 1.7;
}
.scope-tip b { color: var(--brand); }
.scope-tip .link-btn { margin-left: 6px; }

/* 利润表 · 维修费行内笔数 & 逐单明细折叠 */
.mt-note { font-size: 11.5px; margin-left: 4px; }
.mt-det { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.mt-det > summary {
  cursor: pointer; font-size: 12.5px; color: var(--brand); font-weight: 600;
  padding: 4px 0; list-style: none; display: flex; align-items: center; gap: 6px;
}
.mt-det > summary::-webkit-details-marker { display: none; }
.mt-det > summary::before {
  content: '▸'; font-size: 10px; color: var(--ink-400); transition: transform .14s;
}
.mt-det[open] > summary::before { transform: rotate(90deg); }
.mt-det > summary:hover { color: var(--brand-600); }
.mt-det .table-wrap { margin-top: 6px; }

/* ------------------ 结算单：计算方式切换 / 分月表块 / 费用说明 ------------------ */
.cf-mode { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cf-mode .cf-m {
  padding: 5px 13px; font-size: 12.5px; background: #fff; color: var(--ink-600);
  border: 0; border-right: 1px solid var(--line); cursor: pointer; transition: background .14s, color .14s;
}
.cf-mode .cf-m:last-child { border-right: 0; }
.cf-mode .cf-m:hover { background: #f6f9ff; color: var(--brand-600); }
.cf-mode .cf-m.on { background: var(--brand-600); color: #fff; font-weight: 600; }
.cf-mtip {
  margin: -6px 0 12px; font-size: 11.5px; color: var(--ink-500);
  padding-left: 2px;
}
/* 报停口径：与「计算方式」分组，用琥珀色提示它改的是合同商务条款（出账口径） */
.cf-mode-stop .cf-m.on { background: var(--amber, #b45309); }
/* 第三档「跟随系统」是恢复默认，不用主色，选中时用灰蓝区分 */
.cf-mode-stop .cf-m.cf-m-follow { color: var(--ink-500); font-size: 12px; }
.cf-mode-stop .cf-m.cf-m-follow.on { background: #64748b; color: #fff; }
.cf-mode .cf-m:disabled { cursor: not-allowed; opacity: .55; }
.cf-stopwarn { display: block; margin-top: 4px; color: var(--ink-500); line-height: 1.7; }
.cf-stop-tag {
  margin-left: 10px; padding: 1px 7px; border-radius: 4px;
  background: #fef3c7; color: #92400e; font-size: 10.5px; font-weight: 600;
}

.cf-blocks { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.cf-block-t {
  font-size: 11.5px; color: var(--ink-600); font-weight: 600;
  padding: 0 0 3px 2px; font-family: "SimSun", "宋体", serif;
}
table.stk-table.cf-table { table-layout: fixed; margin-bottom: 0; }
table.stk-table.cf-table th.cf-dh { width: 9%; background: #f1f5f9; }
table.stk-table.cf-table td.cf-idle { color: #cbd5e1; }

table.stk-table.cf-batch td, table.stk-table.cf-batch th { padding: 5px 6px; }
table.stk-table.cf-batch td.cf-bnote, table.stk-table.cf-fee td.cf-bnote {
  font-size: 10.5px; color: #475569; line-height: 1.55; text-align: left;
}
table.stk-table.cf-fee td, table.stk-table.cf-fee th { padding: 4px 6px; font-size: 10.5px; }

.cf-fees { margin-top: 10px; }
.cf-fees-t {
  font-size: 11.5px; font-weight: 600; color: var(--ink-700); margin-bottom: 4px;
  font-family: "SimSun", "宋体", serif;
}
@media print {
  body.printing-doc .cf-mode, body.printing-doc .cf-mtip { display: none; }
  body.printing-doc .cf-blocks { gap: 6px; }
}
table.stk-table.cf-batch tr.cf-adjr td { background: #fdfcf7; color: #475569; }

/* ============================================================
   进出场台账（按单据归集）
   ============================================================ */
.kpi .k-note { margin-top: 6px; font-size: 11.5px; line-height: 1.5; }
.kpi .k-note .k-warn { color: var(--amber); }
.kpi .k-note .k-ok { color: var(--ink-400); }
.kpi .k-note .muted { color: var(--ink-400); }

table.data.mv-table thead th { white-space: nowrap; }
tr.mv-row { cursor: pointer; }
tr.mv-row.open { background: #f7faff; }
tr.mv-row.open td { border-bottom-color: transparent; }
tr.mv-row:hover { background: #fafcff; }
tr.mv-row.open:hover { background: #f4f8ff; }
td.mv-caret { color: var(--ink-300); font-size: 11px; text-align: center; user-select: none; }
tr.mv-row.open td.mv-caret { color: var(--brand-600); }

tr.mv-det.hidden { display: none; }
tr.mv-det > td { background: #fbfcfe; padding: 0 !important; border-bottom: 1px solid var(--line) !important; }
.mv-det-box { padding: 10px 8px 12px 22px; }
.mv-det-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--ink-500); margin-bottom: 8px;
}
.mv-det-head b { color: var(--ink-900); font-family: var(--mono); font-size: 12.5px; }
.mv-det-sep { color: var(--ink-300); }
.mv-det-ops { display: flex; flex-wrap: wrap; gap: 6px; margin-left: 8px; }
.mv-op { font-size: 11.5px; padding: 1px 7px; border-radius: 20px; border: 1px solid transparent; }
.mv-op.ok { background: var(--green-bg); color: var(--green); border-color: #c7ebd3; }
.mv-op.warn { background: var(--amber-bg); color: var(--amber); border-color: #f6e0b8; }
.mv-op.miss { background: var(--red-bg); color: var(--red); border-color: #f6cfcf; }
/* 部件明细表：一张单里篮片、底板、悬挂机构各出了多少，按 BOM 五类分组 */
table.data.mv-parts { background: #fff; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
table.data.mv-parts thead th { background: #f8fafd; font-size: 11.5px; white-space: nowrap; }
table.data.mv-parts tbody td { font-size: 12px; padding-top: 5px; padding-bottom: 5px; }
table.data.mv-parts tbody tr:hover { background: #fafcff; }
table.data.mv-parts tbody td.num { font-variant-numeric: tabular-nums; }
tr.mv-cat > td {
  background: #f1f5fb; color: var(--ink-600); font-weight: 600;
  font-size: 11.5px; letter-spacing: .3px; padding: 4px 10px;
}
.mv-cat-n { margin-left: 8px; font-weight: 400; color: var(--ink-400); }
.mv-neg { color: var(--red); font-weight: 600; }
/* 出入方向：入库/退场把库存加回来（绿），出库/进场扣库存（墨） */
.mv-qty-in { color: var(--green); }
.mv-qty-out { color: var(--ink-700); }
.mv-parts-empty { padding: 12px; color: var(--ink-400); font-size: 12px; }

/* 明细来源提示：取自进出库单（库存已扣）还是按套数反推（未扣库存） */
.mv-src-row { display: flex; flex-wrap: wrap; gap: 8px; margin: -2px 0 8px; }
.mv-src { font-size: 11.5px; padding: 2px 8px; border-radius: 5px; }
.mv-src.ok { background: var(--green-bg); color: var(--green); }
.mv-src.warn { background: var(--amber-bg); color: var(--amber); }
.mv-src b { font-family: var(--mono); }
.mv-src-note { font-size: 11.5px; color: var(--ink-400); }

/* 主表「部件明细」列：一眼看出这张单出的是哪些部件、库存扣没扣 */
table.data.mv-table th:nth-child(6) { min-width: 126px; }
.mv-pc { font-weight: 600; color: var(--ink-700); font-size: 12px; }
.mv-pc-tag { margin-left: 6px; font-size: 10.5px; padding: 1px 5px; border-radius: 4px; display: inline-block; white-space: nowrap; }
.mv-pc-tag.ok { background: var(--green-bg); color: var(--green); }
.mv-pc-tag.warn { background: var(--amber-bg); color: var(--amber); }

/* 单据明细底部的「改单 / 删单」 */
.mv-det-foot { display: flex; gap: 14px; margin-top: 8px; padding-left: 2px; }

/* 开单弹窗里的设备勾选面板 */
.mv-pick { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.mv-pick-head {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; background: #f8fafd; border-bottom: 1px solid var(--line);
}
.mv-pick-head input {
  flex: 1; height: 30px; padding: 0 9px; font-size: 12.5px;
  border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink-900);
}
.mv-pick-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 2px; padding: 8px; max-height: 240px; overflow: auto;
}
.mv-pick-item {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 12.5px;
}
.mv-pick-item:hover { background: #f3f7ff; }
.mv-pick-item input { margin: 0; accent-color: var(--brand-600); }
.mv-pick-item .mono { font-family: var(--mono); font-size: 12px; color: var(--ink-900); }
.mv-pick-empty { padding: 16px; text-align: center; font-size: 12.5px; color: var(--ink-400); border: 1px dashed var(--line); border-radius: 10px; }

/* 开单弹窗里的部件明细编辑器：出入库记的是部件，不是台数 */
.mv-pedit { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.mv-pedit-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 10px; background: #f8fafd; border-bottom: 1px solid var(--line);
}
.mv-pedit-tip { font-size: 11.5px; color: var(--ink-400); }
.mv-pedit-dirty { font-size: 11.5px; color: var(--amber); }
.mv-pedit-head .link-btn { font-size: 12px; }
table.data.mv-pedit-tbl { border: 0; border-radius: 0; }
table.data.mv-pedit-tbl thead th {
  position: sticky; top: 0; z-index: 1;
  background: #f8fafd; font-size: 11.5px; white-space: nowrap;
}
table.data.mv-pedit-tbl tbody td { font-size: 12px; padding-top: 4px; padding-bottom: 4px; }
table.data.mv-pedit-tbl tbody tr:hover { background: #fafcff; }
table.data.mv-pedit-tbl input[type="number"] { width: 100%; text-align: right; }
.mv-pedit-tbl .mp-name { width: 100%; }
.mv-pedit-tbl .mp-unit { width: 36px; text-align: center; }

/* 明细表最后一列：修改 / 增加 / 删除（放最后，不挡数量与工地在用） */
.mv-part-ops { white-space: nowrap; text-align: right; }
.mv-part-ops .link-btn { display: inline-block; font-size: 11px; padding: 0 2px; }
.mv-parts thead th:last-child { text-align: right; }

/* ============================================================
   单项目多月租金一览：放大字号、月份列加天数、合计列突出
   ============================================================ */
table.data.matrix.rp-proj th, table.data.matrix.rp-proj td { font-size: 12.5px; padding: 6px 3px; }
table.data.matrix.rp-proj thead th { font-size: 11.5px; color: var(--ink-500); padding-bottom: 8px; }
table.data.matrix.rp-proj thead th.num { font-size: 11px; }
table.data.matrix.rp-proj tbody td.num { font-size: 12.5px; }
table.data.matrix.rp-proj tbody tr:nth-child(even),
table.data.matrix.rp-proj tbody tr:nth-child(even) .sticky-l { background: #fafcff; }
table.data.matrix.rp-proj tbody tr:hover,
table.data.matrix.rp-proj tbody tr:hover .sticky-l { background: #f3f7ff; }
table.data.matrix.rp-proj .rp-mon { font-family: var(--mono); font-size: 13px; font-weight: 650; letter-spacing: -.2px; }
table.data.matrix.rp-proj .rp-mday { font-size: 10.5px; color: var(--ink-400); margin-top: 1px; }
table.data.matrix.rp-proj .sum-col { background: #f6f9ff; font-size: 13px; }
table.data.matrix.rp-proj thead .sum-col { background: #eef4ff; color: var(--ink-700); }
table.data.matrix.rp-proj tfoot td { font-size: 12.5px; padding: 9px 3px; }
table.data.matrix.rp-proj tfoot .sum-col { font-size: 13.5px; background: #eef4ff; }

/* 多月表：固定列宽，避免月份列把 31 个日列挤扁 */
table.data.matrix.rp-proj { table-layout: fixed; }
table.data.matrix.rp-proj td.cell-val { font-variant-numeric: tabular-nums; }
table.data.matrix.rp-proj th.no-print, table.data.matrix.rp-proj td.no-print { text-align: center; }
table.data.matrix.rp-proj td.sc-amt, table.data.matrix.rp-proj td.sc-qty { padding-right: 10px; }
table.data.matrix.rp-proj td.sc-amt { white-space: nowrap; }

/* ============================ 首页趋势图：切口径 / 切时长 ============================ */
.trend-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lb-tabs.sm { padding: 2px; }
.lb-tabs.sm .seg { padding: 5px 10px; font-size: 12px; }
.trend-unit { font-size: 11.5px; color: var(--ink-400); margin: -4px 0 6px; }
.chart.dense { gap: 6px; }
.chart.dense .bar-x { font-size: 11px; }
/* 三个口径各自的柱色 */
.chart .bar.m-pay { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.chart .bar.m-rent { background: linear-gradient(180deg, #34d399, #059669); }
.chart .bar.m-unit { background: linear-gradient(180deg, #a78bfa, #7c3aed); }
/* 当月高亮压过口径色（同特异性，放最后） */
.chart .bar.hi { background: linear-gradient(180deg, #fbbf24, #f59e0b) !important; }

/* ============================ 可选可填的 combobox（如维修单的吊篮编号） ============================ */
.combo { position: relative; }
.combo input { padding-right: 38px; }
.combo-btn {
  position: absolute; right: 1px; top: 1px; height: 35px; width: 32px;
  display: grid; place-items: center; border: 0; background: transparent;
  color: var(--ink-400); border-radius: 0 8px 8px 0; cursor: pointer;
}
.combo-btn:hover { background: #f1f5f9; color: var(--ink-700); }
.combo-panel {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .14); max-height: 226px; overflow: auto;
  display: none; padding: 4px;
}
.combo-panel.on { display: block; }
.combo-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 9px; border-radius: 7px; cursor: pointer; }
.combo-item:hover { background: #eef4ff; }
.combo-item b { font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
.combo-item small { color: var(--ink-400); font-size: 11.5px; }
.combo-empty { padding: 10px 11px; font-size: 12px; color: var(--ink-400); }
.combo-item.on { background: #eef4ff; }

/* 表格里用的 combobox：行高压缩后箭头要跟着缩，面板挂 body（表格容器 overflow 会裁掉绝对定位） */
.line-table .combo { position: relative; display: block; }
.line-table .combo input { padding-right: 26px; }
.line-table .combo-btn { height: 100%; top: 0; right: 0; width: 24px; border-radius: 0 6px 6px 0; }
.combo-panel.combo-fixed {
  position: fixed; top: 0; left: 0; right: auto; z-index: 4000;
  width: 330px; max-height: 300px; padding: 5px;
}
/* 面板里按「易损配件 / 螺丝配件 / 篮筐 / 悬挂机构 / 主机」分组 */
.combo-group {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 9px 4px; font-size: 11px; font-weight: 700; color: var(--ink-400);
  letter-spacing: .4px; border-top: 1px solid var(--line-2); margin-top: 2px;
}
.combo-group:first-child { border-top: 0; margin-top: 0; }
.combo-group span { font-weight: 400; color: var(--ink-300, #b6c0cf); }
.ci-tag {
  font-size: 10.5px; padding: 1px 5px; border-radius: 4px; margin-left: 6px;
  background: var(--slate-bg, #f1f5f9); color: var(--ink-400); font-weight: 400;
  font-family: var(--font); vertical-align: 1px;
}
.ci-tag.new { background: var(--amber-bg, #fef3c7); color: #b45309; font-weight: 600; }
.combo-item .ci-main { display: flex; align-items: center; min-width: 0; }
.combo-item .ci-main b { font-family: var(--font); font-weight: 600; font-size: 12.5px; }
.combo-foot {
  padding: 7px 9px 5px; font-size: 11px; color: var(--ink-400); border-top: 1px solid var(--line-2);
}

/* ============================ 首页 KPI 卡片整块可点 ============================ */
a.kpi-link {
  color: inherit; text-decoration: none; display: block; cursor: pointer;
  transition: box-shadow .16s, transform .16s, border-color .16s;
}
a.kpi-link:hover { border-color: #c7d2e4; box-shadow: 0 10px 24px rgba(15, 23, 42, .09); transform: translateY(-1px); }
a.kpi-link:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
a.kpi-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
a.kpi-link .k-go {
  font-size: 12px; color: var(--brand); margin-left: 4px;
  opacity: 0; transform: translateX(-3px);
  transition: opacity .16s, transform .16s; display: inline-block;
}
a.kpi-link:hover .k-go { opacity: 1; transform: none; }
.c-amber { color: var(--amber); }

/* ============================ 总结算单 ============================ */
.tot-tbl { margin-bottom: -1px; }
.tot-tbl th { background: #f4f7fb; font-weight: 500; font-size: 11.5px; }
.tot-tbl td { font-variant-numeric: tabular-nums; }
.tot-tbl tbody td.strong, .tot-tbl tfoot td { font-weight: 600; }
.tot-tbl tfoot td { background: #f8fafc; }
.tot-sub { font-size: 11.5px; color: #64748b; margin: 14px 0 5px; letter-spacing: .3px; }
.tot-flag {
  font-size: 11.5px; color: var(--amber); background: var(--amber-bg);
  border-radius: 5px; padding: 4px 8px; margin: 0 0 8px;
}

/* ============================ 起租超合同台数提示 ============================ */
.toast.warn { background: #78350f; }
.qty-warn { font-size: 12px; color: var(--ink-400); line-height: 1.65; margin-top: -2px; }
.qty-warn.on {
  background: var(--amber-bg); color: #92400e; border: 1px solid #fde3b0;
  border-radius: 8px; padding: 8px 11px;
}
.qty-warn.on b { color: #b45309; }
.qty-warn.on span { display: block; margin-top: 3px; color: #a16207; }
.kpi .k-foot .c-amber { white-space: nowrap; font-weight: 600; }

/* ============================ 移位清单（登记移位弹窗内回看 / 删重复） ============================ */
.sf-list { border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; padding: 9px 12px; }
.sf-list-h { font-size: 11.5px; color: var(--ink-500); line-height: 1.6; }
.sf-list-h b { color: var(--ink-700); }
.sf-row {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) 74px minmax(0, 1fr) 48px;
  gap: 8px; align-items: center; padding: 6px 0;
  border-top: 1px dashed var(--line); font-size: 12px;
}
.sf-date { font-family: var(--mono); color: var(--ink-600); }
.sf-calc { color: var(--ink-500); white-space: nowrap; }
.sf-calc b { color: var(--ink-700); }
.sf-side {
  font-size: 11px; text-align: center; border-radius: 4px; padding: 1px 0;
  background: var(--accent-50); color: var(--accent-600);
}
.sf-side.own { background: #f1f5f9; color: var(--ink-400); }
.sf-note { color: var(--ink-500); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-empty { font-size: 12px; color: var(--ink-400); }
.sf-row .link-btn { white-space: nowrap; justify-self: end; }

/* ---------------------- 出入库登记：配件多选（勾选列表 + 逐件明细） ----------------------
 * 一趟领多种配件是常态，单选的份数不够用。触发框做成输入框的样子，
 * 展开的列表走正常文档流（不用绝对定位）—— 弹窗正文本身是滚动容器，浮层会被裁掉。
 */
.mv-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-700); font-weight: 500; margin-bottom: 7px; }
.mv-label .req { color: var(--red); }
.mv-tip { font-weight: 400; font-size: 11.5px; color: var(--ink-400); }
.mv-trigger {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: 42px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer;
}
.mv-trigger:hover { border-color: #cfd8e6; }
.mv-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mv-ph { font-size: 12.5px; color: var(--ink-400); }
.mv-panel {
  margin-top: 8px; padding: 8px; display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm);
}
.mv-panel[hidden] { display: none; }
.mv-list { max-height: 216px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.mv-item { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 7px; font-size: 12.5px; color: var(--ink-700); cursor: pointer; }
.mv-item:hover { background: var(--slate-bg); }
.mv-item.on { background: var(--brand-50); }
.mv-item input { accent-color: var(--brand); flex: none; }
.mv-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-st { flex: none; font-size: 11.5px; color: var(--ink-400); }
.mv-empty { padding: 16px; text-align: center; font-size: 12.5px; color: var(--ink-400); }

/* 先选大类，再选明细 —— 48 种配件全铺出来找起来费眼 */
.mv-cats {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 2px 6px;
  border-bottom: 1px dashed var(--line);
}
.mv-cat {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  padding: 4px 10px; font-size: 12.5px; line-height: 1.4;
  color: var(--ink-600); background: #fff; border: 1px solid var(--line); border-radius: 999px;
}
.mv-cat i { font-style: normal; font-size: 11px; color: var(--ink-400); }
.mv-cat:hover { border-color: #cfd8e6; }
.mv-cat.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.mv-cat.on i { color: rgba(255, 255, 255, .82); }

/* 租赁出库 / 入库只是搬家，不算钱：单价与金额两列收起来，只有报损、易损件领用才显示 */
.line-table.no-price .col-price,
.line-table.no-price .col-amt { display: none; }
.mv-rows { max-height: 42vh; }
@media (max-width: 720px) {
  .mv-st { display: none; }
  .mv-item { padding: 9px 6px; }
}

/* 手机上的出入库明细：单位 / 现有库存 先让位，配件名和数量才是要天天点的 */
@media (max-width: 720px) {
  .mv-rows .col-unit, .mv-rows .col-stock, .mv-rows .col-amt { display: none; }
  .mv-rows table.data thead th, .mv-rows table.data tbody td { padding-left: 5px; padding-right: 5px; }
  .mv-rows .col-qty { width: 76px; }
  .mv-rows .col-price { width: 84px; }
  .mv-rows .col-del { width: 46px; }
  .mv-rows input { padding: 6px 6px; text-align: center; }
  .mv-rows tbody td:first-child { white-space: normal; }
}

/* ---------------------- 二级页签（一个入口下并几个页面） ----------------------
 * 原来「进出库管理 / 进出场台账 / 配件库存」各占一条菜单，一共 22 项要滚动找。
 * 现在用一条页签把它们收进同一个入口：页签是页面级导航，跟下面的小胶囊（页面内筛选）
 * 刻意做出区别 —— 下划线式、带说明文字。
 */
.sec-tabs {
  display: flex; align-items: stretch; gap: 4px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); margin-bottom: 16px;
}
.sec-tab {
  display: flex; align-items: center; gap: 7px; position: relative;
  border: 0; background: transparent; cursor: pointer; font-family: inherit;
  padding: 9px 13px 10px; margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--ink-500); font-size: 13px; transition: color .15s, border-color .15s;
}
.sec-tab:hover { color: var(--ink-900); }
.sec-tab.on { color: var(--ink-900); font-weight: 600; border-bottom-color: var(--brand); }
.sec-tab svg { opacity: .75; }
.sec-tab.on svg { opacity: 1; color: var(--brand); }
.sec-tab small {
  display: none; font-weight: 400; font-size: 11.5px; color: var(--ink-400); padding-left: 2px;
}
@media (min-width: 1000px) { .sec-tab small { display: inline; } }

/* ---------------------- 工地在用：默认折叠，只核数量 ---------------------- */
.site-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.site-card .site-head { cursor: pointer; align-items: center; }
.site-card .site-head:hover { background: var(--slate-bg); }
.site-caret {
  display: inline-block; width: 14px; color: var(--ink-400); font-size: 15px; line-height: 1;
  transform: rotate(0deg); transition: transform .15s;
}
.site-card.open .site-caret { transform: rotate(90deg); color: var(--brand); }
.site-hint { font-size: 11.5px; white-space: nowrap; }
.site-card.open .table-wrap { max-height: 460px; overflow: auto; }

/* 手机上顶栏：标题一行放不下会把日期挤成两行，副标题直接省掉 —— 页签已经说清楚了 */
@media (max-width: 720px) {
  .crumb { min-width: 0; }
  .crumb span { white-space: nowrap; font-size: 15px; }
  .crumb small { display: none; }
}

/* 手机上的流水单据：金额 / 经办 / 备注先让位，单号、配件、数量才是现场要核的 */
@media (max-width: 720px) {
  .mv-table .col-money, .mv-table .col-op, .mv-table .col-note { display: none; }
  .mv-table { min-width: 0 !important; }
  .mv-table th, .mv-table td { padding-left: 6px; padding-right: 6px; }
  .mv-table td:nth-child(2) { white-space: nowrap; }
}

/* ==================== BOM 部件配置（v6.30） ==================== */
.bom-page { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.bom-bar {
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 14px; box-shadow: var(--shadow-sm);
}
.bom-bar-l, .bom-bar-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bom-lb { font-size: 12.5px; color: var(--ink-500); }
.bom-sel {
  height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px;
  background: #fff; font: inherit; font-size: 13px; color: var(--ink-900); max-width: 240px;
}
.bom-pill { background: var(--brand-50); color: var(--brand); font-size: 11.5px; }
.bom-dirty {
  font-size: 11.5px; color: var(--amber); background: var(--amber-bg);
  border-radius: 20px; padding: 2px 9px;
}
.bom-hint { font-size: 12.5px; line-height: 1.9; color: var(--ink-500); padding: 11px 14px; }
.bom-hint strong { color: var(--ink-900); font-weight: 700; }
.bom-cats { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.bom-cat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  min-width: 0; max-width: 100%;   /* flex 子项默认 min-width:auto，表格会把卡片撑到页宽外 */
}
.bom-cat-h {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  background: #fbfcfe; border-bottom: 1px solid var(--line-2);
}
.bom-cat-h h3 { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--ink-900); }
.bom-cat-i { color: var(--brand); display: flex; }
.bom-cat-n { font-size: 11.5px; color: var(--ink-400); }
.bom-cat-h .spacer { flex: 1; }
.bom-cat-h .btn.danger-ghost { color: var(--red); border-color: #f4d6d6; background: #fff; }
.bom-tbl td { padding: 4px 8px; }
.bom-tbl input {
  width: 100%; height: 30px; border: 1px solid transparent; background: transparent;
  border-radius: 7px; padding: 0 7px; font: inherit; font-size: 13px; color: var(--ink-900);
}
.bom-tbl input:hover { background: #f8fafc; border-color: var(--line-2); }
.bom-tbl input:focus { background: #fff; border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-50); }
.bom-tbl .b-qty, .bom-tbl .b-price { text-align: right; }
.bom-tbl .b-unit { text-align: center; }
/* 库存数做成右侧小标：不占列宽，也不跟规格格挤在一起 */
.bom-td-name { position: relative; }
.bom-td-name input { padding-right: 72px; }
.bom-stk {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 10.5px; color: var(--ink-400); white-space: nowrap; pointer-events: none;
}
.bom-stk.warn { color: var(--amber); }
.bom-td-op { text-align: center; }
.bom-foot {
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 12.5px; color: var(--ink-500);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px;
}
.bom-foot b { color: var(--ink-900); font-size: 14px; font-weight: 700; }

@media (max-width: 720px) {
  .bom-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .bom-bar-l, .bom-bar-r { flex-wrap: wrap; }
  .bom-bar-r { justify-content: flex-start; }
  .bom-sel { flex: 1 1 auto; min-width: 0; max-width: none; height: 30px; font-size: 12.5px; }
  .bom-pill, .bom-cat-n { display: none; }
  .bom-hint { font-size: 12px; line-height: 1.8; }
  /* 手机只留：名称 / 规格 / 数量 / 删（单位与参考价让位，改到电脑上弄） */
  .bom-tbl th:nth-child(4), .bom-tbl td:nth-child(4),
  .bom-tbl th:nth-child(5), .bom-tbl td:nth-child(5) { display: none; }
  .bom-tbl { table-layout: fixed; }
  .bom-tbl th:nth-child(2), .bom-tbl td:nth-child(2) { width: 92px; }
  .bom-tbl th:nth-child(3), .bom-tbl td:nth-child(3) { width: 58px; }
  .bom-tbl th:last-child, .bom-tbl td:last-child { width: 32px; }
  .bom-td-name input { padding-right: 0; }
  .bom-stk { display: none; }
  .bom-foot { gap: 6px 12px; font-size: 12px; }
}

/* 出库单部件明细：行上的机型小标 + 规格输入格 */
.mv-pedit-tbl .mp-model {
  display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 5px;
  background: var(--brand-50); color: var(--brand); font-size: 10.5px; font-style: normal;
  line-height: 16px; vertical-align: 1px;
}
.mv-pedit-tbl .mp-spec { width: 100%; font-size: 12px; }
@media (max-width: 720px) {
  .mv-pedit-tbl th:nth-child(2), .mv-pedit-tbl td:nth-child(2) { display: none; }
  .mv-pedit-tbl .mp-model { margin-left: 3px; }
}
