/* ============================================================
 * 批 K K-3（2026-10-14）：红灯明细（S12）/ 红灯详情（S15）全站抽屉（public/js/redlight.js），四处入口的按钮条。
 * 单独一个文件（core-k-cockpit.css 只给经营总览）。只作用于 .rld（抽屉内容根，data-mod="off" 不分卡）和工作台那一行 .wk-rl；状态色同经营总览（严重红 / 较重橙 / 注意黄，必带文字）。
 * ============================================================ */
.rld {
  --kc-ok: #0ca30c; --kc-ok-bg: #e8f6e8; --kc-ok-tx: #0b8a0b;
  --kc-warn: #fab219; --kc-warn-bg: #fff4d6; --kc-warn-tx: #a76a00;
  --kc-hard: #ec835a; --kc-hard-bg: #fdebe3; --kc-hard-tx: #b4532a;
  --kc-bad: #d03b3b; --kc-bad-bg: #fdecec; --kc-bad-tx: #b42323;
  --rld-sunk: #f8fafc; --rld-border-2: #cbd5e1; --rld-brand-200: #bfdbfe;
  min-width: 0;
}
#drawer-root .drawer-bd:has(> .rld) { background: #fff; }
.drawer-hd h3 .rld-hsub { font-size: 12.5px; font-weight: 400; color: var(--text-3); margin-left: 10px; }
.rld .num { font-variant-numeric: tabular-nums; }
.rld .muted { color: var(--text-3); font-weight: 400; }
.rld .sp { flex: 1; }
.rld-link { color: var(--brand); font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.rld-link:hover { text-decoration: underline; }
.rld-none { font-size: 12.5px; color: var(--text-3); padding: 6px 2px 10px; }
.rld-note { font-size: 12px; color: var(--text-3); line-height: 1.6; margin: 4px 0 8px; }
.rld-warn { font-size: 12.5px; line-height: 1.6; padding: 8px 12px; border-radius: 8px; background: var(--kc-warn-bg); color: #6b4500; margin: 8px 0; }
/* S12 */
.rld-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.rld-tabs button { font: inherit; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--text-2); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.rld-tabs button b { font-weight: 650; color: var(--text); }
.rld-tabs button.on { background: var(--blue-bg); border-color: var(--rld-brand-200); color: var(--brand); }
.rld-tabs button.on b { color: var(--brand); }
.rld-tabs button:focus-visible, .rld-row:focus-visible, .rld-b:focus-visible, .rld-back:focus-visible { outline: 2px solid #93c5fd; outline-offset: 1px; }
.rld-gh { display: flex; align-items: center; gap: 8px; margin: 16px 0 6px; font-size: 13px; }
.rld-gh b { font-weight: 650; }
.rld-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.rld-row.go { cursor: pointer; }
.rld-row.go:hover { border-color: var(--rld-brand-200); background: #fbfdff; }
.rld-row .a { font-size: 13.5px; font-weight: 600; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.rld-row .b { font-size: 12px; color: var(--text-3); grid-column: 1 / 2; min-width: 0; overflow-wrap: anywhere; }
.rld-row .c { grid-row: 1 / 3; grid-column: 2; align-self: center; text-align: right; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.rld-row .c .kc-chip { margin-bottom: 4px; }
.rld-st { font-size: 12px; color: var(--text-2); }
.rld-tag { display: inline-block; font-size: 11px; color: var(--kc-warn-tx); background: var(--kc-warn-bg); border-radius: 4px; padding: 0 6px; margin-left: 6px; white-space: nowrap; }
.rld-eta { margin-top: 2px; color: var(--text-2); }
.rld-eta.late, .rld-late-tx { color: var(--kc-bad-tx); font-weight: 600; }
/* S15 */
.rld-back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; color: var(--brand); cursor: pointer; }
.rld-back svg { width: 14px; height: 14px; }
.rld-t { font-size: 17px; font-weight: 700; margin: 2px 0 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; overflow-wrap: anywhere; }
.rld-meta { font-size: 12px; color: var(--text-3); }
.rld-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; padding: 12px 14px; background: var(--rld-sunk); border: 1px solid var(--border); border-radius: 10px; margin: 12px 0; }
.rld-facts > div { font-size: 12px; color: var(--text-3); min-width: 0; }
.rld-facts b { display: block; font-size: 13.5px; color: var(--text); font-weight: 600; margin-top: 2px; overflow-wrap: anywhere; }
.rld-facts b.muted { color: var(--text-3); }
.rld-facts b.late { color: var(--kc-bad-tx); }
.rld-late { display: inline-block; font-size: 11px; font-weight: 600; color: var(--kc-bad-tx); background: var(--kc-bad-bg); border-radius: 4px; padding: 0 6px; margin-left: 6px; vertical-align: 1px; }
.rld-sec { font-size: 12.5px; color: var(--text-2); font-weight: 600; margin: 14px 0 4px; }
.rld-sec-tl { margin-top: 18px; }
.rld-who { display: flex; align-items: center; gap: 10px; padding: 8px 0 4px; }
.rld-who .av { width: 34px; height: 34px; border-radius: 50%; background: var(--blue-bg); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: 0 0 auto; }
.rld-who .n { font-size: 14px; font-weight: 650; }
.rld-who .r { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.rld-acts { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; margin: 12px 0 6px; }
.rld-acts.two { grid-template-columns: 1fr auto; }
.rld-acts.one { grid-template-columns: auto; justify-content: start; }
.rld-b { height: 40px; border-radius: 9px; font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 14px; white-space: nowrap; }
.rld-b svg { width: 15px; height: 15px; }
.rld-b.rem { background: #fff; border: 1px solid var(--rld-brand-200); color: var(--brand); }
.rld-b.urg { background: var(--kc-bad); border: 1px solid var(--kc-bad); color: #fff; }
.rld-b.rep { background: var(--kc-ok); border: 1px solid var(--kc-ok); color: #fff; }
.rld-b.open { background: #fff; border: 1px solid var(--border); color: var(--text-2); }
.rld-b.on { box-shadow: 0 0 0 3px rgba(59, 130, 246, .18); }
.rld-b:disabled { opacity: .45; cursor: not-allowed; }
.rld-compose { border: 1px solid var(--rld-border-2); border-radius: 10px; margin-top: 12px; overflow: hidden; background: #fff; }
.rld-compose .hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 12px; background: var(--rld-sunk); border-bottom: 1px solid var(--border); font-size: 12.5px; }
.rld-compose .hd .muted { font-size: 12px; }
.rld-chip { display: inline-block; max-width: 100%; line-height: 1.5; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--border); }
.rld-chip > .no-i18n { white-space: nowrap; }
.rld-chip.cc { border-style: dashed; color: var(--text-2); }
.rld-chip a { cursor: pointer; color: var(--text-3); padding: 0 2px; }
.rld-ccsel { font: inherit; font-size: 12px; border: 1px dashed var(--rld-border-2); border-radius: 999px; padding: 1px 6px; background: #fff; color: var(--text-2); max-width: 140px; }
.rld-compose textarea { display: block; width: 100%; border: 0; resize: vertical; padding: 10px 12px; font: inherit; font-size: 13px; line-height: 1.6; min-height: 84px; outline: none; color: var(--text); box-sizing: border-box; }
.rld-compose .ft { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; padding: 8px 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.rld-compose .ft .tx { flex: 1 1 220px; min-width: 0; line-height: 1.5; }
.rld-compose .ft .bt { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; flex: 0 0 auto; }
.rld-send { background: var(--kc-bad); color: #fff; border: 0; border-radius: 7px; padding: 6px 14px; font: inherit; font-weight: 650; font-size: 13px; cursor: pointer; }
.rld-send.soft { background: var(--brand); }
.rld-send.ok { background: var(--kc-ok); }
.rld-send:disabled { opacity: .5; }
.rld-eta-in { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.rld-eta-in input { font: inherit; font-size: 12.5px; }
.rld-tl { list-style: none; margin: 8px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); }
.rld-tl li { position: relative; padding: 0 0 14px 12px; font-size: 13px; }
.rld-tl li::before { content: ""; position: absolute; left: -20px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--rld-border-2); }
.rld-tl li.u::before { border-color: var(--kc-bad); }
.rld-tl li.r::before { border-color: var(--kc-ok); }
.rld-tl li.p::before, .rld-tl li.s::before { border-color: #3b82f6; }
.rld-tl .t { font-size: 11.5px; color: var(--text-3); }
.rld-tl .m { margin-top: 3px; font-size: 12px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rld-tl .q { margin-top: 4px; background: var(--kc-ok-bg); color: #14532d; border-radius: 8px; padding: 7px 10px; font-size: 12.5px; white-space: pre-wrap; }
/* 入口：抽屉里一条 / 列表行上的按钮 */
.rld-entry { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border: 1px solid #f5c2c2; background: #fff7f7; border-radius: 10px; margin: 0 0 10px; font-size: 12.5px; color: var(--text-2); }
.rld-entry .btn { white-space: nowrap; }
.rld-rowacts { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-left: 6px; vertical-align: middle; }
/* 窄屏（手机 390）：抽屉整宽、信息格两列、按钮换行 */
@media (max-width: 767px) {
  #drawer-root .drawer:has(.rld) { left: 8px; right: 8px; top: 8px; bottom: 8px; width: auto !important; min-width: 0 !important; max-width: none !important; border-radius: 14px; }
  .rld-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rld-acts, .rld-acts.two { grid-template-columns: 1fr 1fr; }
  .rld-acts .rld-b.open { grid-column: 1 / -1; }
  .rld-b { font-size: 13.5px; padding: 0 10px; }
  .drawer-hd h3 .rld-hsub { display: block; margin: 2px 0 0; }
}
/* K-Q5：我的工作台右栏「待我处理」标题下「红灯 N 条 · 严重 M」（只给能看经营总览的人，数 = 菜单红点） */
.wk-rl { display: flex; align-items: center; gap: 6px; margin: 0 16px 10px; padding: 6px 10px; border-radius: 8px; background: #f8fafc; border: 1px solid var(--border); color: var(--text-2); font-size: 12.5px; cursor: pointer; }
.wk-rl[hidden] { display: none; }
.wk-rl.bad { background: #fff7f7; border-color: #f5c2c2; color: #b42323; }
.wk-rl span { flex: 1; min-width: 0; }
.wk-rl:hover { filter: brightness(.98); }
.wk-rl:focus-visible { outline: 2px solid #93c5fd; outline-offset: 1px; }
/* 批 V18 V18-33 D（审核方 #365 第三节第 14 张）：红灯那一排（Redlight.rowActs 填的 Core.U.actions 行内）放不下时整个按钮换行（规则 5）；
 * 经营总览「应收已逾期」抽屉那一格（带 data-rl-o360 的占位）至少放得下中文的一排「去 360 + 一键催办 +「⋯」」，俄文放不下时换到第二行，不被抽屉右边切掉 */
.rld-rowacts .u-row-acts { flex-wrap: wrap; }
td:has(> [data-rl-o360]) { min-width: 244px; }
