/* 经营看板（board-ext.js）；基础样式复用 /assets/ai/ai-ext.css 的 .ai-* */
.bd-page { --up: #e5484d; --down: #30a46c; }
.bd-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.bd-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.bd-title h3 { margin: 0; font-size: 20px; }
.bd-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bd-rsel { min-width: 140px; }
.bd-seg { display: inline-flex; border: 1px solid var(--el-border-color, #dcdfe6); border-radius: 4px; overflow: hidden; }
.bd-seg span { padding: 0 14px; height: 30px; line-height: 30px; cursor: pointer; font-size: 13px; color: var(--tx2); background: var(--bg); }
.bd-seg span + span { border-left: 1px solid var(--el-border-color, #dcdfe6); }
.bd-seg span.on { background: var(--p); color: #fff; }
.bd-seg.sm span { height: 24px; line-height: 24px; padding: 0 10px; font-size: 12px; }
.bd-body { transition: opacity .2s; }
.bd-body.bd-dim { opacity: .5; pointer-events: none; }
.bd-scope { font-size: 14px; font-weight: 600; margin: 0 0 12px; display: flex; align-items: center; flex-wrap: wrap; }
.bd-scope .ai-muted { font-weight: 400; }

.bd-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
@media (max-width: 1100px) { .bd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bd-kpi { background: var(--bg); border-radius: 8px; padding: 16px 18px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.bd-kpi .l { color: var(--tx2); font-size: 13px; }
.bd-kpi .v { font-size: 30px; font-weight: 600; margin: 6px 0 8px; font-variant-numeric: tabular-nums; }
.bd-kpi .v small, .bd-di .v small { font-size: 13px; font-weight: 400; color: var(--tx2); margin-left: 4px; }
.bd-kpi .cmp { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; min-height: 20px; }

.bd-dl { display: inline-block; font-size: 12px; padding: 1px 6px; border-radius: 3px; white-space: nowrap; background: var(--el-fill-color-light, #f5f7fa); color: var(--tx2); }
.bd-dl.up { color: var(--up); background: rgba(229,72,77,.08); }
.bd-dl.down { color: var(--down); background: rgba(48,164,108,.08); }

.bd-card .bd-ch { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.bd-card .bd-ch h3 { margin: 0; }
.bd-grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.bd-grid2 > .ai-card { margin-bottom: 16px; }
/* 并排的两张卡：说明固定放标题下面并留两行高，环形图才能左右对齐 */
.bd-grid2 .bd-card .bd-ch { flex-direction: column; align-items: flex-start; gap: 4px; flex-wrap: nowrap; }
.bd-grid2 .bd-card .bd-ch .ai-muted { line-height: 20px; min-height: 40px; }
.bd-grid2 .bd-dwrap { min-height: 190px; }
@media (max-width: 1200px) { .bd-grid2 { grid-template-columns: minmax(0, 1fr); } }

.bd-svg { width: 100%; height: 260px; display: block; }
.bd-grid { stroke: var(--el-border-color-lighter, #ebeef5); stroke-width: 1; }
.bd-ax { font-size: 11px; fill: var(--tx2); }
.bd-bar rect:not(.bd-hit) { fill: var(--p); opacity: .85; }
.bd-bar:hover rect:not(.bd-hit) { opacity: 1; }
.bd-hit { fill: transparent; }
.bd-bar:hover .bd-hit { fill: rgba(64,158,255,.06); }
.bd-bar rect.bd-yoy:not(.bd-hit) { fill: #eab308; }
.bd-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--tx2); margin-left: 14px; }
.bd-legend i { display: inline-block; width: 12px; height: 8px; margin-left: 8px; }
.bd-legend i.b { background: var(--p); } .bd-legend i.l { background: #eab308; }

.bd-bars { display: flex; flex-direction: column; gap: 2px; max-height: 318px; overflow-y: auto; padding-right: 4px; } /* 正好 10 行，多的滚动 */
.bd-bl { display: grid; grid-template-columns: 22px minmax(70px, 120px) minmax(60px, 1fr) 76px 46px 88px; align-items: center; gap: 8px; height: 30px; flex: none; padding: 0 6px; border-radius: 4px; font-size: 13px; }
.bd-bl.clk { cursor: pointer; } .bd-bl.clk:hover { background: var(--pl); }
.bd-bl.on { background: var(--pl); outline: 1px solid var(--p); }
.bd-rk { width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 50%; font-size: 11px; background: var(--el-fill-color-light, #f5f7fa); color: var(--tx2); }
.bd-rk.top { background: var(--p); color: #fff; }
.bd-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-track { height: 10px; background: var(--pl, #ecf5ff); border-radius: 5px; overflow: hidden; }
.bd-track i { display: block; height: 100%; background: var(--p); border-radius: 5px; }
.bd-val { text-align: right; font-variant-numeric: tabular-nums; }
.bd-sh { text-align: right; color: var(--tx2); font-size: 12px; }
.bd-sub { color: var(--tx2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bd-dwrap { display: flex; align-items: center; gap: 18px; margin-bottom: 10px; flex-wrap: wrap; }
.bd-donut { width: 150px; height: 150px; flex: none; }
.bd-ring { fill: none; stroke: var(--pl, #ecf5ff); stroke-width: 22; }
.bd-donut circle:hover { stroke-width: 26; }
.bd-dc1 { font-size: 22px; font-weight: 600; fill: var(--tx); } .bd-dc2 { font-size: 12px; fill: var(--tx2); }
.bd-lg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; font-size: 12px; flex: 1; min-width: 200px; max-height: 190px; overflow-y: auto; align-content: start; }
.bd-lg div { display: flex; align-items: center; gap: 6px; } .bd-lg i { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.bd-lg span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .bd-lg b { font-weight: 500; }
/* 品名带规格：放不下就换行，规格不能被省略号截掉 */
.bd-lg-long { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.bd-lg-long span { white-space: normal; word-break: break-all; }

.bd-ptbl td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bd-cellbar { position: relative; min-width: 120px; text-align: right; }
.bd-cellbar i { position: absolute; left: 0; top: 2px; bottom: 2px; background: var(--pl); border-radius: 2px; }
.bd-cellbar span { position: relative; }

.bd-depts { display: flex; flex-direction: column; gap: 12px; }
.bd-dept { display: flex; gap: 12px; align-items: stretch; }
.bd-dn { width: 44px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--pl); color: var(--p); font-weight: 600; writing-mode: vertical-rl; letter-spacing: 4px; }
.bd-dis { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.bd-di { background: var(--el-fill-color-light, #f5f7fa); border-radius: 6px; padding: 10px 12px; }
.bd-di .l { font-size: 12px; color: var(--tx2); }
.bd-di .v { font-size: 20px; font-weight: 600; margin: 4px 0; font-variant-numeric: tabular-nums; }
.bd-di .cmp { font-size: 12px; min-height: 18px; }
.bd-di.warn .v { color: var(--red); }
.bd-foot { line-height: 1.8; margin: 4px 0 20px; }
.bd-hit { cursor: pointer; }
.bd-lg .clk { cursor: pointer; }
.bd-lg .clk:hover span { color: var(--p); text-decoration: underline; }
tr.dr-row { cursor: pointer; }
tr.dr-row:hover td { background: var(--pl); }
tr.dr-row:hover b { color: var(--p); }
