/* 大客户返单（/#mgmt-reorder）。底子用经营数据共用的 mgmt.css（mg-app / mg-bar / mg-table），这里只补列表、右侧面板和填写格。
   颜色只用 tokens.css 变量（UI 门禁）；状态色：bad 红 / warn 黄 / good 绿 / info 蓝 / muted 灰。 */
[hidden] { display: none !important; }

.rd-bar { gap: 8px; }
.rd-ctl { height: 32px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-primary);
  padding: 0 10px; font: inherit; font-size: 13px; }
input.rd-ctl { width: 180px; }
.rd-sum { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--text-secondary); }
.rd-scope { color: var(--text-primary); font-weight: 600; }

/* 小标签：状态色 */
.rd-pill { display: inline-block; border-radius: var(--radius-full); padding: 1px 8px; font-size: 12px; line-height: 18px; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface-sunken); color: var(--text-secondary); }
.rd-pill.bad { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-fg); }
.rd-pill.warn { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-fg); }
.rd-pill.good { background: var(--success-bg); border-color: var(--success-border); color: var(--success-fg); }
.rd-pill.info { background: var(--info-bg); border-color: var(--info-border); color: var(--info-fg); }
.rd-tag { display: inline-block; margin-left: 6px; font-size: 11px; color: var(--warning-fg); border: 1px dashed var(--warning-border);
  border-radius: 6px; padding: 0 5px; white-space: nowrap; }
.rd-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--text-disabled); flex: none; }
.rd-dot.lv-bad, .rd-mix i.lv-bad { background: var(--danger-fg); }
.rd-dot.lv-warn, .rd-mix i.lv-warn { background: var(--warning-fg); }
.rd-dot.lv-good, .rd-mix i.lv-good { background: var(--success-fg); }
.rd-dot.lv-info, .rd-mix i.lv-info { background: var(--info-fg); }
.rd-mix i.lv-muted { background: var(--border-strong); }

/* 客户列表：表头吸在筛选条下面（top 由 JS 量条高后写上）；不包 overflow，免得 sticky 失效 */
.rd-list { table-layout: fixed; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.rd-list th { position: sticky; z-index: 5; }
.rd-list th.rd-sort { cursor: pointer; }
.rd-list th.rd-sort:hover, .rd-list th.on { color: var(--accent); }
.rd-list th:nth-child(1) { width: 40px; }
.rd-list th:nth-child(2) { width: 22%; }
.rd-list th:nth-child(3) { width: 72px; }
.rd-list th:nth-child(4) { width: 84px; }
.rd-list th:nth-child(5) { width: 130px; }
.rd-list th:nth-child(6) { width: 118px; }
.rd-list th:nth-child(7) { width: 170px; }
.rd-list th:nth-child(8) { width: 84px; }
.rd-list td { height: 44px; vertical-align: middle; }
.rd-list td small { display: block; margin: 2px 0 0; font-size: 11px; color: var(--text-muted); }
.rd-list td .rd-pill.rd-late { display: table; margin-top: 2px; }
.rd-list tr.sel td { background: var(--surface-selected); }
.rd-rank { color: var(--text-muted); }
.rd-name b { font-weight: 600; }
.rd-name small { margin: 0; }
.rd-mix { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 1px; background: var(--surface-sunken); }
.rd-mix i { display: block; min-width: 3px; }
.rd-head1 { font-size: 12px; color: var(--text-secondary); }

/* 右侧面板：宽（型号表列多），盖在列表上；z 高过吸顶条和表头 */
.rd-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(1240px, 96vw); background: var(--surface); z-index: 30;
  border-left: 1px solid var(--border); box-shadow: var(--shadow-3); overflow-y: auto; }
