/* 预算模块（单独付费）的样式。拆掉模块时删这个文件和 index.html 里的引用。主色和基线沿用 style.css 的变量 */
.bg-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.bg-sum .kpi { width: auto; min-height: 84px; }
.bg-sum .kpi .v { font-size: 22px; font-weight: 600; color: var(--text); letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.bg-sum .kpi .v.red { color: var(--red); } .bg-sum .kpi .v.amber { color: var(--amber); }
.bg-sum .kpi .s { font-size: 11px; color: var(--muted); margin-top: 2px; } .bg-sum .kpi .s.red { color: var(--red); }
table.bg { width: 100%; border-collapse: collapse; background: var(--surface); font-variant-numeric: tabular-nums; }
table.bg th { text-align: left; font-weight: 600; font-size: 11px; color: var(--muted); background: var(--bg); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.bg td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
table.bg th.num, table.bg td.num { text-align: right; }
table.bg tr.sec td { background: var(--surface-2); font-weight: 600; font-size: 12px; color: var(--text-2); padding: 7px 12px; cursor: pointer; }
table.bg tr.grp td { color: var(--muted); font-size: 12px; padding: 6px 12px 6px 28px; }
table.bg tr.line { cursor: pointer; } table.bg tr.line:hover td { background: var(--bg); }
table.bg td.name { padding-left: 44px; white-space: normal; min-width: 220px; }
table.bg td.name.flat { padding-left: 12px; }
table.bg tr.tot td { font-weight: 600; background: var(--bg); border-top: 2px solid var(--line); }
table.bg .red { color: var(--red); font-weight: 600; } table.bg .green { color: var(--green); }
.bg-chev { display: inline-block; width: 0; height: 0; border-left: 5px solid var(--muted); border-top: 4px solid transparent; border-bottom: 4px solid transparent; margin-right: 8px; transform: rotate(90deg); transition: transform .15s ease; }
tr.sec.closed .bg-chev { transform: rotate(0); }
.bg-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.bg-wrap .head { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.bg-wrap .scroll { overflow-x: auto; }
.bg-fin { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.bg-fin .k { font-size: 11px; color: var(--muted); line-height: 1.3; }
.bg-fin .v { font-size: 17px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--text); }
.bg-fin .v.red { color: var(--red); } .bg-fin .s { font-size: 11px; color: var(--red); margin-top: 2px; }
.bg-row { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--text-2); }
.bg-row .money { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.bg-vendors { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.bg-vcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.bg-vcard:hover { border-color: var(--line-2); box-shadow: var(--shadow-md); }
.bg-vcard .t { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bg-vcard .m { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.bg-vcard .nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.bg-vcard .nums div { font-size: 11px; color: var(--muted); } .bg-vcard .nums b { display: block; font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.bg-kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 12px; padding: 14px 16px; font-size: 13px; }
.bg-kv .k { color: var(--muted); font-size: 12px; }
.bg-contracts { display: flex; flex-direction: column; gap: 6px; }
.bg-contract { display: grid; grid-template-columns: minmax(0, 1fr) 110px 90px 28px; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 12px; }
.bg-contract .money { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.bg-enable { max-width: 560px; margin: 48px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; display: flex; flex-direction: column; gap: 14px; }
.bg-enable h2 { margin: 0; font-size: 18px; }
.bg-enable ul { margin: 0; padding-left: 18px; color: var(--text-2); line-height: 1.8; }
.dialog.form .body .grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
/* ---- 第 2 期：招标 / 变更 / 付款 ---- */
.bg-rank { width: 22px; height: 22px; border-radius: 11px; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); font-weight: 600; }
.bg-rank.one { background: var(--primary); color: #fff; border-color: var(--primary); }
table.bg tr.win td { background: var(--bg); }
.bg-pk h3 .n { gap: 8px; }
.bg-cohd, .bg-co { display: grid; grid-template-columns: minmax(0, 1.6fr) 130px 110px 100px minmax(0, 1fr) 120px 230px; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.bg-cohd { background: var(--bg); font-size: 11px; color: var(--muted); font-weight: 600; padding: 8px 16px; }
.bg-co { cursor: pointer; } .bg-co:hover { background: var(--bg); }
.bg-co .t { font-size: 13px; font-weight: 500; line-height: 1.4; }
.bg-co .m, .bg-pay .m { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.bg-co .money, .bg-pay .money { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14px; }
.bg-co .money.green { color: var(--green); }
.bg-co .bd, .bg-pay .bd { margin-left: 0; }
.bg-payhd, .bg-pay { display: grid; grid-template-columns: 90px minmax(0, 1.5fr) minmax(0, 1fr) 110px 120px 120px 190px; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.bg-payhd { background: var(--bg); font-size: 11px; color: var(--muted); font-weight: 600; padding: 8px 16px; }
.bg-pay { cursor: pointer; } .bg-pay:hover { background: var(--bg); }
.bg-pay .t { font-weight: 500; }
.bg-lg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-left: 10px; }
.bg-lg i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.bg-cf { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(80px, 1fr); gap: 16px; padding: 16px; align-items: end; overflow-x: auto; }
.bg-cf .bar { display: flex; flex-direction: column; gap: 6px; }
.bg-cf .col { display: flex; gap: 4px; align-items: flex-end; height: 140px; }
.bg-cf .p { flex: 1; background: #cbd5e1; border-radius: 3px 3px 0 0; min-height: 2px; }
.bg-cf .a { flex: 1; background: var(--primary); border-radius: 3px 3px 0 0; }
.bg-cf .lb { font-size: 11px; color: var(--muted); text-align: center; }
.bg-cf .amt { font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.kpi .s .red { color: var(--red); }
@media (max-width: 1280px) { .bg-cohd, .bg-co { grid-template-columns: minmax(0, 1.6fr) 110px 100px 90px minmax(0, 1fr) 110px 200px; } }
/* ---- 第 3 期：导入向导、附件 ---- */
.bg-kpi3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bg-kpi3 > div { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.bg-kpi3 .k { font-size: 11px; color: var(--muted); } .bg-kpi3 .v { font-size: 20px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bg-ol { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-variant-numeric: tabular-nums; }
.bg-ol-sec { display: grid; grid-template-columns: 16px minmax(0, 1fr) 56px 110px; gap: 8px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; background: var(--surface); }
.bg-ol-sec:hover { background: var(--bg); }
.bg-ol-sec .n, .bg-ol-grp .n { color: var(--muted); font-size: 12px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bg-ol-sec .money, .bg-ol-grp .money { text-align: right; font-weight: 600; }
.bg-ol-sec select { justify-self: start; max-width: 100%; }
.bg-ol-sec:has(select) { grid-template-columns: 16px minmax(0, 1fr) minmax(0, 1fr) 56px 110px; }
.bg-ol-grp { display: grid; grid-template-columns: 16px minmax(0, 1fr) 56px 110px 44px; gap: 8px; align-items: center; padding: 7px 12px 7px 36px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--text-2); border-left: 3px solid transparent; cursor: pointer; }
.bg-ol-grp.hd { color: var(--muted); cursor: default; padding-left: 24px; }
.bg-ol-grp.line { padding-left: 44px; }
.bg-ol-grp:hover { background: var(--bg); } .bg-ol-grp.sel { border-left-color: var(--accent); background: var(--bg); }
.bg-ol-grp.off { opacity: .45; text-decoration: line-through; }
.bg-ol-grp .x { height: 22px; padding: 0 6px; font-size: 11px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--muted); cursor: pointer; }
.bg-ol-grp .x:hover { color: var(--text); border-color: var(--line-2); }
.bg-ol .chev { display: inline-block; width: 0; height: 0; border-left: 5px solid var(--muted); border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.bg-ol .chev.open { transform: rotate(90deg); }
.bg-q { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 12px; margin-bottom: 6px; }
.bg-q .dot { width: 6px; height: 6px; border-radius: 3px; background: var(--amber); margin-top: 6px; flex-shrink: 0; }
.bg-pages { flex: 1; overflow: auto; background: var(--line); padding: 16px; }
.bg-page { position: relative; background: var(--surface); box-shadow: 0 2px 8px rgba(15, 23, 42, .18); margin: 0 auto 16px; max-width: 1100px; }
.bg-page img { display: block; width: 100%; height: auto; }
.bg-mk { position: absolute; left: 5.2%; width: 3px; border-radius: 1px; background: var(--accent); }
.bg-hl { position: absolute; left: 6.4%; width: 81.6%; border-radius: 2px; background: transparent; pointer-events: none; }
.bg-hl.on { background: rgba(3, 105, 161, .12); outline: 2px solid var(--accent); }
.bg-tabs { display: flex; gap: 2px; background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 12px; flex-shrink: 0; overflow-x: auto; }
.bg-tabs button { height: 34px; border: none; border-bottom: 2px solid transparent; background: none; color: var(--muted); padding: 0 12px; font-size: 12px; border-radius: 0; white-space: nowrap; }
.bg-tabs button.on { color: var(--text); font-weight: 600; border-bottom-color: var(--primary); }
.bg-grid-wrap { flex: 1; overflow: auto; background: var(--surface); }
table.bg-xl { border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; table-layout: fixed; width: 100%; }
table.bg-xl th { background: var(--bg); color: var(--muted-2); font-weight: 400; border: 1px solid var(--line); padding: 2px 6px; text-align: center; font-size: 11px; position: sticky; top: 0; }
table.bg-xl td { border: 1px solid #eef2f7; padding: 0 6px; white-space: nowrap; height: 24px; overflow: hidden; text-overflow: ellipsis; position: relative; }
table.bg-xl td.rn { color: var(--muted-2); text-align: center; background: var(--bg); font-size: 11px; padding: 0; }
table.bg-xl td.n { text-align: right; }
table.bg-xl td.k { padding-left: 9px; } table.bg-xl td.k::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 3px; border-radius: 1px; background: var(--accent); }
table.bg-xl tr.hl td { background: rgba(3, 105, 161, .10); } table.bg-xl tr.hl td.rn { background: var(--accent); color: #fff; }
.bg-files { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bg-file { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 6px; padding: 2px 4px 2px 8px; font-size: 12px; background: var(--surface); }
.bg-file .x { border: none; background: none; color: var(--muted-2); cursor: pointer; width: 18px; height: 18px; border-radius: 4px; padding: 0; font-size: 14px; line-height: 1; }
.bg-file .x:hover { background: var(--red-soft); color: var(--red); }
.bg-upload { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border: 1px dashed var(--line-2); border-radius: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.bg-upload:hover { color: var(--text); border-color: var(--primary); }
.bg-imp { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.bg-imp > div:first-child { flex: 1; min-width: 0; }
#bgw-left .body > * { flex-shrink: 0; }   /* 纵向 flex 里 overflow:hidden 的块会被压扁裁掉内容：大纲、提醒都整块显示，整栏滚动 */
.bg-ol-grp.has-sel { grid-template-columns: 16px minmax(0, 1fr) minmax(150px, .7fr) 110px 44px; }
.bg-ol-grp.has-sel select { max-width: 100%; }
