/* views/dashboards.css — 「合规总览看板」(R2-F)。只引用 tokens.css 变量,零字面量、
 * 零外部资源、零内联样式(CSP)。复用通用 .stats/.stat/.section/.filters/.table 骨架,
 * 仅加视图私有 .v-dash-* 类(类契约:只增不改既有冻结类,DESIGN.md §0.10)。
 * 信号色语义固定;teal 仅在区块标题 tab、统计簇角标、功能性链接出现(配给,DESIGN.md §0.4)。 */

.v-dash-hidden { display: none; }

/* 过滤行 */
.v-dash-dt { width: 200px; }
.v-dash-filter-actions { display: flex; gap: var(--space-2); }

/* 窗口回显 */
.v-dash-window {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

/* 统计簇:略宽于默认以容纳卡内细分 */
/* 4×2 定列(链卡撤后 8 卡整格;卡内 link 钉底 → 同行卡完全对齐) */
.v-dash-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1280px) { .v-dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .v-dash-stats { grid-template-columns: 1fr; } }

/* 统计卡:纵排 label / 大数 / 细分 / 链接 */
.v-dash-card { display: flex; flex-direction: column; gap: var(--space-2); }
.v-dash-card > .v-dash-link { margin-top: auto; }  /* 链接钉底:卡高一致,层级稳定 */
.v-dash-card .stat-label,
.v-dash-card .stat-value { margin: 0; }

.v-dash-cap { font-size: 12px; color: var(--color-text-muted); }

/* 卡内细分行(细分计数;顶部一道发丝分隔) */
.v-dash-bd {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
}
.v-dash-bd-item { display: inline-flex; flex-direction: row; align-items: baseline; gap: 6px; }  /* 两行网格 → 单行内联(label 值紧挨,扫读快) */
.v-dash-bd-label { font-size: 11px; color: var(--color-text-muted); }
.v-dash-bd-val {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}

/* 信号色(语义固定):危险=红、警示=琥珀、正常=绿、弱=muted */
.v-dash-hot { color: var(--color-danger); }
.v-dash-warn { color: var(--color-warning); }
.v-dash-ok { color: var(--color-success); }
.v-dash-muted { color: var(--color-text-muted); }

/* 下钻链接(功能性 teal 文字/链接,DESIGN.md §2;贴卡底) */
.v-dash-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
  transition: color 120ms ease;
}
.v-dash-link:hover { color: var(--color-accent-strong); }
.v-dash-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-control);
}
.v-dash-link .icon { vertical-align: 0; }

.v-dash-note { font-size: 12px; color: var(--color-text-muted); margin-top: var(--space-3); }

/* 趋势区 */
.v-dash-trend-title { margin-top: var(--space-8); }
.v-dash-trend-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
  margin-bottom: var(--space-3);  /* 现位于表格上方:上隔图、下贴表 */
}
.v-dash-trend-controls .v-dash-trend-count { margin-right: auto; }  /* 计数居左弹性,CSV 靠右 */
.v-dash-seg { display: inline-flex; gap: 2px; background: var(--color-card); border-radius: 999px; padding: 3px; }
.v-dash-seg .btn { border: 0; box-shadow: none; border-radius: 999px; padding: 4px 14px; }
.v-dash-trend-count { font-size: 12px; color: var(--color-text-secondary); }

/* ============================================================================
 * FU-DASHBOARDS-CMD command-center additions (additive .v-dash-* only).
 * chart class families (areaChart/arcGauge prefix='v-dash') colored here from
 * admin --color-* tokens only — NEVER the dark bigscreen vars, NEVER under a .bs
 * ancestor (DESIGN §9c: admin :root scope stays isolated from the dark theme).
 * teal 配给:每区一道(section/panel marker 图标 + 功能性链接);数值轨用信号/中性色。
 * ==========================================================================*/

/* 区块标题 + 一道 teal marker(本区唯一一道 teal) */
.v-dash-sec-title { display: flex; align-items: center; gap: var(--space-2); }
.v-dash-sec-mark { display: inline-flex; color: var(--color-accent); }

