/* 字段分组（people/fields.html，10-17）。前缀 fc-；表格、圆点、保存条借 roles.css（rp-）和 shared/perm-edit.css（pe-）。
 * 颜色纪律同 people.css：只用 tokens.css 的语义 token，不许裸十六进制、不许 :root。 */

/* ---------- 左：按组数 ---------- */
.fc-side { padding-bottom: var(--sp-2); }
.fc-g {
  display: grid; grid-template-columns: 12px 1fr auto; gap: 2px 10px; align-items: center; width: 100%;
  padding: 8px var(--sp-4); border: 0; border-bottom: 1px solid var(--border-subtle); background: var(--surface);
  font: inherit; text-align: left; cursor: pointer; color: var(--text-primary);
}
.fc-g:hover:not(:disabled) { background: var(--surface-hover); }
.fc-g.on { background: var(--surface-selected); box-shadow: inset 3px 0 0 var(--accent); }
.fc-g:disabled { cursor: default; color: var(--text-muted); }
.fc-g i { width: 12px; height: 12px; border-radius: 3px; }
.fc-g i.fc-all { background: linear-gradient(90deg, var(--chart-1), var(--chart-2), var(--chart-3), var(--chart-4), var(--chart-5), var(--chart-6)); }
.fc-g b { font-weight: 600; font-size: var(--fs-sm); }
.fc-g em { font-style: normal; font-weight: 600; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.fc-g small { grid-column: 2 / 4; color: var(--text-muted); font-size: var(--fs-xs); line-height: 1.4; }
.fc-s { grid-template-columns: 1fr auto; }
.fc-s small { grid-column: 1 / 3; }
.fc-s.warn b, .fc-s.warn em { color: var(--danger-fg); }
.fc-s.warn:disabled b, .fc-s.warn:disabled em { color: var(--text-muted); }
.fc-chk { margin: 0; padding: 10px var(--sp-4) 4px; color: var(--text-secondary); font-size: var(--fs-xs); line-height: var(--lh-prose); }
.fc-chk small { color: var(--text-muted); }
.fc-chk .pe-lnk { margin-left: 4px; }

/* ---------- 右：工具条 ---------- */
.fc-panel .rp-tbar { gap: 10px; }
.fc-sel { height: 28px; max-width: 220px; border: 1px solid var(--border-control); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text-primary); font: inherit; font-size: var(--fs-xs); padding: 0 6px; }
.fc-chip { display: inline-flex; align-items: center; gap: 2px; padding: 1px 4px 1px 10px; border-radius: var(--radius-full);
  background: var(--accent-soft-bg); color: var(--accent-soft-fg); font-size: var(--fs-xs); font-weight: 600; }
.fc-sp { flex: 1; }
.fc-panel .rp-tbar .pe-lnk + .pe-lnk { margin-left: 4px; }
.fc-how { margin: 0; padding: 8px var(--sp-4); color: var(--text-secondary); font-size: var(--fs-xs); line-height: var(--lh-prose); border-bottom: 1px solid var(--border-subtle); }
.fc-how b { color: var(--text-primary); font-weight: 600; }

/* ---------- 右：表 ---------- */
.fc-wrap { overflow-x: auto; }
.fc-rt { min-width: 980px; }
.fc-rt .pe-rc { width: 62px; }
.fc-rt th.fc-gh { border-bottom-width: 3px; }
.fc-rt th.fc-progress { border-bottom-color: var(--chart-1); }
.fc-rt th.fc-product { border-bottom-color: var(--chart-2); }
.fc-rt th.fc-customer { border-bottom-color: var(--chart-3); }
.fc-rt th.fc-sale { border-bottom-color: var(--chart-4); }
.fc-rt th.fc-cost { border-bottom-color: var(--chart-5); }
.fc-rt th.fc-factory { border-bottom-color: var(--chart-6); }
.fc-rt th.fc-none { border-bottom-color: var(--border-strong); }
.fc-rt th .pe-rh span { white-space: nowrap; }
.fc-rt th.fc-src, .fc-rt td.fc-src { width: 150px; white-space: nowrap; }
.fc-rt th.fc-cc, .fc-rt td.fc-cc { width: 140px; white-space: nowrap; }

/* 一张表一行 */
.fc-rt tr.fc-t td { background: var(--surface-sunken); height: 44px; border-bottom: 1px solid var(--border); }
.fc-rt tr.fc-t.open td { background: var(--accent-soft-bg); }
.fc-rt tr.fc-t.chg td.rp-nm { box-shadow: inset 3px 0 0 var(--warning-fg); }
.fc-tg { display: inline-flex; align-items: baseline; gap: 6px; border: 0; background: none; padding: 0; font: inherit; cursor: pointer; color: var(--text-primary); min-width: 180px; text-align: left; }
.fc-tg b { font-weight: 600; }
.fc-tg small { color: var(--text-muted); font-size: var(--fs-xs); }
.fc-ar { color: var(--text-muted); width: 10px; }
.fc-n { text-align: center; padding: 0 !important; border-left: 1px solid var(--border-subtle); }
.fc-cnt { min-width: 34px; height: 24px; padding: 0 8px; border: 1px solid var(--border-subtle); border-bottom-width: 3px; border-radius: var(--radius-sm);   /* 底边颜色 = 这一组的颜色（行内 style） */
  background: var(--surface); font: inherit; font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-primary); cursor: pointer; }
