/* ================= 「项目进度」样式 =================
   只加 .pg-* 与 .page-actions（后者 styles.css 未定义）。
   不改 styles.css / modules.css；深色场景用 body.app-mode 前缀。 */

.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.pg-note {
  color: rgba(203, 229, 232, .74);
  font-size: 12.5px;
  line-height: 1.7;
  margin-bottom: 14px;
}

.pg-card { margin-top: 16px; }

.pg-tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  font-size: 11px; color: rgba(255, 208, 132, .95);
  background: rgba(255, 190, 80, .14); border: 1px solid rgba(255, 190, 80, .3);
}

.pg-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }

/* ---------- KPI ---------- */
.pg-kpis {
  display: grid; gap: 12px; margin-top: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.pg-kpis-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 0; }
.pg-kpi {
  border-radius: 14px; padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: linear-gradient(135deg, rgba(255, 255, 255, .06), rgba(220, 249, 250, .02));
  box-shadow: inset 0 0 0 1px rgba(0, 24, 36, .05);
}
.pg-kpi-l { font-size: 12px; color: rgba(203, 229, 232, .66); margin-bottom: 6px; }
.pg-kpi-v { font-size: 20px; font-weight: 500; color: rgba(238, 252, 252, .95); font-variant-numeric: tabular-nums; }
.pg-kpi-s { font-size: 11.5px; color: rgba(203, 229, 232, .6); margin-top: 4px; }

/* 红=超支/涨价；绿=节省/降价（中国记账约定，不可反转） */
.pg-up { color: #ff8a8e; }
.pg-down { color: #5fd97a; }

/* ---------- 进度条 ---------- */
.pg-bar {
  position: relative; height: 7px; border-radius: 999px; margin-top: 8px;
  overflow: hidden; background: rgba(255, 255, 255, .12);
}
.pg-bar > span {
  position: absolute; top: 0; left: 0; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #35c9bd, #6fe3d6);
  transition: width .3s ease, left .3s ease;
}
/* 预采购段（黄色，接在已采购段右侧，半透明以与实色区分） */
.pg-bar-pre {
  background: linear-gradient(90deg, rgba(255, 201, 120, .95), rgba(255, 179, 71, .95)) !important;
}

/* ---------- 按大类分开算 ---------- */
.pg-groups {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(212px, 1fr));
  gap: 12px; margin-top: 12px;
}
.pg-group {
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px;
  padding: 10px 12px 8px; background: rgba(255, 255, 255, .04);
}
.pg-group.is-plain { border-style: dashed; opacity: .88; }
.pg-group-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.pg-group-name { font-weight: 650; font-size: 13.5px; }
.pg-group-cnt { font-size: 11px; opacity: .6; margin-left: auto; }
.pg-group-rows { display: flex; flex-direction: column; gap: 3px; }
.pg-group-rows > div { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.pg-group-rows > div > span { opacity: .66; }
.pg-group-rows > div > b { font-variant-numeric: tabular-nums; font-weight: 600; }
.pg-group .pg-bar { margin-top: 9px; }
.pg-group .pg-bar-txt { font-size: 11px; }
.pg-pre { color: #ffc978; font-weight: 600; }
.pg-bar-labor > span { background: linear-gradient(90deg, #6f9cff, #93b7ff); }
.pg-bar-txt { font-size: 11.5px; color: rgba(203, 229, 232, .7); margin-top: 4px; }

/* ---------- 板块 ---------- */
.pg-sec-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px;
}
.card-pad .pg-sec-head { padding: 0 0 12px; }
.pg-sec-head h3 { margin: 0; font-size: 15px; font-weight: 500; }
.pg-tbl { table-layout: auto; }
.pg-ops { white-space: nowrap; }
.pg-labor { margin-top: 16px; }

/* ---------- 材料表：分组表头 + 组分隔线 ---------- */
.pg-tbl thead th { vertical-align: middle; }
.pg-tbl thead tr:first-child th[colspan] {
  text-align: center; font-size: 12px; letter-spacing: .04em;
  color: rgba(226, 246, 248, .82);
}
.pg-tbl .pg-g { border-left: 1px solid rgba(255, 255, 255, .13); }
.pg-tbl thead th.pg-g { border-left: 1px solid rgba(255, 255, 255, .16); }

/* ---------- 顶部「预计最终总成本」宽卡（两块 + 合计） ---------- */
.pg-kpi-wide { grid-column: span 2; }
.pg-est { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 4px; }
.pg-est-part { border-left: 2px solid rgba(111, 225, 214, .5); padding-left: 10px; }
.pg-est-t { font-size: 12px; color: rgba(203, 229, 232, .68); margin-bottom: 4px; }
.pg-est-v { font-size: 18px; font-weight: 500; color: rgba(238, 252, 252, .95); font-variant-numeric: tabular-nums; }
.pg-est-total {
  margin-top: 12px; padding-top: 9px; border-top: 1px dashed rgba(255, 255, 255, .18);
  font-size: 12.5px; color: rgba(203, 229, 232, .74);
}
.pg-est-total b { font-size: 17px; font-weight: 500; color: rgba(238, 252, 252, .98); }

@media (max-width: 640px) {
  .pg-kpi-v { font-size: 18px; }
  .pg-toolbar .btn, .page-actions .btn { font-size: 12px; }
  .pg-kpi-wide { grid-column: span 1; }
  .pg-est { grid-template-columns: 1fr; gap: 10px; }
}