/* 降级卡(某面板端点不可用):弱化呈现 + warn 说明 */
.v-dash-card-degraded { opacity: 0.92; }

/* ---- 图表/汇总区:多卡网格 + 单卡 ---- */
.v-dash-panels { display: grid; gap: var(--space-4); margin-top: var(--space-3); }
.v-dash-panels-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.v-dash-panels-2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }

.v-dash-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-surface);
  padding: var(--space-4);
  min-width: 0;
}
.v-dash-panel-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.v-dash-panel-mark { display: inline-flex; color: var(--color-accent); }  /* 本卡唯一一道 teal */
.v-dash-panel-title { margin: 0; font-size: 14px; font-weight: 600; color: var(--color-text); }
.v-dash-panel-actions { margin-left: auto; display: flex; gap: var(--space-2); }
.v-dash-panel-body { min-height: 60px; }
.v-dash-trend-host { width: 100%; min-height: 240px; }
.v-dash-trend-metrics { display: flex; gap: var(--space-2); }

.v-dash-subhead {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin: var(--space-3) 0 var(--space-2);
}
.v-dash-subhead:first-child { margin-top: 0; }
.v-dash-empty {
  font-size: 13px;
  color: var(--color-text-muted);
  padding: var(--space-6) var(--space-2);
  text-align: center;
}