.fc-cnt:hover, .fc-cnt.on { border-top-color: var(--accent); border-left-color: var(--accent); border-right-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft-bg); }
.fc-cnt.on { background: var(--accent-soft-bg); }
.fc-z { color: var(--text-disabled); }
.fc-b { display: inline-block; padding: 0 7px; border-radius: var(--radius-full); background: var(--surface); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); font-size: 11px; line-height: 18px; white-space: nowrap; }
.fc-b.bad { color: var(--danger-fg); background: var(--danger-bg); border-color: var(--danger-border); font-weight: 600; }
.fc-b.chg { color: var(--warning-fg); background: var(--warning-bg); border-color: var(--warning-border); font-weight: 600; }
.fc-lock { color: var(--text-muted); font-size: var(--fs-xs); }

/* 一列一行 */
.fc-rt tr.fc-col td { height: 36px; }
.fc-rt td.fc-nm { padding-left: 34px; }
.fc-rt td.fc-nm span { display: inline-block; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.fc-rt td.fc-nm span em { font-style: normal; color: var(--text-muted); }
.fc-rt td.fc-nm small { display: inline; margin-left: 8px; }
.fc-rt tr.fc-col.bad td.fc-nm { box-shadow: inset 3px 0 0 var(--danger-fg); }
.fc-sc { display: inline-block; padding: 0 7px; border-radius: var(--radius-sm); font-size: 11px; line-height: 18px; font-weight: 600; margin-right: 6px; }
.fc-sc.auto, .fc-sc.none { background: var(--surface-sunken); color: var(--text-secondary); }
.fc-sc.manual { background: var(--info-bg); color: var(--info-fg); }
.fc-sc.lock { background: var(--surface-sunken); color: var(--text-muted); }
.fc-ck { font-size: var(--fs-xs); color: var(--text-muted); }
.fc-ck.bad { color: var(--danger-fg); font-weight: 600; }

@media (max-width: 900px) {
  .fc-panel { overflow-x: auto; }
}

/* 看数据（10-19 老板：「只看列名，怎么能调整对呢」）：列下面展开最新几条 / 搜 / 含工厂信息的行；表下面「看几行」 */
.fc-peekbtn, .fc-gridbtn { margin-left: 8px; font-size: var(--fs-xs); }
.fc-peekbtn.on, .fc-gridbtn.on { font-weight: 600; }
.fc-rt tr.fc-peekrow > td { background: var(--surface-sunken); padding: 10px var(--sp-4) 12px 34px; height: auto; }
.fc-peekbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.fc-peekbar .pe-btn { height: 26px; font-size: var(--fs-xs); }
.fc-peekbar .pe-btn.on { background: var(--accent-soft-bg); border-color: var(--accent); color: var(--accent-soft-fg); font-weight: 600; }
.fc-peekq { display: inline-flex; gap: 4px; }
.fc-peekq input { height: 26px; width: 280px; padding: 0 8px; border: 1px solid var(--border-control); border-radius: var(--radius-sm); font: inherit; font-size: var(--fs-xs); background: var(--surface); color: var(--text-primary); }
.fc-peekx { margin-left: auto; }
.fc-peeklist { margin: 0; padding-left: 22px; display: grid; gap: 4px; font-size: var(--fs-xs); }
.fc-peeklist li { line-height: 1.6; }
.fc-peeklist b { font-weight: 600; margin-right: 8px; color: var(--text-secondary); }
.fc-peeklist mark { background: var(--danger-bg); color: var(--danger-fg); font-weight: 600; border-radius: 2px; padding: 0 1px; }
.fc-grid { display: inline-block; max-width: 100%; overflow-x: auto; vertical-align: top; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--surface); }
.fc-grid table { border-collapse: collapse; font-size: var(--fs-xs); }
.fc-grid th, .fc-grid td { border-bottom: 1px solid var(--border-subtle); border-right: 1px solid var(--border-subtle); padding: 4px 8px; text-align: left; vertical-align: top; max-width: 220px; }
.fc-grid thead th { background: var(--surface-sunken); color: var(--text-secondary); white-space: nowrap; font-weight: 600; }
.fc-grid tbody th { white-space: nowrap; color: var(--text-secondary); font-weight: 600; }
.fc-grid th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface-sunken); }
.fc-grid .fc-gpick { background: var(--warning-bg); }
.fc-grid thead th.fc-gpick { color: var(--warning-fg); }