.rd-ph { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; }
.rd-ph-t { flex: 1 1 auto; min-width: 0; }
.rd-ph h2 { margin: 0; font-size: 18px; }
.rd-p-meta { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.rd-x { flex: none; border: 0; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; color: var(--text-muted); padding: 2px 6px; }
.rd-x:hover { color: var(--text-primary); }
.rd-pb { padding: 10px 16px 40px; display: flex; flex-direction: column; gap: 10px; }
.rd-headline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.6; }
.rd-headline li { display: flex; align-items: baseline; }
.rd-rounds { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; }
.rd-lbl { color: var(--text-muted); margin-right: 2px; }
.rd-round { border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rd-chips { display: flex; gap: 6px; flex-wrap: wrap; position: sticky; top: 58px; z-index: 2; background: var(--surface); padding: 4px 0; }
.rd-chips button { border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); border-radius: var(--radius-full);
  padding: 3px 12px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.rd-chips button.on { background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); }

/* 客户资料（老板 10-08：「他的设备官网……看看他们卖的是什么产品」）：官网 / 社媒链接 + 来源小签、一项一格的资料、备注折叠 */
.rd-prof { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.rd-prof-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rd-prof-h small { color: var(--text-muted); font-size: 12px; }
.rd-prof-h .rd-mini { margin-left: auto; }
.rd-prof-err { color: var(--warning-fg); font-size: 12px; }
.rd-prof-row { display: flex; gap: 10px; align-items: flex-start; }
.rd-prof-row > .rd-lbl { flex: none; width: 56px; color: var(--text-muted); font-size: 12px; line-height: 24px; }
.rd-sites { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; min-width: 0; }
.rd-site { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.rd-site a { color: var(--accent); text-decoration: none; font-weight: 600; }
.rd-site a:hover { text-decoration: underline; }
.rd-src { font-style: normal; font-size: 11px; color: var(--text-muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; line-height: 16px; }
.rd-src.warn { color: var(--warning-fg); border-color: var(--warning-border); background: var(--warning-bg); }
.rd-site-x { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 14px; padding: 0 2px; line-height: 1; }
.rd-site-x:hover { color: var(--danger-fg); }
.rd-site-add { display: inline-flex; gap: 4px; align-items: center; }
.rd-site-add input { height: 26px; width: 200px; border: 1px solid var(--border-control); border-radius: 6px; padding: 0 8px; font: inherit; font-size: 12px; background: var(--surface); color: var(--text-primary); }
.rd-mini { border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); border-radius: 6px; padding: 2px 10px; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.rd-mini:hover { border-color: var(--accent); color: var(--accent); }
.rd-muted { color: var(--text-muted); font-size: 12px; }
.rd-bad { color: var(--danger-fg) !important; }
.rd-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.rd-fact { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.rd-fact i { font-style: normal; color: var(--text-muted); font-size: 12px; margin-right: 4px; }
.rd-notes summary { cursor: pointer; color: var(--text-muted); font-size: 12px; width: max-content; }
.rd-note { margin-top: 6px; }
.rd-note i { font-style: normal; color: var(--text-muted); font-size: 11px; }
.rd-note p { margin: 2px 0 0; white-space: pre-wrap; line-height: 1.6; font-size: 12px; color: var(--text-secondary); max-height: 12em; overflow: auto; }

/* 网站动态（老板 10-08 点了「前 50 个客户每周自动比」）：每个网站一块，新上 / 下架 / 最近上架各一栏，前 8 条露出来、其余收起 */
.rd-web-site { border-top: 1px dashed var(--border); padding-top: 6px; }
.rd-web-site:first-of-type { border-top: 0; padding-top: 0; }
.rd-web-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rd-web-h a { color: var(--accent); text-decoration: none; font-weight: 600; }
.rd-web-h a:hover { text-decoration: underline; }
.rd-web-h small { color: var(--text-muted); font-size: 12px; }
.rd-web-list { margin-top: 4px; }
.rd-web-lt { font-size: 12px; color: var(--text-secondary); font-weight: 600; width: max-content; }
.rd-web-list ul { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rd-web-list li { display: flex; gap: 6px; align-items: baseline; font-size: 12px; line-height: 1.6; min-width: 0; }
.rd-web-list li a { color: var(--text-primary); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.rd-web-list li a:hover { color: var(--accent); text-decoration: underline; }
.rd-web-list li small { color: var(--text-muted); white-space: nowrap; }
.rd-web-list details summary { cursor: pointer; color: var(--text-muted); font-size: 12px; width: max-content; margin-top: 2px; }

/* 型号表 */
.rd-mt { table-layout: fixed; }
.rd-mt col.c-img { width: 52px; }
.rd-mt col.c-st { width: 108px; }
.rd-mt col.c-model { width: 160px; }
.rd-mt col.c-hist { width: 440px; }     /* 实际宽度 JS 按面板宽写在 col 上 */
.rd-mt col.c-amt { width: 84px; }
.rd-mt td { vertical-align: top; white-space: normal; max-width: none; overflow: visible; }
.rd-mt td small { display: block; margin: 2px 0 0; font-size: 11px; color: var(--text-muted); line-height: 1.5; }
.rd-mt tr td:first-child { box-shadow: inset 3px 0 0 var(--border); }
.rd-mt tr.lv-bad td:first-child { box-shadow: inset 3px 0 0 var(--danger-fg); }
.rd-mt tr.lv-warn td:first-child { box-shadow: inset 3px 0 0 var(--warning-fg); }
.rd-mt tr.lv-good td:first-child { box-shadow: inset 3px 0 0 var(--success-fg); }
.rd-mt tr.lv-info td:first-child { box-shadow: inset 3px 0 0 var(--info-fg); }
.rd-img img { width: 44px; height: 44px; object-fit: contain; border-radius: 6px; background: var(--surface-sunken); display: block; }
.rd-adv { margin-top: 4px !important; }
.rd-mt .rd-pill { white-space: normal; }
.rd-model b { display: block; word-break: break-all; }
.rd-model span { display: block; color: var(--text-secondary); }
.rd-hist > span { display: block; white-space: nowrap; font-size: 12px; margin-bottom: 2px; }
.rd-hist > span small { display: inline; margin: 0 0 0 6px; }
.rd-mt thead th { position: sticky; z-index: 2; }
.rd-tlh { padding-bottom: 2px !important; }
.rd-tlh-t { display: block; }

/* 下单时间轴（老板 10-08：「弄个甘特图……什么时候交货，对应的品就是什么时候交的货」）：每行同一把尺子。
   10-08 晚第二版（老板：「你那个绿色的球看得不是很清……数量还有金额能不能写下」）：原来的 seq-3 #2B8761 点落在「最近三轮」的浅绿底上糊成一片，
   点改 --chart-seq-4 #10553C（白底对比约 9:1）、一样大，最近三轮的底改灰 --surface-sunken；点旁边三行字：哪年哪月（灰）/ 几台（粗黑）/ 多少钱。
   同类别的型号 = --chart-2 蓝（空心，形状也不同，不只靠颜色）；预计下次是状态色（红 / 黄 / 绿），字里写着「预计 + 哪月」。
   竖线 / 底线都是实线细线（不画虚线网格）；唯一的虚线是「预计」那一段（虚线 = 推测的，本来就是这个意思）。 */
svg.tl { display: block; overflow: visible; }
.tl-win { fill: var(--surface-sunken); }
.tl-round { stroke: var(--chart-grid); stroke-width: 1; }
.tl-round-h { stroke: var(--chart-axis); stroke-width: 1.5; }
.tl-today { stroke: var(--chart-zero); stroke-width: 1; }
.tl-base, .tl-tick { stroke: var(--chart-axis); stroke-width: 1; }
.tl-yr, .tl-now, .tl-mo { fill: var(--text-muted); font-size: 10px; font-family: var(--font-sans); font-weight: 400; }
.tl-yr { fill: var(--text-secondary); font-weight: 600; }
.tl-now { text-anchor: middle; fill: var(--text-secondary); }
.tl-span { stroke: var(--chart-seq-3); stroke-opacity: .45; stroke-width: 2; stroke-linecap: round; }
.tl-dot { fill: var(--chart-seq-4); stroke: var(--surface); stroke-width: 1.5; }
.tl-l { font-family: var(--font-sans); font-variant-numeric: tabular-nums; text-anchor: middle;
  paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }      /* 白边衬字：竖线、灰底穿过也看得清 */
.tl-lm { fill: var(--text-muted); font-size: 10px; }
.tl-lq { fill: var(--text-primary); font-size: 11px; font-weight: 700; }
.tl-la { fill: var(--text-secondary); font-size: 10.5px; }
.tl-ld.bad { fill: var(--danger-fg); }
.tl-ld.warn { fill: var(--warning-fg); }
.tl-ld.good { fill: var(--success-fg); }
.tl-rel { fill: var(--surface); stroke: var(--chart-2); stroke-width: 2; }
.tl-due { fill: var(--surface); stroke-width: 2; }
.tl-dash { fill: none; stroke-width: 1.5; stroke-dasharray: 3 3; }
.tl-more { fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tl-due.bad, .tl-dash.bad, .tl-more.bad { stroke: var(--danger-fg); }
.tl-due.warn, .tl-dash.warn, .tl-more.warn { stroke: var(--warning-fg); }
.tl-due.good, .tl-dash.good, .tl-more.good { stroke: var(--success-fg); }
.tl-hitbox { fill: transparent; }
.tl-hit { cursor: default; }
.rd-mt td small.tl-lost { margin-top: 0; }
.tl-hit:hover .tl-dot, .tl-hit:hover .tl-rel, .tl-hit:hover .tl-due { stroke: var(--text-primary); }
.tl-hit:hover .tl-lq { fill: var(--accent); }
.rd-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: 12px; color: var(--text-secondary); }
.rd-legend span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.rd-legend svg { display: block; overflow: visible; }
.rd-legend .rd-dot { margin-right: 0; }

/* 「为什么这么判」里的日期上色（后端给哪段、什么色）：红 = 要当心、黄 = 快到 / 该去看、绿 = 还早、蓝 = 换代 */
mark.rd-hl { border-radius: 3px; padding: 0 2px; font-weight: 600; }
mark.rd-hl.bad { background: var(--danger-bg); color: var(--danger-fg); }
mark.rd-hl.warn { background: var(--warning-bg); color: var(--warning-fg); }
mark.rd-hl.good { background: var(--success-bg); color: var(--success-fg); }
mark.rd-hl.info { background: var(--info-bg); color: var(--info-fg); }
.rd-list small.rd-next.lv-warn { color: var(--warning-fg); font-weight: 600; }
.rd-why { font-size: 12px; line-height: 1.6; color: var(--text-secondary); }

@media (max-width: 1100px) {
  .rd-list th:nth-child(9), .rd-list td:nth-child(9) { display: none; }
}
@media (max-width: 900px) {
  #rd-main { overflow-x: auto; }
  .rd-list { min-width: 1000px; }
  .rd-chips { top: 0; position: static; }
  /* 窄窗口：型号表列多，放不下就在自己的框里横着滑，别把「为什么」挤成一个字宽 */
  .rd-mtw { overflow-x: auto; }
  .rd-mt { min-width: 940px; }
}
@media (max-width: 640px) {
  input.rd-ctl, .rd-ctl { font-size: 16px; }
  .rd-panel { width: 100vw; }
}
/* 网站动态旁「看主图和价格 →」（10-09，跳大客户动态） */
.rd-web-go { margin-left: auto; font-size: 12px; color: var(--accent); text-decoration: none; white-space: nowrap; }
.rd-web-go:hover { text-decoration: underline; }