/* ---- 横向比例条(原生 <progress>;数值轨信号/中性色,绝不 teal) ---- */
.v-dash-bars { display: flex; flex-direction: column; gap: var(--space-3); }
.v-dash-hbar { display: flex; flex-direction: column; gap: var(--space-1); }
.v-dash-hbar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  font-size: 12px;
}
.v-dash-hbar-label {
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.v-dash-hbar-val {
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.v-dash-hbar-sub { font-size: 11px; }

/* 比例条轨:中性钢底,语义色覆盖(色盲友好,与数字色冗余) */
.v-dash-hbar-track {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border: none;
  border-radius: 999px;
  background: var(--color-border);
  overflow: hidden;
}
.v-dash-hbar-track::-webkit-progress-bar { background: var(--color-border); border-radius: 999px; }
/* 量级排名条默认 = 橙阶浅档渐变(§9g);榜首 .lead 深档;warn/hot 保留给真语义(琥珀/红) */
.v-dash-hbar-track::-webkit-progress-value { background: linear-gradient(90deg, #FDE4CE, #FBAB6B); border-radius: 999px; }
.v-dash-hbar-track::-moz-progress-bar { background: linear-gradient(90deg, #FDE4CE, #FBAB6B); }
.v-dash-hbar-lead::-webkit-progress-value { background: linear-gradient(90deg, #FFB77A, #F4650F); }
.v-dash-hbar-lead::-moz-progress-bar { background: linear-gradient(90deg, #FFB77A, #F4650F); }
.v-dash-hbar-warn::-webkit-progress-value { background: var(--color-warning); }
.v-dash-hbar-warn::-moz-progress-bar { background: var(--color-warning); }
.v-dash-hbar-hot::-webkit-progress-value { background: var(--color-danger); }
.v-dash-hbar-hot::-moz-progress-bar { background: var(--color-danger); }
.v-dash-hbar-ok::-webkit-progress-value { background: var(--color-success); }
.v-dash-hbar-ok::-moz-progress-bar { background: var(--color-success); }

/* ---- 出境汇总 totals 行 ---- */
.v-dash-egress-totals {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

/* ---- KPI 卡微型图(§9g:爆发型日序列→平滑微线,构成→细堆叠,占比→细进度,个数→单位点阵。
 * 图形一律「细线级」存在感 —— 数字是主角,图是注脚,绝不做成香肠。) ---- */
.v-dash-viz { margin-top: var(--space-1); }
.v-dash-spark { width: 100%; height: 34px; display: block; }
.v-dash-spark-line { fill: none; stroke: #FBAB6B; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.v-dash-spark-area { fill: #FBAB6B; opacity: 0.15; stroke: none; }
.v-dash-spark-dot { fill: #FBAB6B; }
.v-dash-stackwrap { border-radius: 3px; overflow: hidden; background: var(--color-card); }
.v-dash-stack { display: block; width: 100%; height: 6px; }
.v-dash-stack .sv-low { fill: var(--color-sev-low); }
.v-dash-stack .sv-medium { fill: var(--color-sev-medium); }
.v-dash-stack .sv-high { fill: var(--color-sev-high); }
.v-dash-stack .sv-critical { fill: var(--color-sev-critical); }
.v-dash-stack .pv-block { fill: var(--color-danger); }
.v-dash-stack .pv-warn { fill: var(--color-warning); }
.v-dash-stack .pv-allow { fill: var(--color-success); }
.v-dash-viz .v-dash-hbar-track { height: 6px; }  /* 占比细进度同「细线级」 */
/* 同尺双条(成对数据对比:请求/响应、转发/拦截、输入/输出 —— 一把尺两根条,长短即结论) */
.v-dash-duo { display: flex; flex-direction: column; gap: 5px; margin-top: var(--space-2); }
.v-dash-duo-row { display: flex; align-items: center; gap: 8px; }
.v-dash-duo-label { flex: none; width: 5.5em; font-size: 11px; color: var(--color-text-muted); }
progress.v-dash-duo-bar { flex: 1 1 auto; width: auto; }
progress.v-dash-duo-bar.warnbar::-webkit-progress-value { background: var(--color-warning); }
progress.v-dash-duo-bar.warnbar::-moz-progress-bar { background: var(--color-warning); }
.v-dash-duo-val { flex: none; min-width: 4.5em; text-align: right; font-size: 12.5px; font-weight: 600; color: var(--color-text); font-variant-numeric: tabular-nums; }

/* 表格量级列内嵌数据条(Excel 式:数字旁按列最大值等比的小横条) */
.v-dash-cellwrap { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.v-dash-cellwrap .mono { min-width: 3.8em; text-align: right; font-variant-numeric: tabular-nums; }  /* 数字定宽右齐 → 条子两端对齐 */
progress.v-dash-cellbar { -webkit-appearance: none; appearance: none; width: 64px; height: 5px; border: 0; border-radius: 3px; background: var(--color-card); overflow: hidden; }
progress.v-dash-cellbar::-webkit-progress-bar { background: var(--color-card); }
progress.v-dash-cellbar::-webkit-progress-value { background: #FBAB6B; border-radius: 3px; }
progress.v-dash-cellbar::-moz-progress-bar { background: #FBAB6B; }
.v-dash-units { display: flex; flex-wrap: wrap; gap: 6px; }
.v-dash-unit { width: 22px; height: 22px; border-radius: 7px; background: var(--color-card); border: 1px solid var(--color-border); }
.v-dash-unit.over { background: var(--color-danger); border-color: var(--color-danger); }

/* ---- 软表盘(§9g dialGauge,v-dash 前缀;白卡上灰轨,与大屏灰卡白轨反相) ---- */
.v-dash-dial { width: 124px; height: 118px; display: block; }
.v-dash-d-tint { opacity: 0.09; }
.v-dash-d-tint.normal { fill: #FBAB6B; } .v-dash-d-tint.near { fill: var(--color-warning); } .v-dash-d-tint.over { fill: var(--color-danger); }
.v-dash-d-disc { fill: var(--color-surface); opacity: 0.92; }
.v-dash-d-track { stroke: var(--color-card); stroke-linecap: round; }
.v-dash-d-glowarc { stroke-linecap: round; filter: blur(5px); opacity: 0.35; }
.v-dash-d-glowarc.normal { stroke: #FBAB6B; } .v-dash-d-glowarc.near { stroke: #E5940E; } .v-dash-d-glowarc.over { stroke: #E25A3C; }
.v-dash-d-val { stroke-linecap: round; transition: stroke-dashoffset 900ms cubic-bezier(.22,.61,.36,1); }
.v-dash-d-gs-a.normal { stop-color: #FDE4CE; } .v-dash-d-gs-b.normal { stop-color: #FBAB6B; }
.v-dash-d-gs-a.near { stop-color: #F6C877; } .v-dash-d-gs-b.near { stop-color: #D97A06; }
.v-dash-d-gs-a.over { stop-color: #F59A82; } .v-dash-d-gs-b.over { stop-color: var(--color-danger); }
.v-dash-d-knob { fill: var(--color-surface); filter: drop-shadow(0 1px 3px rgba(27,30,36,0.28)); }
.v-dash-d-dot.normal { fill: #FBAB6B; } .v-dash-d-dot.near { fill: var(--color-warning); } .v-dash-d-dot.over { fill: var(--color-danger); }
.v-dash-d-num { font-family: var(--font-mono); font-weight: 700; font-size: 18px; fill: var(--color-text); }
.v-dash-d-num.near { fill: var(--color-warning); } .v-dash-d-num.over { fill: var(--color-danger); }
@media (prefers-reduced-motion: reduce) {
  .v-dash-d-val, .v-dash-area-rise.on, .v-dash-area-draw, .v-dash-area-dot-in.on { transition: none !important; }
}

/* ---- 占阈值仪表网格 ---- */
.v-dash-gauges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-4);
  justify-items: center;
}
.v-dash-gauge-cell { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); width: 100%; }
.v-dash-gauge-label {
  font-size: 11px;
  color: var(--color-text-muted);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* ============================================================================
 * 图表原语着色(charts.js prefix='v-dash')。SVG presentation 属性不支持 var(),
 * 颜色必须由 CSS 用 --color-* 着色(对拍 bigscreen.css 给 bs-* 的着色)。
 * ==========================================================================*/

/* 趋势 v2(§9g,镜像 bigscreen 请求/Token 卡):竖发丝纹理 + 右轴 + 悬浮白药丸 + 入场动效。
 * viewW 等比缩放(preserveAspectRatio:none 的文字压扁 bug 随 v2 根治)。 */
.v-dash-area { width: 100%; height: 240px; display: block; }
.v-dash-area-fit { height: auto; }
.v-dash-area-line { fill: none; stroke: var(--color-spark-brand); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.v-dash-area-fill { fill: var(--color-spark-brand); opacity: 0.12; stroke: none; }
.v-dash-area-fill-tex { opacity: 0.22; }
.v-dash-area-hl { fill: var(--color-spark-brand); }
.v-dash-area-dot { fill: var(--color-spark-brand); stroke: var(--color-surface); stroke-width: 2.5; }
.v-dash-grid { stroke: var(--color-border); stroke-width: 1; }
.v-dash-wk { fill: rgba(255, 255, 255, 0.035); }
.v-dash-ax { fill: var(--color-text-muted); font-family: var(--font-mono); font-size: 11px; }
/* 悬浮读数(白药丸,恒在点上方 16px —— §9g 规范) */
.v-dash-area-hov { visibility: hidden; pointer-events: none; }
.v-dash-area-hov.on { visibility: visible; }
.v-dash-area-cross { stroke: rgba(27,30,36,0.18); stroke-width: 1; stroke-dasharray: 3 4; }
.v-dash-area-hdot { fill: var(--color-spark-brand); stroke: var(--color-surface); stroke-width: 2; }
.v-dash-area-tipbox { fill: var(--color-surface); stroke: rgba(27,30,36,0.08); filter: drop-shadow(0 4px 12px rgba(27,30,36,0.16)); }
.v-dash-area-tipdate { fill: var(--color-text-muted); font-family: var(--font-mono); font-size: 11px; }
.v-dash-area-tipval { fill: var(--color-text); font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
/* 入场动效(发丝升起 → 曲线生长 → 端点浮现;reduceMotion 由 JS 直达终态) */
.v-dash-area-rise { transform: scaleY(0); transform-box: fill-box; transform-origin: center bottom; }
.v-dash-area-rise.on { transform: scaleY(1); transition: transform 1600ms cubic-bezier(.22,.61,.36,1); }
.v-dash-area-draw { transition: stroke-dashoffset 2400ms cubic-bezier(.4,0,.2,1) 350ms; }
.v-dash-area-dot-in { opacity: 0; }
.v-dash-area-dot-in.on { opacity: 1; transition: opacity 400ms ease 2600ms; }

/* 环形仪表:值轨 NEVER teal/green —— normal=中性钢 / near=amber / over=danger(语义固定) */
.v-dash-gauge { width: 100%; max-width: 120px; height: auto; display: block; }
.v-dash-g-track { stroke: var(--color-border); }
.v-dash-g-val { transition: stroke-dashoffset 700ms ease; stroke-linecap: butt; }
.v-dash-g-val.normal { stroke: var(--color-text-secondary); }
.v-dash-g-val.near { stroke: var(--color-warning); }
.v-dash-g-val.over { stroke: var(--color-danger); }
.v-dash-g-pct { font-family: var(--font-mono); font-weight: 700; font-size: 22px; fill: var(--color-text); }
.v-dash-g-pct.near { fill: var(--color-warning); }
.v-dash-g-pct.over { fill: var(--color-danger); }

@media (prefers-reduced-motion: reduce) {
  .v-dash-g-val { transition: none; }
}

/* 严重度雷达(charts.js prefix='v-dash')。§9e:数据多边形 = 一道结构金线(brass 描边 + 极淡 brass
 * wash —— 10% alpha 作箔/wash,非实金块);网格/辐条 = 暖砂发丝结构。SVG 几何走 fill/stroke(非
 * color:,check-admin-teal 只查 color: → brass 作非文字合法)。严重度信号在轴标签 tone+字形(§13:
 * neutral/amber/cinnabar —— 绝不金作信号、绝不 jade/green)。 */
.v-dash-radar-wrap { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); }
.v-dash-radar { width: 100%; max-width: 260px; height: auto; display: block; }
.v-dash-radar-grid { fill: none; stroke: var(--color-border); stroke-width: 1; }
.v-dash-radar-spoke { stroke: var(--color-border); stroke-width: 1; }
.v-dash-radar-area {
  fill: var(--color-accent-tint);        /* 极淡黄铜 wash(10% alpha,非实金块) */
  stroke: var(--color-accent-bright);    /* 一道黄铜结构线(非文字,§9e/lint② 合法) */
  stroke-width: 2;
  stroke-linejoin: round;
}
.v-dash-radar-dot { fill: var(--color-accent-bright); }
/* 轴标签:默认中性石墨;中=琥珀、高=绯红(值轨信号守 §13;SVG fill 非 color:) */
.v-dash-radar-axlabel { fill: var(--color-text-secondary); font-family: var(--font-mono); font-size: 11px; }
.v-dash-radar-axlabel.warn { fill: var(--color-warning); }
.v-dash-radar-axlabel.hot { fill: var(--color-danger); }
/* 可聚焦下钻段:焦点辉光走 outline(非 color:),brass 作非文字合法 */
.v-dash-seg { cursor: pointer; }
.v-dash-seg:focus-visible { outline: 2px solid var(--color-accent-bright); outline-offset: 2px; }

/* 雷达图例:字形 + 计数(色非唯一编码,§9e);tone 色走 --color-* 令牌(color: 合法,非裸 hex/非 bright) */
.v-dash-radar-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-4);
  font-size: 12px;
  color: var(--color-text-secondary);
}
.v-dash-radar-leg { display: inline-flex; align-items: center; gap: var(--space-1); font-variant-numeric: tabular-nums; }
.v-dash-radar-leg-gly { font-weight: 700; }
