/* Azure 成本对账平台 — 清爽浅色主题 */
:root {
  --bg: #f4f6f9; --panel: #fff; --border: #e3e8ef; --text: #1a2332; --muted: #64748b;
  --primary: #0f6cbd; --primary-dark: #0a5299; --ok: #16a34a; --warn: #d97706; --err: #dc2626; --navy: #102a49;
  --radius: 10px; --shadow: 0 1px 3px rgba(16,24,40,.07), 0 1px 2px rgba(16,24,40,.05);
}
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body { margin: 0; font: 14px/1.6 "Segoe UI", "Microsoft YaHei", system-ui, sans-serif; background: var(--bg); color: var(--text); }
#app { display: flex; min-height: 100vh; }

/* ===== 侧栏 ===== */
#sidebar { width: 216px; flex: none; background: #10243e; color: #cbd5e1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; transition: width .18s ease; }
#sidebar.hidden { display: none; }
.brand { padding: 18px 16px; font-size: 16px; font-weight: 600; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 8px; }
.brand-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-toggle { flex: none; width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: #cbd5e1; font-size: 16px; line-height: 1; border-radius: 7px; cursor: pointer; }
.nav-toggle:hover { background: rgba(255,255,255,.14); color: #fff; }
#nav { flex: 1; padding: 10px 8px; overflow-y: auto; }
#nav a { display: block; padding: 9px 12px; margin: 2px 0; color: #cbd5e1; text-decoration: none; border-radius: 8px; }
#nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
#nav a.active { background: var(--primary); color: #fff; }
.sidebar-foot { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.sidebar-foot a { color: #94a3b8; text-decoration: none; }
.sidebar-foot a:hover { color: #fff; }
.sidebar-foot a.sidebar-pref { display: block; margin-top: 6px; font-size: 12px; }
#whoami { margin-bottom: 6px; color: #e2e8f0; }
#whoami .role-tag { font-size: 11px; background: rgba(255,255,255,.15); padding: 1px 7px; border-radius: 99px; margin-left: 6px; }
.mobile-nav-button, .mobile-nav-backdrop { display: none; }

/* 折叠态（默认）：收成窄条，导航只留缩写，鼠标悬停由 title 提示全称 */
#sidebar.collapsed { width: 60px; }
#sidebar.collapsed .brand { padding: 18px 0; justify-content: center; }
#sidebar.collapsed .brand-text { display: none; }
#sidebar.collapsed #nav { padding: 10px 6px; }
#sidebar.collapsed #nav a { padding: 9px 0; text-align: center; font-size: 0; }
#sidebar.collapsed #nav a::before { content: attr(data-short); font-size: 13px; }
#sidebar.collapsed .sidebar-foot { padding: 10px 6px; text-align: center; }
#sidebar.collapsed #whoami { display: none; }
#sidebar.collapsed .sidebar-foot a { display: block; padding: 5px 0; font-size: 0; }
#sidebar.collapsed .sidebar-foot a::before { content: attr(data-short); font-size: 12px; }

/* 二级菜单：弹层随侧栏层叠上下文，侧栏须高于主区吸顶工具栏/下拉（≤80）、低于弹窗遮罩（100） */
#sidebar { z-index: 82; }
#nav .nav-group > a::after { content: '›'; float: right; color: #94a3b8; }
#nav .nav-group.open > a:not(.active) { background: rgba(255,255,255,.08); color: #fff; }
.nav-flyout { display: none; position: fixed; min-width: 176px; padding: 6px; background: #10243e; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; box-shadow: 0 12px 28px rgba(15,23,42,.32); }
.nav-group.open > .nav-flyout { display: block; }
#nav .nav-flyout a { white-space: nowrap; }
/* 二、三级弹层当前项与弹层同色调（浅底 + 左侧主色细条），整块主色只留给一级侧栏 */
#nav .nav-flyout a.active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--primary); }
#nav .nav-flyout .nav-group > a::after { margin-left: 14px; }
#nav a.nav-external::after { content: '↗'; float: right; color: #94a3b8; }
#sidebar.collapsed #nav .nav-flyout a { padding: 9px 12px; text-align: left; font-size: 14px; }
#sidebar.collapsed #nav .nav-flyout a::before { content: none; }
/* 规划中的菜单项（如 M365 分析）：灰显占位，不可点击 */
#nav .nav-planned { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 2px 0; color: #64748b; border-radius: 8px; white-space: nowrap; cursor: not-allowed; }
#nav .nav-planned small { margin-left: auto; padding: 0 6px; border: 1px solid rgba(148,163,184,.35); border-radius: 9px; color: #94a3b8; font-size: 11px; line-height: 17px; }

/* ===== 消耗异常提醒：侧栏固定卡片（有未读时边缘流光、悬停上浮、未读数滚动）+ 每日首次进入的提醒窗（错峰进场） ===== */
.attention-slot { flex: none; padding: 8px 10px 10px; }
.attention-slot[hidden] { display: none; }
.attention-card {
  position: relative; display: block; width: 100%; margin: 0; padding: 1.5px; border: 0; border-radius: 12px;
  background: rgba(255,255,255,.1); color: #e2e8f0; text-align: left; font: inherit; cursor: pointer; overflow: hidden; isolation: isolate;
  transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s ease;
}
.attention-card:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(2,8,23,.38); background: rgba(255,255,255,.16); }
.attention-card:focus-visible { outline: 2px solid #fbbf24; outline-offset: 2px; }
.attention-card.is-unread { background: rgba(248,113,113,.28); }
.attention-card.is-unread::before {
  content: ''; position: absolute; z-index: -1; inset: -80%;
  background: conic-gradient(from 0deg, transparent 0deg 240deg, rgba(251,191,36,.9) 300deg, #f87171 335deg, transparent 360deg);
  animation: attention-orbit 3.6s linear infinite;
}
.attention-card-body { display: block; border-radius: 10.5px; background: #15304f; padding: 10px 12px; }
.attention-card-head { display: flex; align-items: center; gap: 8px; }
.attention-icon { flex: none; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; background: rgba(248,113,113,.2); color: #fca5a5; font-size: 13px; font-weight: 800; }
.attention-card:not(.is-unread) .attention-icon { background: rgba(148,163,184,.16); color: #94a3b8; }
.attention-card.is-empty .attention-icon { background: rgba(34,197,94,.16); color: #86efac; font-weight: 600; }
.attention-title { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; color: #f8fafc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attention-badge { flex: none; min-width: 22px; padding: 0 7px; border-radius: 99px; background: #dc2626; color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.attention-badge.bump { animation: attention-bump .5s cubic-bezier(.34,1.56,.64,1); }
.attention-card:not(.is-unread) .attention-badge { display: none; }
.attention-sub { display: block; margin-top: 4px; font-size: 11.5px; color: #94a3b8; }
.attention-list { display: grid; gap: 3px; margin-top: 7px; }
.attention-line { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: #cbd5e1; }
.attention-line::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: #fbbf24; }
.attention-line.level-error::before { background: #f87171; }
.attention-line-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attention-line-tag { flex: none; color: #fca5a5; font-size: 11.5px; }
.attention-cta { display: block; margin-top: 8px; font-size: 12px; font-weight: 600; color: #fbbf24; }
.attention-card.is-empty .attention-card-body { padding: 8px 12px; }
.attention-card.is-empty .attention-title { font-weight: 500; color: #cbd5e1; }
.attention-card.is-empty .attention-sub { display: none; }
.attention-skeleton {
  height: 60px; border-radius: 12px;
  background: linear-gradient(100deg, rgba(255,255,255,.05) 30%, rgba(255,255,255,.13) 50%, rgba(255,255,255,.05) 70%) 0 0 / 220% 100%;
  animation: attention-shimmer 1.4s ease-in-out infinite;
}
@keyframes attention-orbit { to { transform: rotate(360deg); } }
@keyframes attention-shimmer { to { background-position: -220% 0; } }
@keyframes attention-bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
/* 折叠态：只留图标 + 未读数；没有提醒时不占位 */
#sidebar.collapsed .attention-slot { padding: 8px 6px; }
#sidebar.collapsed .attention-card-body { padding: 8px 0; }
#sidebar.collapsed .attention-card-head { flex-direction: column; gap: 4px; }
#sidebar.collapsed .attention-title, #sidebar.collapsed .attention-sub, #sidebar.collapsed .attention-list, #sidebar.collapsed .attention-cta { display: none; }
#sidebar.collapsed .attention-card.is-empty { display: none; }
#sidebar.collapsed .attention-badge { min-width: 0; padding: 0 6px; font-size: 11px; line-height: 18px; }
/* 手机：抽屉里按展开样式显示；菜单按钮上加红点 */
.mobile-nav-button.has-attention::after { content: ''; position: absolute; top: 5px; right: 5px; width: 9px; height: 9px; border-radius: 50%; background: #dc2626; box-shadow: 0 0 0 2px #fff; }
@media (max-width: 760px) {
  #sidebar.collapsed .attention-slot { padding: 8px 10px 10px; }
  #sidebar.collapsed .attention-card-body { padding: 10px 12px; }
  #sidebar.collapsed .attention-card-head { flex-direction: row; gap: 8px; }
  #sidebar.collapsed .attention-title, #sidebar.collapsed .attention-sub, #sidebar.collapsed .attention-cta { display: block; }
  #sidebar.collapsed .attention-list { display: grid; }
  #sidebar.collapsed .attention-card.is-empty { display: block; }
  #sidebar.collapsed .attention-card.is-empty .attention-sub { display: none; }
  #sidebar.collapsed .attention-badge { min-width: 22px; padding: 0 7px; font-size: 12px; line-height: 20px; }
}
/* 提醒窗：头部摘要 + 类型筛选，列表区单独滚动，底部固定操作 */
.modal.attention-modal { padding: 0; overflow: hidden; display: flex; flex-direction: column; animation: attention-pop .22s cubic-bezier(.2,.7,.3,1); }
.attention-digest { display: flex; flex-direction: column; min-height: 0; max-height: 88vh; }
.attention-digest-head { padding: 20px 24px 12px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, #fff7ed 0%, #fff 100%); }
.attention-digest-head h2 { margin: 0; padding-right: 30px; display: flex; align-items: center; gap: 10px; font-size: 18px; }
.attention-head-icon { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: #fee2e2; color: #b91c1c; font-weight: 800; }
.attention-digest-sub { margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.attention-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.attention-seg { display: inline-flex; gap: 4px; margin-right: 6px; padding-right: 10px; border-right: 1px solid var(--border); }
.attention-chip { border: 1px solid var(--border); background: #fff; border-radius: 99px; padding: 3px 11px; font-size: 12.5px; line-height: 1.5; cursor: pointer; color: var(--text); }
.attention-chip:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.attention-chip.active, .attention-chip.active:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.attention-chip:disabled { opacity: .5; cursor: default; }
.attention-chip b { margin-left: 5px; font-variant-numeric: tabular-nums; }
.attention-items { flex: 1; min-height: 120px; overflow-y: auto; padding: 14px 24px; display: grid; align-content: start; gap: 10px; background: #f8fafc; }
.attention-item { position: relative; padding: 12px 14px 12px 18px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.attention-digest.is-entering .attention-item { animation: attention-in .32s cubic-bezier(.2,.7,.3,1) both; animation-delay: calc(var(--i, 0) * 40ms); }
.attention-item::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--warn); }
.attention-item.level-error::before { background: var(--err); }
.attention-item.is-read { opacity: .7; }
.attention-item.is-read::before { background: #cbd5e1; }
.attention-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.attention-type { font-size: 11.5px; padding: 1px 8px; border-radius: 99px; background: #fef3c7; color: #92400e; }
.attention-item.level-error .attention-type { background: #fee2e2; color: #991b1b; }
.attention-customer { font-weight: 600; color: var(--text); }
.attention-fact { font-size: 11.5px; padding: 0 7px; border-radius: 6px; background: #fee2e2; color: #b91c1c; font-weight: 700; font-variant-numeric: tabular-nums; }
.attention-fact.warn { background: #fef3c7; color: #92400e; }
.attention-fact.muted { background: #f1f5f9; color: #475569; font-weight: 500; }
.attention-time { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.attention-message { margin: 6px 0 0; font-size: 13px; color: #334155; line-height: 1.6; overflow-wrap: anywhere; }
.attention-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12.5px; }
.attention-read-btn { margin-left: auto; padding: 3px 12px; font-size: 12px; }
.attention-read-done { margin-left: auto; color: var(--muted); font-size: 12px; }
.attention-empty { display: grid; justify-items: center; gap: 8px; padding: 30px 12px; text-align: center; color: var(--muted); }
.attention-empty-mark { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #dcfce7; color: var(--ok); font-weight: 700; }
.attention-digest-foot { display: flex; align-items: center; gap: 10px; padding: 12px 24px; border-top: 1px solid var(--border); background: #fff; }
.attention-digest-foot .spacer { flex: 1; }
@keyframes attention-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes attention-pop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) {
  .attention-digest-head, .attention-items, .attention-digest-foot { padding-left: 14px; padding-right: 14px; }
  .attention-seg { border-right: 0; padding-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .attention-card.is-unread::before { animation: none; inset: 0; background: #f87171; }
  .attention-skeleton, .attention-digest.is-entering .attention-item, .modal.attention-modal, .attention-badge.bump { animation: none; }
  .attention-card { transition: none; }
}

/* ===== 主区 ===== */
/* 宽度：默认随窗口铺开（2K/4K/带鱼屏不再右侧留白），超过 2400px 居中保可读性；侧栏底部可切「标准」回 1720px 定宽左对齐（即 1080p 原版式）。
   邮件 PDF 导出态 .bill-mail-export 与 @media print 自带固定宽度，不受此开关影响。 */
#main { flex: 1; min-width: 0; padding: 22px 26px; max-width: var(--content-max-width, 2400px); margin-inline: auto; }
body[data-content-width="standard"] #main { --content-max-width: 1720px; margin-inline: 0; }
/* 香港/国内/HQ 对账单：账单版式按 1720px 设计，拉宽会让概要与环图中间空出大片空白，因此大屏上只居中不铺满 */
body[data-page-layout="bill"] #main { --content-max-width: 1720px; }
@media (min-width: 1920px) { #main { padding: 24px 32px; } }
h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 10px; }
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.page-head h1 { margin: 0; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 14px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

/* 分析中心：共享范围、按需加载视图，宽表滚动不撑开页面。 */
.analysis-results, .analysis-card { min-width: 0; }
.analysis-view-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.analysis-view-tabs button, .analysis-dimensions button { font-size: 12.5px; }
.analysis-view-tabs button.active, .analysis-dimensions button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.analysis-detail-scope { padding: 10px 0; }
.analysis-detail-scope[hidden] { display: none; }
.analysis-detail-scope select { flex: 1 1 230px; min-width: 0; max-width: 100%; }
/* 租户 / 订阅多选（下拉复选）：与原下拉同宽，订阅列表名称较长，面板放宽 */
.analysis-scope-picker { flex: 1 1 230px; min-width: 0; max-width: 100%; }
.analysis-scope-picker .msel-toggle { min-height: 36px; }
.analysis-scope-picker-wide .msel-panel { min-width: min(640px, 92vw); }
.analysis-keyword { position: relative; display: flex; flex: 2 1 260px; min-width: 0; }
.analysis-keyword > input { flex: 1 1 auto; width: 100%; min-width: 0; padding-right: 32px; }
/* 自带清除按钮统一外观，隐藏浏览器原生搜索框的小叉避免出现两个 */
.analysis-keyword > input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.analysis-keyword-clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 17px; line-height: 24px; text-align: center; }
.analysis-keyword-clear:hover, .analysis-keyword-clear:focus-visible { background: #eef2f7; color: var(--text); }
.analysis-keyword-clear[hidden] { display: none; }
.analysis-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.analysis-retail-sync { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 8px; font-size: 12.5px; }
.analysis-retail-sync button { padding: 3px 10px; font-size: 12px; }
.analysis-quick button { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 10px; font-size: 12.5px; }
.analysis-quick button small { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.analysis-card details > summary { display: flex; align-items: baseline; gap: 8px; cursor: pointer; list-style: none; }
.analysis-card details > summary::-webkit-details-marker { display: none; }
.analysis-card details > summary::before { content: '▸'; color: var(--muted); font-size: 12px; transition: transform .15s; }
.analysis-card details[open] > summary::before { transform: rotate(90deg); }
.analysis-card details[open] > summary { margin-bottom: 8px; }
.analysis-inline-title { display: inline; margin: 0 !important; }
.analysis-kpi-text { font-size: 14px !important; line-height: 1.45; }
.analysis-table tr.analysis-row-muted td { color: var(--muted); }
.analysis-table tr.analysis-group-row td { background: #f1f5f9; font-weight: 600; color: var(--text); border-top: 2px solid var(--border); }
.analysis-table tr.analysis-price-outlier td { background: #fff7f7; }
.analysis-table tr.analysis-price-outlier td.analysis-row-actions { background: #fff7f7; }
.analysis-context { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 12px; overflow-wrap: anywhere; }
.analysis-filter-chip { max-width: 100%; font-size: 12px; padding: 3px 9px; overflow-wrap: anywhere; }
.page-head > .toolbar > .copy-field-btn { border-radius: 8px; border-left: 1px solid var(--border); min-height: 34px; }
.analysis-note { margin: 0 0 12px; padding: 6px 10px 6px 12px; border-left: 3px solid #bfdbfe; background: #f8fafc; color: var(--muted); font-size: 12.5px; line-height: 1.6; border-radius: 0 6px 6px 0; }
.analysis-card .analysis-note { margin-top: 8px; }
.analysis-card .analysis-subtitle { margin: 18px 0 8px; font-size: 14px; font-weight: 600; }
.analysis-dimensions { display: grid; gap: 6px; margin: 10px 0; }
.analysis-dimension-group { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.analysis-dimension-label { flex: none; min-width: 42px; font-size: 12px; color: var(--muted); }
.analysis-dimensions button { padding: 4px 9px; }
.analysis-quality-metrics { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.analysis-card h2 { font-size: 15px; margin: 0 0 10px; }
.analysis-card p { font-size: 12.5px; line-height: 1.65; }
.analysis-table-wrap { overflow: auto; max-height: 640px; margin-top: 10px; border: 1px solid var(--border); border-radius: 8px; }
.analysis-table { min-width: 900px; font-size: 13px; }
.analysis-table td { vertical-align: top; max-width: 360px; overflow-wrap: anywhere; }
.analysis-table thead th { white-space: nowrap; position: sticky; top: 0; z-index: 2; background: #f8fafc; }
.analysis-table tfoot td { position: sticky; bottom: 0; background: #f8fafc; font-weight: 600; border-top: 2px solid var(--border); }
.analysis-table .num { white-space: nowrap; }
.analysis-table-wide td, .analysis-table-wide th { white-space: nowrap; }
.analysis-table-wide td { padding: 6px 10px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
.analysis-table .analysis-dimension-cell { white-space: normal; min-width: 120px; max-width: 260px; }
.analysis-table .analysis-row-actions { position: sticky; right: 0; z-index: 1; background: #fff; min-width: 112px; white-space: nowrap; text-align: right; border-left: 1px solid var(--border); box-shadow: -6px 0 8px -6px rgba(15, 23, 42, .18); }
.analysis-table thead th.analysis-row-actions { z-index: 3; background: #f8fafc; }
.analysis-table tfoot td.analysis-row-actions { background: #f8fafc; }
.analysis-table tbody tr:hover td.analysis-row-actions { background: #f8fafc; }
/* 模型指标 / 预留实例视图：行内工具条、需关注行高亮、KPI 卡片行 */
.analysis-inline-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.analysis-inline-toolbar select, .analysis-inline-toolbar input[type="search"] { min-width: 180px; }
.analysis-inline-check { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
/* 模型指标：模型多选、下钻面包屑 */
.analysis-model-picker { flex: 0 1 300px; min-width: 220px; }
.analysis-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; font-size: 13px; }
.analysis-crumbs[hidden] { display: none; }
.analysis-crumb-back { padding: 3px 10px; font-size: 12.5px; margin-right: 6px; }
.analysis-crumb-sep { color: var(--muted); }
.analysis-crumb-level { margin-left: auto; font-size: 12px; }
.analysis-table tbody tr.analysis-row-attention td { background: #fffbeb; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.kpi { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: #f8fafc; }
.kpi .kpi-label { font-size: 12px; color: var(--muted); }
.kpi .kpi-value { font-size: 20px; font-weight: 600; margin-top: 2px; word-break: break-all; }
.kpi.warn { border-color: #fde68a; background: #fffbeb; }
.kpi.err { border-color: #fecaca; background: #fef2f2; }
.analysis-row-actions button { padding: 3px 8px; font-size: 12px; margin: 0 0 0 4px; }
.analysis-finding-kind { white-space: nowrap; }
.analysis-finding-type { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.analysis-finding-message { min-width: 260px; }
.analysis-finding-message p { margin: 4px 0 0; font-size: 12px; }
.analysis-up { color: var(--err); }
.overview-kpis small { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
@media screen and (max-width: 720px) {
  .analysis-view-tabs { gap: 4px; }
  .analysis-view-tabs button { flex: 1 1 90px; padding: 6px; }
  .analysis-detail-scope select, .analysis-scope-picker, .analysis-keyword { flex-basis: 100%; }
  .analysis-table-wrap { max-height: 70vh; }
  .analysis-dimension-label { flex-basis: 100%; }
}

/* ===== 控件 ===== */
button, .btn { font: inherit; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--text); cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { border-color: var(--primary); color: var(--primary); }
button.primary, .btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.primary:hover { background: var(--primary-dark); }
button.danger { color: var(--err); border-color: #fecaca; }
button.danger:hover { background: #fef2f2; border-color: var(--err); }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(15,108,189,.25); border-color: var(--primary); }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
label.field input, label.field select, label.field textarea, label.field .customer-picker { width: 100%; box-sizing: border-box; }
.input-error { border-color: var(--err) !important; box-shadow: 0 0 0 1px var(--err); }
.field-error { min-height: 15px; margin-top: 3px; color: var(--err); font-size: 11px; line-height: 1.3; }
.customer-picker { position: relative; min-width: 0; }
.customer-picker-toggle {
  width: 100%; min-width: 0; height: 38px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding-right: 30px; position: relative; background: #fff;
}
.customer-picker-toggle::after { content: '⌄'; position: absolute; right: 10px; top: 7px; color: var(--muted); font-size: 16px; }
.customer-picker-panel {
  position: absolute; z-index: 80; top: calc(100% + 4px); left: 0; width: max(100%, 420px); max-width: min(620px, 90vw);
  padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 30px rgba(15,23,42,.16);
}
.customer-picker-panel > input { width: 100%; margin-bottom: 6px; }
.customer-picker-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; padding: 0 2px 5px; color: var(--muted); font-size: 12px; }
.customer-picker-tools button { padding: 3px 9px; font-size: 12px; }
.customer-picker-list { max-height: 320px; overflow: auto; display: grid; gap: 2px; }
.customer-picker-option {
  width: 100%; min-width: 0; display: flex; align-items: center; gap: 7px; padding: 7px 9px; border: 0; border-radius: 6px;
  background: transparent; color: inherit; text-align: left; font-size: 13px; cursor: pointer;
}
.customer-picker-option:hover, .customer-picker-option.selected { background: #eaf3ff; color: #0958a5; }
.customer-picker-option input { width: auto; flex: 0 0 auto; margin: 0; }
.customer-picker-option span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 绑定授权弹窗：已绑定客户收进底部折叠分组，带状态标签，与未绑定客户区分 */
.customer-picker-option.bound { color: var(--muted); }
.customer-picker-option span.customer-picker-tag {
  flex: 0 0 auto; margin-left: auto; padding: 1px 7px; border-radius: 10px; background: #e8f5e9; color: #2e7d32; font-size: 11.5px; overflow: visible;
}
.customer-picker-group {
  width: 100%; margin-top: 4px; padding: 7px 9px; border: 0; border-top: 1px dashed var(--border); border-radius: 0;
  background: transparent; color: var(--muted); text-align: left; font-size: 12.5px; cursor: pointer;
}
.customer-picker-group:hover { color: #0958a5; background: #f5f9ff; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar[hidden] { display: none; } /* hidden 属性默认样式会被显式 display:flex 覆盖，必须显式关闭 */
.logs-unified-toolbar { align-items: center; flex-wrap: wrap; }
.logs-view-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.logs-view-filters[hidden] { display: none; }
/* 日志中心 · 登录与操作审计：指标卡 + 趋势 + 排行（与明细同一筛选），窄屏单列 */
.audit-insights { margin-bottom: 12px; }
.audit-kpis { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.audit-kpi { margin: 0; padding: 10px 14px; min-width: 132px; }
.audit-kpi b { display: block; font-size: 20px; line-height: 1.3; }
.audit-kpi span { font-size: 12px; }
.audit-kpi.err b { color: var(--err); }
.audit-insight-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 12px; }
.audit-insight-grid .card { margin: 0; min-width: 0; }
.audit-insight-grid h4 { margin: 0 0 8px; font-size: 13.5px; }
.audit-insight-grid h4 .muted { font-weight: 400; font-size: 12px; }
.audit-rank + .audit-rank { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.audit-rank .empty-tip { padding: 10px 0; }
.audit-rank-tip { font-size: 11.5px; }
@media (max-width: 960px) { .audit-insight-grid { grid-template-columns: minmax(0, 1fr); } }
/* 告警看板 */
.alert-board-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; font-size: 12px; }
.alert-kpi-sub { font-size: 11.5px; margin-top: 2px; }
.audit-kpi.warn b { color: var(--warn); }
.alert-insights { margin: 0 0 12px; }
.alert-insights h4 { margin: 0 0 8px; font-size: 13.5px; }
.alert-insights ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.alert-insights li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13px; line-height: 1.5; }
.alert-insights li b { white-space: nowrap; }
.alert-insights li > span:not(.tag) { flex: 1 1 360px; min-width: 0; }
.alert-board-table { width: 100%; font-size: 12.5px; }
.alert-board-table td, .alert-board-table th { white-space: nowrap; }
.alert-board-scroll { max-width: 100%; overflow-x: auto; }
/* 客户告警面板：高度跟随左侧图表卡片（绝对定位内容不撑高网格行），内容多时面板内纵向滚动、表头吸顶；列宽固定可换行，不出现横向滚动 */
.alert-board-side { display: flex; flex-direction: column; }
.alert-board-side-body { position: relative; flex: 1 1 auto; min-height: 280px; }
.alert-board-side-scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; }
.alert-board-customers { table-layout: fixed; font-size: 12px; }
.alert-board-customers td, .alert-board-customers th { white-space: normal; overflow-wrap: anywhere; padding: 6px 8px; line-height: 1.35; }
.alert-board-customers .num { text-align: right; white-space: nowrap; }
.alert-board-customers .alert-type-count { display: block; white-space: nowrap; }
@media (max-width: 600px) {
  .alert-board-customers .alert-type-count { white-space: normal; }
  .alert-board-customers td, .alert-board-customers th { padding: 6px 4px; }
}
.alert-board-customers thead th { position: sticky; top: 0; z-index: 1; background: #fafbfc; }
.alert-board-grid { grid-template-columns: minmax(0, 3fr) minmax(360px, 2fr); }
@media (max-width: 960px) { .alert-board-side-body { min-height: 420px; } .alert-board-grid { grid-template-columns: minmax(0, 1fr); } }
.alert-board-err { color: var(--err); font-weight: 600; }
button.link-btn { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; text-align: left; }
/* 客户总代变更对话框 */
.distributor-history, .distributor-subs { width: 100%; font-size: 12.5px; }
.distributor-history button { padding: 3px 8px; font-size: 12px; }
.distributor-history td:first-child { white-space: nowrap; }
.distributor-change-form { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.distributor-change-form .field { margin: 0; }
@media (max-width: 600px) { .distributor-change-form { grid-template-columns: 1fr; } }
button.link-btn:hover { text-decoration: underline; }
.alert-jump { white-space: nowrap; font-size: 12.5px; }
.audit-digest-status { margin-top: 6px; font-size: 12px; line-height: 1.6; color: var(--muted); max-width: 420px; }
.audit-digest-bad { color: var(--err); }
.audit-digest-subject { margin: 4px 0 8px; font-size: 13px; overflow-wrap: anywhere; }
.audit-digest-frame { display: block; width: 100%; height: 70vh; border: 1px solid var(--border); background: #f3f5f7; }
/* 日志中心 · 群发通知 */
.notify-table td { vertical-align: top; }
.notify-actions { display: flex; flex-wrap: wrap; gap: 4px; max-width: 260px; }
.notify-actions button { padding: 4px 9px; font-size: 12px; }
.notify-editor-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.notify-editor-grid textarea { font-family: inherit; line-height: 1.6; }
.notify-editor-grid [hidden] { display: none; }
.notify-field { min-width: 0; margin-bottom: 12px; }
.notify-field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.notify-editor-grid > div { min-width: 0; }
.notify-rich { min-width: 0; }
.notify-rich .ql-toolbar { position: sticky; top: 0; z-index: 2; border-radius: 6px 6px 0 0; background: #f7f9fb; }
.notify-rich .ql-toolbar button img { display: block; }
.notify-rich .notify-image-status { display: inline-block; max-width: 180px; vertical-align: middle; font-size: 12px; color: var(--muted); }
.notify-rich .notify-image-status[data-state="done"] { color: var(--ok); }
.notify-rich .notify-image-status[data-state="error"] { color: var(--err); }
.notify-rich .ql-container { font: inherit; background: #fff; border-radius: 0 0 6px 6px; }
.notify-rich .ql-editor { min-height: 340px; max-height: 520px; overflow-y: auto; line-height: 1.75; overflow-wrap: anywhere; }
.notify-rich .ql-editor table { border-collapse: collapse; width: 100%; margin: 8px 0; }
.notify-rich .ql-editor td { border: 1px solid #cbd5e1; min-width: 40px; padding: 6px; cursor: text; }
.notify-rich .ql-editor img { max-width: 100%; height: auto; }
.notify-rich .ql-toolbar > button:not([class]) { width: auto; padding: 0 6px; font-size: 12px; }
.notify-table-options { display: flex; align-items: center; gap: 8px; padding: 6px; border: 1px solid #cbd5e1; background: #fff; }
.notify-table-options[hidden] { display: none; }
.notify-table-options label { display: flex; align-items: center; gap: 4px; }
.notify-table-options input[type=number] { width: 55px; }
.notify-table-options input[type=text] { flex: 1; min-width: 0; }
.notify-rich .ql-tooltip { left: 0 !important; max-width: 100%; white-space: normal; }
.notify-paste-mode { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 12px; color: var(--muted); }
.notify-editor .customer-picker-panel { width: 100%; max-width: 100%; }
.notify-filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin-bottom: 12px; }
@media (max-width: 900px) { .notify-editor-grid, .notify-filter-grid { grid-template-columns: 1fr; } }
.pull-coverage { margin-bottom: 12px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.pull-coverage-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.pull-coverage-head h2 { margin: 0 0 3px; font-size: 16px; }
.pull-coverage-head .muted { font-size: 12px; }
.pull-coverage-kpis { display: flex; gap: 22px; flex: 0 0 auto; }
.pull-coverage-kpis > div { display: grid; min-width: 88px; }
.pull-coverage-kpis strong { font-size: 21px; color: var(--text); }
.pull-coverage-kpis span { color: var(--muted); font-size: 11px; }
.pull-coverage-chart { min-height: 340px; margin-top: 6px; overflow-x: auto; }
.pull-coverage-chart svg { display: block; width: 100%; min-width: 760px; height: 340px; }
.pull-coverage-bar { cursor: pointer; outline: none; }
.pull-coverage-bar:hover rect:last-of-type, .pull-coverage-bar:focus rect:last-of-type, .pull-coverage-bar.selected rect:last-of-type { stroke: var(--primary); stroke-width: 2; }
.pull-coverage-legend { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.pull-coverage-legend span { display: inline-flex; align-items: center; gap: 5px; }
.pull-coverage-legend i { width: 10px; height: 10px; border-radius: 2px; }
.pull-coverage-legend i.with-data { background: #0f6cbd; }
.pull-coverage-legend i.zero { background: #36a269; }
.pull-coverage-legend i.skipped { background: #94a3b8; }
.pull-coverage-legend i.issue { background: #d97706; }
.pull-coverage-legend i.missing { background: #dc2626; }
.pull-coverage-hint { margin-top: 10px; text-align: center; font-size: 12px; }
.pull-coverage-detail { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.pull-coverage-detail > strong { display: block; margin-bottom: 8px; font-size: 13px; }
@media (max-width: 700px) {
  .pull-coverage-head { flex-direction: column; }
  .pull-coverage-kpis { width: 100%; justify-content: space-between; }
}
.toolbar label { font-size: 13px; color: var(--muted); }

/* ===== 表格 ===== */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; white-space: nowrap; background: #fafbfc; }
/* ── 全站表格增强（tableKit）：表头点击排序 + 拖拽列宽 ── */
th.tk-th { position: relative; }
/* ── 分段切换标签（数据分析 Azure/M365 等） ── */
.seg-tabs { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg-tabs button, .seg-tabs > a { border: none; border-radius: 0; background: #fff; padding: 6px 16px; font-size: 13px; color: var(--text); text-decoration: none; }
.seg-tabs button + button, .seg-tabs > a + a { border-left: 1px solid var(--border); }
.seg-tabs button.seg-active, .seg-tabs > a.seg-active { background: var(--primary); color: #fff; }
/* 选项多（如渠道列表）时允许换行，窗口窄也不会把卡片撞宽 */
.seg-tabs.seg-wrap { flex-wrap: wrap; max-width: 100%; }
.seg-tabs.seg-wrap button, .seg-tabs.seg-wrap > a { padding: 6px 14px; }
th.tk-sortable { cursor: pointer; user-select: none; }
th.tk-sortable:hover { background: #f1f5f9; }
th.tk-sorted { color: var(--primary); }
.tk-arrow { display: inline-block; min-width: 12px; margin-left: 3px; font-size: 10px; color: var(--primary); }
.tk-handle { position: absolute; top: 0; right: -3px; width: 7px; height: 100%; cursor: col-resize; z-index: 3; }
.tk-handle:hover { background: rgba(37, 99, 235, .25); }
th.th-sort { cursor: pointer; user-select: none; }
th.th-sort:hover { color: var(--primary); background: #f1f5f9; }
tr:hover td { background: #f8fafc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty-tip { color: var(--muted); text-align: center; padding: 28px 0; }

/* ===== 徽标/状态 ===== */
.tag { display: inline-block; font-size: 12px; padding: 1px 9px; border-radius: 99px; border: 1px solid transparent; }
.tag.ok { background: #f0fdf4; color: var(--ok); border-color: #bbf7d0; }
.tag.warn { background: #fffbeb; color: var(--warn); border-color: #fde68a; }
.tag.err { background: #fef2f2; color: var(--err); border-color: #fecaca; }
.tag.info { background: #eff6ff; color: var(--primary); border-color: #bfdbfe; }
.pay-type-tag { font-size: 11px; padding: 0 7px; margin-left: 6px; vertical-align: 1px; background: #f1f5f9; color: #475569; border-color: #e2e8f0; white-space: nowrap; }
.pay-type-tag.info { background: #eff6ff; color: var(--primary); border-color: #bfdbfe; }
.pay-type-tag.warn { background: #fffbeb; color: var(--warn); border-color: #fde68a; }
.customer-alt-name { font-size: 11px; line-height: 1.35; color: #64748b; margin-top: 1px; word-break: break-word; }
.customer-alt-name.is-inline { margin: 0 0 0 6px; }
.bill-link-chip { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 0 8px; font-size: 12px; font-weight: 400; line-height: 20px; vertical-align: 1px; white-space: nowrap; color: var(--primary); background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 999px; text-decoration: none; }
.bill-link-chip:hover { background: #dbeafe; text-decoration: none; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.err { background: var(--err); } .dot.off { background: #94a3b8; }

/* ===== 横幅 ===== */
.banner { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13.5px; }
.banner.warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.banner.err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.banner.info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* ===== 汇总卡 ===== */
.stat { padding: 14px 16px; }
.stat .label { font-size: 12.5px; color: var(--muted); }
.stat .value { font-size: 22px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ===== 系统管理运行监控 ===== */
.system-monitor { margin-bottom: 18px; }
.system-monitor-head { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.system-monitor-title { display: flex; align-items: center; gap: 9px; min-width: 0; flex-wrap: wrap; }
.system-monitor-title h2 { margin: 0; font-size: 15px; }
.system-monitor-updated { color: var(--muted); font-size: 11.5px; }
.system-monitor-actions label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.system-monitor-actions input { width: auto; margin: 0; }
.system-monitor-body { min-height: 132px; }
.system-monitor-grid { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 8px; }
.system-metric { --metric-tone: #64748b; position: relative; min-width: 0; min-height: 128px; padding: 13px 14px 12px 17px; overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 6px; }
.system-metric::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--metric-tone); }
.system-metric.level-warn { border-color: #f4d48b; background: #fffdf7; }
.system-metric.level-error { border-color: #f3b2b2; background: #fffafa; }
.system-metric.level-warn::before { background: var(--warn); }
.system-metric.level-error::before { background: var(--err); }
.system-metric.tone-cpu { --metric-tone: #0f6cbd; }
.system-metric.tone-memory { --metric-tone: #0f766e; }
.system-metric.tone-connections { --metric-tone: #4f46e5; }
.system-metric.tone-network { --metric-tone: #0891b2; }
.system-metric.tone-disk { --metric-tone: #b45309; }
.system-metric.tone-data { --metric-tone: #15803d; }
.system-metric.tone-backup { --metric-tone: #7c3aed; }
.system-metric.tone-runtime { --metric-tone: #475569; }
.system-metric.tone-monitor { --metric-tone: #0078d4; }
.system-metric-label { color: var(--muted); font-size: 11.5px; }
.system-metric-value { display: block; min-height: 31px; margin-top: 2px; overflow-wrap: anywhere; font-size: 21px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.system-metric-track { height: 4px; margin: 6px 0 7px; overflow: hidden; background: #edf1f5; }
.system-metric-track span { display: block; height: 100%; background: var(--metric-tone); }
.system-metric.level-warn .system-metric-track span { background: var(--warn); }
.system-metric.level-error .system-metric-track span { background: var(--err); }
.system-metric-details { display: grid; gap: 1px; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.system-metric-details span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.system-monitor-issues { margin-bottom: 8px; }
@media (max-width: 1180px) { .system-monitor-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); } }
@media (max-width: 620px) {
  .system-monitor-head { align-items: flex-start; flex-direction: column; }
  .system-monitor-grid { grid-template-columns: 1fr; }
  .system-monitor-actions { width: 100%; justify-content: space-between; }
}

/* ===== 系统管理：账单邮件模板 ===== */
.bill-mail-tpl-grid { display: grid; grid-template-columns: repeat(3, minmax(240px, 1fr)); gap: 12px; }
.bill-mail-tpl-grid textarea { width: 100%; font-size: 12.5px; line-height: 1.6; resize: vertical; }
@media (max-width: 1100px) { .bill-mail-tpl-grid { grid-template-columns: 1fr; } }

/* ===== 经营概览 ===== */
.dashboard-head { align-items: flex-end; }
.dashboard-head h1 { margin-bottom: 1px; }
.dashboard-head-actions { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
/* 页头两组切换（客户范围 / 金额币种）：与客户管理页「金额币种」同款紧凑按钮 */
.dashboard-head-switches { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; margin-left: 18px; padding-bottom: 3px; font-size: 12px; }
.dashboard-head-switch-group { display: inline-flex; align-items: center; gap: 8px; }
.dashboard-head-switch-group > .muted { font-size: 12px; white-space: nowrap; }
.dashboard-head-switch { display: inline-flex; gap: 3px; }
.dashboard-head-switch button { padding: 4px 10px; font-size: 12px; white-space: nowrap; }
.dashboard-money-note { margin-top: 6px; color: var(--muted); font-size: 11px; }
.dashboard-alert-link { display: inline-flex; align-items: center; min-height: 36px; padding: 0 10px; border: 1px solid; border-radius: 6px; font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.dashboard-alert-link.warn { color: #9a6700; background: #fffbeb; border-color: #f5d16a; }
.dashboard-alert-link.error { color: #b42318; background: #fef3f2; border-color: #fecdca; }
.dashboard-alert-link:hover { filter: brightness(.97); }
.dashboard-date-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; margin-bottom: 12px; border-radius: 8px; }
.dashboard-date-toolbar .reconcile-range-controls { flex-wrap: nowrap; }
.dashboard-all-range { padding: 0 6px; font-size: 12px; }
.dashboard-filters, .dashboard-kpi, .dashboard-customer-card, .dashboard-last-run, .dashboard-empty { border-radius: 16px; }
.dashboard-filters { padding: 14px 16px 16px; }
/* 筛选卡片滚动吸顶（总览/客户管理/连接页共用；modal z-index=100 之下） */
.dashboard-filters, .connect-filter-panel { position: sticky; top: 0; z-index: 30; }
.dashboard-filter-head { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.dashboard-filter-head h2 { margin: 0; }
.dashboard-filter-head button { margin-left: auto; }
.dashboard-filter-count { color: var(--muted); font-size: 12px; }
.dashboard-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 9px; align-items: end; }
.dashboard-filter-grid label > span { display: block; color: var(--muted); font-size: 11.5px; margin: 0 0 3px 2px; }
.dashboard-filter-grid input, .dashboard-filter-grid select { width: 100%; min-width: 0; }
.customer-main-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; width: 100%; }
.customer-main-filters > * { min-width: 0; box-sizing: border-box; }
.customer-main-filters > select { flex: 1 1 104px; width: 104px; }
.customer-main-filters > .customer-search-box { flex: 2 1 260px; width: 260px; }
.customer-created-filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 100%; }
.customer-created-filter-group > label { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.customer-created-filter-group > label > span { color: var(--muted); font-size: 11.5px; }
.customer-created-filter-group > label > select { width: 108px; }
.customer-created-filter-group .customer-created-filter-dates { display: flex; flex-wrap: wrap; align-items: center; }
.customer-created-filter-group .customer-created-filter-dates > label { display: flex; align-items: center; gap: 4px; }
.customer-created-filter-group .customer-created-filter-dates label > span { margin: 0; }
.customer-created-filter-group .customer-created-filter-dates input { width: 132px; }
.customer-created-filter-group .customer-created-filter-dates:empty { display: none; }
@media (max-width: 560px) {
  .customer-main-filters > .customer-search-box { flex-basis: 100%; width: 100%; }
  .customer-created-filter-group { width: 100%; }
}
.dashboard-kpis { display: grid; grid-template-columns: repeat(6, minmax(155px, 1fr)); gap: 12px; margin-bottom: 16px; }
.dashboard-kpi { margin: 0; min-height: 116px; padding: 15px 16px; position: relative; overflow: hidden; }
.dashboard-kpi::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: #64748b; }
.dashboard-kpi.cost::before { background: #2563eb; }
.dashboard-kpi.recharge::before { background: #0891b2; }
.dashboard-kpi.balance::before { background: #16a34a; }
.dashboard-kpi.negative::before { background: #dc2626; }
.dashboard-kpi.count::before { background: #7c3aed; }
.dashboard-kpi-label { color: var(--muted); font-size: 12px; }
.dashboard-kpi-value { margin-top: 5px; font-size: 23px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.dashboard-kpi.negative .dashboard-kpi-value { color: #dc2626; }
.dashboard-kpi-sub { margin-top: 7px; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.dashboard-rankings { display: grid; gap: 14px; margin-bottom: 16px; }
.dashboard-rank-strip { margin: 0; padding: 13px 16px; }
.dashboard-rank-strip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dashboard-rank-strip-head h2 { margin: 0; font-size: 15px; }
.dashboard-rank-strip-head p { margin: 2px 0 0; color: var(--muted); font-size: 11.5px; }
.dashboard-rank-strip-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 11px; }
.dashboard-rank-chip { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 7px; align-items: center; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
.dashboard-rank-chip.owned { background: #eef8ff; border-color: #93c5fd; }
/* 租户不归我、但含我负责的订阅组：青绿色调，与「整租户归我」的蓝色区分 */
.dashboard-rank-chip.owned.partial, .dashboard-rank-row.owned.partial { background: #f0fdfa; border-color: #5eead4; }
.dashboard-rank-chip-main { min-width: 0; }
.dashboard-rank-chip .dashboard-rank-number { width: 20px; height: 20px; font-size: 10.5px; }
.dashboard-rank-chip .dashboard-rank-value { grid-column: 2; font-size: 11.5px; }
.dashboard-rank-chip .dashboard-rank-mine { grid-column: 2; display: flex; gap: 4px; min-width: 0; margin-top: -3px; color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; }
/* 卡片过窄时只省略关系标签，「我的占比 x%」不收缩、始终完整可见 */
.dashboard-rank-mine-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dashboard-rank-mine-share { flex: none; font-variant-numeric: tabular-nums; }
.dashboard-rank-chip.partial .dashboard-rank-mine { color: #0f766e; font-weight: 600; }
/* 整租户归我、但含归他人的订阅组：「我的客户 · 我的占比 x%」用琥珀色提醒只计我的部分 */
.dashboard-rank-chip.shared .dashboard-rank-mine { color: #b45309; font-weight: 600; }
.dashboard-rank-chip.partial .dashboard-rank-track i { background: #0f766e; }
.dashboard-rank-alert { display: inline-block; margin-top: 10px; padding: 5px 10px; border-radius: 6px; background: #fff7ed; color: #9a3412; font-size: 11.5px; text-decoration: none; }
.rank-kpis { grid-template-columns: repeat(4, minmax(155px, 1fr)); }
.dashboard-ranking-card { min-width: 0; margin: 0; padding: 16px; }
.dashboard-ranking-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; }
.dashboard-ranking-head > :first-child { flex: 1 1 260px; min-width: 0; }
.dashboard-ranking-head h2 { margin: 0; font-size: 17px; }
.dashboard-ranking-head p { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; }
.dashboard-ranking-modes { display: inline-flex; flex: 0 0 auto; }
.dashboard-ranking-controls { display: flex; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.dashboard-ranking-modes button { min-width: 52px; border-radius: 0; }
.dashboard-ranking-modes button:first-child { border-radius: 6px 0 0 6px; }
.dashboard-ranking-modes button:last-child { border-radius: 0 6px 6px 0; margin-left: -1px; }
.dashboard-ranking-modes button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.dashboard-rank-list, .dashboard-fund-list { display: grid; gap: 7px; }
.dashboard-rank-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 8px 9px; border: 1px solid transparent; border-radius: 6px; }
.dashboard-rank-row.owned { background: #eef8ff; border-color: #93c5fd; }
.dashboard-rank-number { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #e8eef6; color: var(--navy); font-size: 11px; font-weight: 700; }
/* 前三名深色圆圈按全市场名次（.top）标记；「仅我参与」等过滤后的列表仍保持名次含义，不能用 :nth-child */
.dashboard-rank-number.top { background: #102a49; color: #fff; }
.dashboard-rank-main { min-width: 0; }
.dashboard-rank-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dashboard-rank-name .tag { flex: 0 0 auto; }
/* 名称过长时先省略名称，关系标签与「我的占比」始终可见 */
.dashboard-rank-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dashboard-rank-share { font-variant-numeric: tabular-nums; }
.dashboard-rank-track { height: 7px; margin-top: 5px; background: #e8eef6; overflow: hidden; }
.dashboard-rank-track i { display: block; height: 100%; background: #1f84c7; }
.dashboard-rank-row.owned .dashboard-rank-track i { background: #0f766e; }
/* 分段条：浅色 = 租户期间总消耗，深色 = 其中属于我的订阅组的部分 */
.dashboard-rank-track.split { position: relative; }
.dashboard-rank-track.split b, .dashboard-rank-track.split i { position: absolute; left: 0; top: 0; height: 100%; }
.dashboard-rank-track.split b { background: #a9cde8; }
.dashboard-rank-service { margin-top: 4px; color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dashboard-rank-value { font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dashboard-rank-amount { display: grid; justify-items: end; gap: 2px; }
.dashboard-rank-mine-cost { color: #0f766e; font-size: 10.5px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dashboard-fund-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 9px; background: #f7f9fc; border-left: 3px solid #16a34a; }
.dashboard-fund-row.negative { background: #fff1f2; border-left-color: #dc2626; }
.dashboard-fund-name { min-width: 0; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dashboard-fund-money { display: grid; justify-items: end; gap: 2px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.dashboard-fund-money strong { color: #166534; font-size: 12px; }
.dashboard-fund-row.negative .dashboard-fund-money strong { color: #b91c1c; }
.dashboard-customer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.dashboard-customer-card { margin: 0; padding: 17px 18px 15px; border-top: 3px solid #cbd5e1; }
.dashboard-customer-card.health-ok { border-top-color: #16a34a; }
.dashboard-customer-card.health-error { border-top-color: #dc2626; }
.dashboard-customer-card.health-warning { border-top-color: #d97706; }
.dashboard-customer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dashboard-customer-head h2 { margin: 0; max-width: 270px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.dashboard-customer-en, .dashboard-customer-domain { max-width: 270px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.dashboard-customer-domain { font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
.dashboard-customer-ids { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 11px; margin-top: 2px; }
.dashboard-health { border-radius: 99px; padding: 2px 8px; font-size: 11px; white-space: nowrap; background: #f1f5f9; color: #475569; }
.dashboard-health.ok { background: #f0fdf4; color: #15803d; }
.dashboard-health.error { background: #fef2f2; color: #b91c1c; }
.dashboard-health.warning { background: #fffbeb; color: #a16207; }
.dashboard-customer-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px; }
.dashboard-money-warning { margin-top: 9px; padding: 5px 8px; border-radius: 7px; background: #fff7ed; color: #9a3412; font-size: 11.5px; }
.dashboard-money-grid { display: grid; grid-template-columns: 1fr 1fr; margin-top: 13px; border-top: 1px solid var(--border); border-left: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.dashboard-money-item { position: relative; min-width: 0; padding: 10px 11px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.dashboard-money-badge { position: absolute; top: 9px; right: 10px; padding: 0 7px; border-radius: 99px; border: 1px solid #fde68a; background: #fffbeb; color: var(--warn); font-size: 11px; font-style: normal; line-height: 17px; font-variant-numeric: tabular-nums; cursor: help; }
.dashboard-money-item span { display: block; color: var(--muted); font-size: 11.5px; }
.dashboard-money-item strong { display: block; margin-top: 2px; font-size: 17px; line-height: 1.35; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-money-item small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.dashboard-money-item.recharge strong { color: #0e7490; }
.dashboard-money-item.positive strong { color: #15803d; }
.dashboard-money-item.negative strong { color: #dc2626; }
.dashboard-raw-cost { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; margin-top: 10px; color: var(--muted); font-size: 11px; }
.dashboard-raw-cost strong { color: var(--text); text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
.dashboard-customer-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.dashboard-status-list { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.dashboard-customer-links { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.dashboard-customer-links .btn { white-space: nowrap; }
/* 同一行的客户卡片按区块逐行对齐（CSS subgrid）：每张卡片占 10 条与同行卡片共享的行，行高取该行最高的一张，
   缺英文名 / 默认域名 / 缺汇率提示 / 等值说明的卡片在该行留空，名称、标签、金额区、期间费用行和操作按钮上下平齐；
   各区块的 margin-top 仍在元素自身上，整行都没有该区块时对应行高度为 0（不留空隙）。不支持 subgrid 的旧浏览器保持顺序排版。
   新增或删除区块时同步修改 span 行数与各区块的 grid-row（tests/unit.test.js 校验两者一致）。 */
@supports (grid-template-rows: subgrid) {
  .dashboard-customer-grid { row-gap: 0; margin-bottom: -14px; }
  .dashboard-customer-grid > * { margin-bottom: 14px; }
  .dashboard-customer-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: subgrid; grid-row: span 10; column-gap: 12px; row-gap: 0; }
  .dashboard-customer-head, .dashboard-customer-head > div { display: contents; }
  .dashboard-customer-card h2 { grid-row: 1; grid-column: 1; align-self: start; }
  .dashboard-customer-card .dashboard-health { grid-row: 1; grid-column: 2; align-self: start; }
  .dashboard-customer-card .dashboard-customer-en { grid-row: 2; grid-column: 1 / -1; }
  .dashboard-customer-card .dashboard-customer-domain { grid-row: 3; grid-column: 1 / -1; }
  .dashboard-customer-card .dashboard-customer-ids { grid-row: 4; grid-column: 1 / -1; }
  .dashboard-customer-card .dashboard-customer-tags { grid-row: 5; grid-column: 1 / -1; align-self: start; }
  .dashboard-customer-card .dashboard-money-warning { grid-row: 6; grid-column: 1 / -1; align-self: start; }
  .dashboard-customer-card .dashboard-money-grid { grid-row: 7; grid-column: 1 / -1; }
  .dashboard-customer-card .dashboard-money-note { grid-row: 8; grid-column: 1 / -1; align-self: start; }
  .dashboard-customer-card .dashboard-raw-cost { grid-row: 9; grid-column: 1 / -1; }
  .dashboard-customer-card .dashboard-customer-actions { grid-row: 10; grid-column: 1 / -1; }
}
.dashboard-last-run { margin-top: 16px; }
.dashboard-last-run summary { cursor: pointer; font-weight: 600; }
.dashboard-last-run pre { background: #f8fafc; padding: 10px; border-radius: 8px; white-space: pre-wrap; font-size: 12px; }
/* 应收账单（总览 → Azure → 应收账单）：总览同款账期工具条 + 客户卡片（点击打开报告弹窗）+ 一屏报告弹窗 */
.recv-date-toolbar .recv-period-picker { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.recv-date-toolbar .recv-period-picker button { padding: 4px 9px; }
.dashboard-date-toolbar.recv-date-toolbar { flex-wrap: wrap; } /* 窄屏放不下时搜索/客户选择换行，不与账期控件压叠 */
.recv-date-toolbar .reconcile-range-controls { flex: none; }
.recv-global { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; padding: 10px 16px; font-size: 12.5px; color: var(--muted); }
.recv-global-missing { color: #9a3412; }
.recv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; align-items: stretch; }
/* 卡片等高：同一行卡片一样高、操作按钮贴底；金额小字单行省略（悬停看全文），金额区高度一致 */
.recv-card { position: relative; display: flex; flex-direction: column; margin: 0; padding: 17px 18px 15px; border-top: 3px solid #cbd5e1; cursor: pointer; transition: box-shadow .15s ease, transform .15s ease; }
.recv-card .dashboard-customer-actions { margin-top: auto; padding-top: 12px; }
.recv-card .dashboard-money-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 金额格固定四行：标签 / 金额 / 含税-不含税拆分 / 说明，均单行，数字等宽对齐 */
.recv-card .dashboard-money-item > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recv-card .dashboard-money-item small.recv-tax { margin-top: 1px; color: #475569; font-size: 11px; font-variant-numeric: tabular-nums; }
.recv-kpi-tax { color: #475569; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recv-card .dashboard-customer-tags { min-width: 0; }
.recv-card.owing { border-top-color: #dc2626; }
.recv-card:hover, .recv-card:focus-visible { box-shadow: 0 8px 22px rgba(15, 23, 42, .12); transform: translateY(-1px); outline: none; }
.recv-card-hint { position: absolute; top: 2px; right: 18px; font-size: 10.5px; line-height: 14px; color: var(--primary); opacity: 0; transition: opacity .15s ease; pointer-events: none; }
/* 同一行的应收卡片按区块逐行对齐（与总览客户卡片同一做法，CSS subgrid）：每张卡片占 8 条共享行——
   1 名称 + 状态徽标、2 英文名、3 编号、4 标签、5 缺汇率提示、6 金额区、7 等值说明、8 操作按钮；
   缺某区块的卡片在该行留空，整行都没有时行高为 0。新增或删除区块时同步修改 span 行数与各区块 grid-row（tests/receivables.test.js 校验）。 */
@supports (grid-template-rows: subgrid) {
  .recv-grid { row-gap: 0; margin-bottom: -14px; }
  .recv-grid > * { margin-bottom: 14px; }
  .recv-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: subgrid; grid-row: span 8; column-gap: 12px; row-gap: 0; }
  .recv-card h2 { grid-row: 1; grid-column: 1; align-self: start; }
  .recv-card .dashboard-health { grid-row: 1; grid-column: 2; align-self: start; }
  .recv-card .dashboard-customer-en { grid-row: 2; grid-column: 1 / -1; }
  .recv-card .dashboard-customer-ids { grid-row: 3; grid-column: 1 / -1; }
  .recv-card .dashboard-customer-tags { grid-row: 4; grid-column: 1 / -1; align-self: start; }
  .recv-card .dashboard-money-warning { grid-row: 5; grid-column: 1 / -1; align-self: start; }
  .recv-card .dashboard-money-grid { grid-row: 6; grid-column: 1 / -1; align-self: start; }
  .recv-card .dashboard-money-note { grid-row: 7; grid-column: 1 / -1; align-self: start; }
  .recv-card .dashboard-customer-actions { grid-row: 8; grid-column: 1 / -1; align-self: end; margin-top: 0; }
}
.recv-card:hover .recv-card-hint, .recv-card:focus-visible .recv-card-hint { opacity: 1; }
.recv-cost-form { display: grid; grid-template-columns: 88px 136px minmax(100px, 1fr); gap: 8px; align-items: end; }
.recv-cost-form label { display: grid; gap: 3px; font-size: 11.5px; color: var(--muted); }
.recv-cost-form input { min-width: 0; }
.recv-cost-form button { white-space: nowrap; }
.recv-history { margin-top: 8px; }
.recv-table-wrap { overflow-x: auto; }
.recv-table th.num, .recv-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.recv-table tr.recv-current td { background: #eff6ff; }
.recv-table tr.recv-total td { font-weight: 600; border-top: 2px solid var(--border); }
.recv-recharges { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; }
.recv-recharges li { display: flex; flex-wrap: wrap; gap: 12px; align-items: baseline; }
.recv-recharges strong.negative { color: #dc2626; }
.recv-footnote { margin-top: 16px; font-size: 12px; line-height: 1.6; }
.recv-alert { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #fff7ed; color: #9a3412; font-size: 12px; }
.recv-badge { border-radius: 99px; padding: 2px 9px; font-size: 11.5px; font-weight: 600; background: #f1f5f9; color: #475569; }
.recv-badge.error { background: #fef2f2; color: #b91c1c; }
.recv-badge.ok { background: #f0fdf4; color: #15803d; }
/* 报告弹窗：头部 → 左柱图 / 右当月回款 → 预计利润三栏 → 折叠明细；控制在一屏内 */
.recv-report { display: grid; gap: 12px; }
.recv-report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding-right: 20px; }
.recv-report-kicker { font-size: 12px; color: var(--muted); }
.recv-report h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 4px; padding-right: 0; font-size: 19px; }
.recv-report-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 12.5px; color: var(--muted); }
.recv-report-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 12px; align-items: stretch; }
.recv-report-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px 14px; background: #fff; }
.recv-report-card > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 -16px 10px; padding: 0 16px 8px; border-bottom: 1px solid var(--border); }
.recv-report-card h3 { margin: 0; font-size: 14.5px; }
.recv-report-collect.owing { border-color: #fecaca; }
.recv-report-chart { display: flex; flex-direction: column; }
.recv-report-chart .chart-box { flex: 1; margin: 0; }
.recv-report-chart footer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; font-size: 12.5px; }
.recv-report-big { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.recv-report-big span { font-size: 12.5px; color: var(--muted); }
.recv-report-big strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.recv-facts { margin: 0; display: grid; gap: 6px; }
.recv-facts > div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.recv-facts dt { color: var(--muted); }
.recv-facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.recv-facts > div.negative dd { color: #dc2626; }
.recv-facts > div.positive dd { color: #15803d; }
.recv-facts.compact { gap: 4px; }
.recv-facts.compact > div { font-size: 12.5px; }
.recv-facts.compact dd { font-weight: 500; }
.recv-facts-title { margin: 10px 0 6px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 11.5px; color: var(--muted); }
.recv-report-profit-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) minmax(190px, .7fr); gap: 0; }
.recv-report-col { min-width: 0; padding: 0 16px; border-left: 1px solid var(--border); }
.recv-report-col:first-child { padding-left: 0; border-left: 0; }
.recv-report-col-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12.5px; }
.recv-report-col-head .muted { font-weight: 400; }
.recv-report-col-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; font-size: 12px; }
.recv-report-col-foot button { padding: 4px 10px; font-size: 12px; white-space: nowrap; }
/* 计价与成本折扣表：客户默认 + 各订阅组一行，点行切换编辑对象；超过约 6 行内部滚动，弹窗保持一屏 */
.recv-scope-wrap { max-height: 196px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.recv-scope-table { width: 100%; margin: 0; font-size: 12.5px; }
.recv-scope-table th { position: sticky; top: 0; z-index: 1; background: #f8fafc; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 5px 8px; }
.recv-scope-table td { padding: 5px 8px; vertical-align: middle; }
.recv-scope-table tbody tr { cursor: pointer; }
.recv-scope-table tbody tr:hover td { background: #f8fafc; }
.recv-scope-table tbody tr.selected td { background: #eff6ff; }
.recv-scope-table tbody tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--primary, #2563eb); }
.recv-scope-table tr.recv-scope-base td { font-weight: 600; }
.recv-scope-table td.negative { color: #dc2626; font-weight: 600; }
.recv-scope-table .tag { margin: 0; padding: 0 5px; font-size: 10.5px; font-weight: 500; white-space: nowrap; }
.recv-scope-table .recv-scope-src { width: 1%; padding-left: 6px; white-space: nowrap; }
.recv-scope-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recv-scope-sub { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 400; color: var(--muted); }
.recv-scope-foot { margin-top: 6px; font-size: 11.5px; }
.recv-report-col-head b { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 说明文字先让位（flex-basis 0 只吃剩余宽度），标题与按钮不被挤断行 */
.recv-report-col-head > .muted { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recv-report-col-head > button { flex: none; padding: 4px 10px; font-size: 12px; white-space: nowrap; }
.recv-cost-form.stacked { grid-template-columns: minmax(70px, .8fr) minmax(120px, 1.2fr); }
.recv-cost-form.stacked .recv-cost-note { grid-column: 1 / -1; }
.recv-cost-state { margin-top: 8px; font-size: 12px; }
.recv-report-profit .recv-history:not(:empty) { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.recv-history-scroll { max-height: 180px; overflow: auto; }
.recv-report-result { display: grid; gap: 6px; align-content: start; padding-left: 16px; border-left: 1px solid var(--border); }
.recv-report-result > .muted { font-size: 12.5px; }
.recv-report-result strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.recv-report-result strong.negative { color: #dc2626; }
.recv-report-result strong.positive { color: #15803d; }
.recv-report-more summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.recv-report-more .recv-table-wrap { margin-top: 10px; }
.recv-report-more h4 { margin: 14px 0 6px; font-size: 13px; }
@media screen and (max-width: 900px) {
  .recv-report-grid, .recv-report-profit-grid { grid-template-columns: 1fr; gap: 12px; }
  .recv-report-col, .recv-report-result { padding-left: 0; border-left: 0; }
}
@media screen and (max-width: 800px) {
  .recv-grid { grid-template-columns: 1fr; }
  .recv-cost-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1400px) {
  .dashboard-filter-grid { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
  .dashboard-kpis { grid-template-columns: repeat(3, 1fr); }
  .rank-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-rank-strip-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .dashboard-filter-grid, .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-customer-grid { grid-template-columns: 1fr; }
  .dashboard-rank-strip-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .dashboard-head { align-items: flex-start; }
  .dashboard-head-actions { width: 100%; margin-left: 0; justify-content: flex-start; }
  .dashboard-head-switches { width: 100%; margin-left: 0; }
  .dashboard-head .watchboard-quick-nav.dashboard-head-quick { width: 100%; margin-left: 0; }
  .dashboard-filter-grid, .dashboard-kpis { grid-template-columns: 1fr; }
  .dashboard-money-grid { grid-template-columns: 1fr; }
  .dashboard-raw-cost { grid-template-columns: 1fr; }
  .dashboard-raw-cost strong { text-align: left; }
  .dashboard-rank-row, .dashboard-fund-row { grid-template-columns: 24px minmax(0, 1fr); }
  .dashboard-rank-value, .dashboard-rank-amount, .dashboard-fund-money { grid-column: 2; justify-items: start; }
  .rank-kpis, .dashboard-rank-strip-list { grid-template-columns: 1fr; }
  .dashboard-ranking-controls { justify-content: flex-start; }
}

/* ===== 图表 ===== */
.chart-box { overflow-x: auto; }
/* Power BI 版式条形榜：条在左、数值紧跟条尾、名称在最右；--bar-ch 为当前字号下的数字宽度估值 */
.bar-row { display: flex; align-items: center; gap: 10px; margin: 7px 0; --bar-ch: 7.4px; }
.bar-label { width: 220px; flex: none; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; min-width: 0; position: relative; height: 20px; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #3b82f6, #0f6cbd); border-radius: 5px; }
.bar-val { position: absolute; top: 0; height: 100%; display: flex; align-items: center; padding-left: 7px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 客户看板：销售先跟进欠费，再按全客户趋势分布定位增长、持平与下降。 */
.overdue-followup-card { box-sizing: border-box; width: 100%; border-left: 3px solid var(--err); }
.overdue-amount { color: var(--err); font-weight: 700; }
.overdue-source-section + .overdue-source-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.overdue-source-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 10px 0 8px; }
.overdue-source-head h3 { margin: 0; font-size: 15px; }
.overdue-source-head span { font-size: 12px; text-align: right; }
.customer-trend-card { box-sizing: border-box; width: 100%; margin-bottom: 0; }
.trend-help { margin: -4px 0 10px; font-size: 11.5px; }
.trend-distribution { margin: 0 0 10px; }
.trend-distribution-bar { display: flex; width: 100%; height: 12px; overflow: hidden; border-radius: 3px; background: #eef2f7; }
.trend-distribution-bar > span { min-width: 3px; }
.trend-distribution .new { background: #0f6cbd; }
.trend-distribution .up { background: #dc2626; }
.trend-distribution .flat { background: #64748b; }
.trend-distribution .down { background: #16a34a; }
.trend-distribution .low { background: #cbd5e1; }
.trend-distribution-legend { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 7px; color: var(--muted); font-size: 11.5px; }
.trend-distribution-legend span { display: inline-flex; align-items: center; white-space: nowrap; }
.trend-distribution-legend i { width: 8px; height: 8px; margin-right: 4px; border-radius: 2px; }
.watchboard-anchor { scroll-margin-top: calc(var(--wb-head-h, 46px) + 12px); }
.watchboard-quick-nav { position: sticky; top: 0; z-index: 31; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--border); box-shadow: 0 3px 10px rgba(16,24,40,.10); }
/* 消耗看板页头：快速查看与标题、视图切换同一行；客户视图冻结整行页头（不透明底色），报表在下方滚动，不再有压住内容的浮层 */
.watchboard-quick-nav.watchboard-head-nav { position: static; flex: 1 1 auto; min-width: 0; margin: 0 0 0 10px; padding: 0; border: 0; box-shadow: none; background: none; }
.watchboard-page-head.is-frozen, .dashboard-head.is-frozen { position: sticky; top: 0; z-index: 31; margin: -8px 0 8px; padding: 8px 0; background: var(--bg); transition: box-shadow .15s; }
.watchboard-page-head.is-frozen.is-stuck, .dashboard-head.is-frozen.is-stuck { box-shadow: 0 8px 8px -8px rgba(16,24,40,.22); border-bottom: 1px solid var(--border); }
/* 总览快速筛选并入冻结页头，与客户范围 / 金额币种同排同高 */
.watchboard-quick-nav.dashboard-head-quick { position: static; flex: 0 1 auto; min-width: 0; gap: 3px 6px; margin: 0 0 0 4px; padding: 0 0 3px; border: 0; box-shadow: none; background: none; }
.dashboard-head-quick > span { margin-right: 2px; font-weight: 400; }
.dashboard-head-quick button { padding: 4px 9px; }
.dashboard-head-quick .dashboard-quick-detail { margin-left: 4px; }
/* 中等宽度（如 1366 笔记本）收紧间距、隐藏「快速筛选」字样（nav 有 aria-label），让冻结页头保持一行 */
@media (min-width: 761px) and (max-width: 1500px) {
  .dashboard-head-switches { margin-left: 8px; gap: 6px 10px; }
  .dashboard-head-switch-group { gap: 5px; }
  .dashboard-head-switch button, .dashboard-head-quick button { padding: 4px 7px; }
  .dashboard-head-quick > span { display: none; }
}
@media (max-width: 760px) {
  .watchboard-page-head.is-frozen, .dashboard-head.is-frozen { position: static; }
  .watchboard-anchor { scroll-margin-top: 12px; }
  .watchboard-quick-nav.watchboard-head-nav { flex-basis: 100%; margin-left: 0; }
}
.watchboard-quick-nav > span { color: var(--muted); font-size: 12px; font-weight: 600; }
.watchboard-quick-nav button { color: var(--primary); border: 1px solid #bfdbfe; border-radius: 4px; background: #eff6ff; padding: 5px 9px; font-size: 12px; }
.watchboard-quick-nav button:hover { border-color: var(--primary); background: #dbeafe; }
.dashboard-quick-filters[hidden] { display: none; }
.dashboard-quick-filters button.active { color: #fff; background: var(--primary); border-color: var(--primary); }
.dashboard-quick-filters button:disabled { cursor: default; opacity: .6; }
.dashboard-quick-detail { margin-left: auto; color: var(--primary); font-size: 12px; white-space: nowrap; }
.filter-search-main.watchboard-search-controls > input, .filter-search-main.watchboard-search-controls > .picker-search { width: clamp(240px, 19vw, 300px); }
.watchboard-search-controls .time-filter { flex: 1 1 auto; }
.watchboard-filter-bar { margin-bottom: 12px; }
.watchboard-full-table { width: 100%; overflow: visible; }
.watchboard-full-table table { width: 100%; table-layout: auto; }
.watchboard-full-table th, .watchboard-full-table td { white-space: normal; overflow-wrap: anywhere; }
.watchboard-table th, .watchboard-table td { vertical-align: middle; text-align: center; }
.watchboard-table th:first-child, .watchboard-table td:first-child { text-align: center; }
.watchboard-table th:nth-child(2), .watchboard-table td:nth-child(2) { text-align: left; }
.watchboard-table th.num, .watchboard-table td.num { text-align: right; }
.watchboard-table th:first-child.num, .watchboard-table td:first-child.num { text-align: center; }
.agreement-expiry-table th:nth-child(2), .agreement-expiry-table td:nth-child(2) { text-align: left; }
.watchboard-business-table th, .watchboard-business-table td, .watchboard-channel-table th, .watchboard-channel-table td { vertical-align: middle; }
.watchboard-business-table th.num, .watchboard-business-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.watchboard-business-table th.rank, .watchboard-business-table td.rank { width: 36px; text-align: center; }
.watchboard-business-table th.pct, .watchboard-business-table td.pct { width: 28%; min-width: 150px; }
.watchboard-business-table tr.business-row-missing td { background: #fffbeb; }
.business-kpis { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.business-rank-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(480px, 1fr)); gap: 14px; margin-bottom: 14px; }
.business-rank-card { margin-bottom: 14px; }
.business-rank-grid .business-rank-card { margin-bottom: 0; }
.business-rank-no { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; border-radius: 11px; background: #f1f5f9; color: #475569; font-size: 12px; font-weight: 600; }
.business-rank-no.top { background: #2563eb; color: #fff; }
.business-rank-more { display: block; margin: 8px auto 0; font-size: 12.5px; }
.business-customer-name { font-weight: 600; }
.business-pct { display: flex; align-items: center; gap: 8px; }
.business-pct-track { flex: 1; height: 8px; border-radius: 4px; background: #eef2f7; overflow: hidden; }
.business-pct-fill { height: 100%; border-radius: 4px; background: #2563eb; }
.business-pct-fill.warn { background: #f59e0b; }
.business-pct > span { min-width: 44px; text-align: right; font-size: 12px; color: var(--muted, #64748b); font-variant-numeric: tabular-nums; }
.business-mix-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.business-mix-card { margin-bottom: 0; }
.business-mix-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: #eef2f7; margin: 2px 0 10px; }
.business-mix-bar > span { height: 100%; }
.business-mix-list { display: grid; gap: 6px; }
.business-mix-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto 48px; align-items: center; gap: 8px; font-size: 13px; }
.business-mix-row > i { width: 10px; height: 10px; border-radius: 2px; }
.business-mix-row.missing .business-mix-name { color: #b45309; font-weight: 600; }
.business-mix-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.business-mix-count { font-size: 12px; }
.business-mix-row > strong { font-variant-numeric: tabular-nums; }
.business-mix-pct { text-align: right; color: var(--muted, #64748b); font-size: 12px; font-variant-numeric: tabular-nums; }
.business-gaps { margin-bottom: 12px; font-size: 13px; }
.business-gaps > summary { cursor: pointer; list-style: none; }
.business-gaps > summary::-webkit-details-marker { display: none; }
.business-gaps-toggle { margin-left: 8px; color: var(--primary); }
.business-gaps[open] .business-gaps-toggle { display: none; }
.business-gaps-section { margin-top: 10px; }
.business-gaps-title { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.business-gaps-list { display: flex; flex-wrap: wrap; gap: 6px; }
.business-gap-item { display: inline-flex; gap: 8px; align-items: baseline; padding: 4px 10px; border-radius: 6px; background: #fff; border: 1px solid #fde68a; color: inherit; text-decoration: none; font-size: 12.5px; }
.business-gap-item:hover { border-color: #f59e0b; }
.watchboard-channel-table th:nth-child(-n+6), .watchboard-channel-table td:nth-child(-n+6) { text-align: left; }
.watchboard-channel-table th.num, .watchboard-channel-table td.num { text-align: right; }
.agreement-subscriptions { font-size: 12px; }
.agreement-subscriptions summary { color: var(--primary); cursor: pointer; }
.agreement-subscriptions div { margin-top: 5px; color: var(--muted); overflow-wrap: anywhere; }
.agreement-expiry { font-weight: 700; white-space: nowrap; }
.abus-account-list { display: grid; gap: 12px; }
.abus-account-card.is-overdue { border-left: 3px solid var(--err); }
.abus-account-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.abus-account-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.abus-account-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 16px; margin-top: 10px; }
.abus-account-stat { display: grid; gap: 2px; }
.abus-account-stat > span { font-size: 12px; }
.abus-account-stat > strong { font-size: 14px; white-space: nowrap; }
.abus-account-stat.abus-gap > strong { color: #b45309; }
.abus-account-basis { margin-top: 6px; font-size: 12px; }
.abus-subscription-table { table-layout: fixed; width: 100%; min-width: 1560px; }
.abus-subscription-table th { white-space: normal; word-break: keep-all; vertical-align: middle; line-height: 1.3; }
.abus-subscription-table td { vertical-align: top; overflow-wrap: anywhere; }
.abus-subscription-table .num, .abus-subscription-table .nowrap, .abus-subscription-table .tag { white-space: nowrap; }
.abus-subscription-cell > .mono { font-size: 11.5px; }
.abus-subscription-cell .tag { margin-top: 3px; white-space: normal; }
.abus-estimate { font-style: italic; color: #475569; }
.abus-note-cell { white-space: pre-wrap; line-height: 1.45; }
.abus-row-actions button { margin: 0 6px 4px 0; }
.abus-period-cell > span, .abus-period-cell > strong { display: block; }
.abus-expiry { margin-top: 3px; }
.abus-expiry.expired { color: #b91c1c; }
.abus-expiry.urgent { color: #c2410c; }
.abus-expiry.soon { color: #a16207; }
.abus-expiry.normal { color: #166534; }
.abus-expiry-meta { margin-top: 2px; font-size: 11px; font-weight: 700; }
.abus-expiry-meta.expired { color: #b91c1c; }
.abus-expiry-meta.urgent { color: #c2410c; }
.abus-expiry-meta.soon { color: #a16207; }
.abus-expiry-meta.normal { color: #166534; }
.abus-expiry-meta.none { color: var(--muted); }
.text-danger { color: var(--err); font-weight: 700; }
tr.abus-overdue-row > td { background: #fef2f2; }
tr.abus-overdue-row > td:first-child { box-shadow: inset 3px 0 0 var(--err); }
.trend-sparkline-heading { text-align: center; }
.balance-risk-card { border-left: 3px solid var(--warn); }
.balance-risk-summary { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 8px; margin: 10px 0 12px; }
.balance-risk-tier { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-left: 4px solid; border-radius: 4px; color: var(--text); background: #fff; }
.balance-risk-tier strong { font-size: 20px; }
.balance-risk-tier span { color: var(--muted); font-size: 12px; }
.balance-risk-tier.critical, .balance-risk-label.critical { border-color: #b91c1c; color: #b91c1c; }
.balance-risk-tier.high, .balance-risk-label.high { border-color: #dc2626; color: #dc2626; }
.balance-risk-tier.medium, .balance-risk-label.medium { border-color: #d97706; color: #b45309; }
.balance-risk-tier.watch, .balance-risk-label.watch { border-color: #eab308; color: #a16207; }
.balance-risk-label { display: inline-block; border-left: 3px solid; padding-left: 6px; font-weight: 600; white-space: nowrap; }
.spike-table .spike-trend-cell { min-width: 304px; padding: 4px 8px; }
.spike-trend-chart { width: 288px; height: 66px; display: flex; align-items: center; justify-content: center; }
.spike-trend-chart svg { display: block; overflow: visible; }
.trend-status { display: inline-block; min-width: 72px; font-weight: 600; white-space: nowrap; }
.trend-status.new { color: var(--primary); }
.trend-status.up { color: var(--err); }
.trend-status.flat { color: var(--muted); }
.trend-status.down { color: var(--ok); }
.trend-status.low { color: #94a3b8; }
/* 客户表末列「当前余额」：欠费红、余额不足按风险档着色，行首色条呼应；状态标签用 data-flag 生成内容，
   不进入单元格文本，tableKit 表头排序仍按金额。 */
.watchboard-table-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 10px; }
.watchboard-table-head h2 { margin: 0; }
.watchboard-table-sub { margin-top: 3px; font-size: 12px; }
.balance-summary { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.balance-summary-item { padding: 2px 10px; border: 1px solid; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.balance-summary-item.is-overdue { color: var(--err); background: #fef2f2; border-color: #fecaca; }
.balance-summary-item.is-low { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.inactive-stage-note { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 8px; font-size: 12px; }
.balance-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.balance-cell .balance-amount { display: block; }
.balance-flag::after { content: attr(data-flag); display: inline-block; margin-top: 3px; padding: 0 7px; border: 1px solid; border-radius: 99px; background: #fff; font-size: 11px; font-weight: 700; line-height: 17px; }
.balance-cell.is-overdue { background: #fef2f2; }
.balance-cell.is-overdue .balance-amount, .balance-cell.is-overdue .balance-flag::after { color: var(--err); font-weight: 700; }
.balance-cell.is-overdue .balance-flag::after { border-color: #fecaca; }
.balance-cell.is-low { background: #fffbeb; }
.balance-cell.is-low .balance-amount { font-weight: 700; }
.balance-cell.is-low .balance-flag::after { border-color: #fde68a; }
.balance-cell.is-low.critical .balance-amount, .balance-cell.is-low.critical .balance-flag::after { color: #b91c1c; }
.balance-cell.is-low.high .balance-amount, .balance-cell.is-low.high .balance-flag::after { color: #dc2626; }
.balance-cell.is-low.medium .balance-amount, .balance-cell.is-low.medium .balance-flag::after { color: #b45309; }
.balance-cell.is-low.watch .balance-amount, .balance-cell.is-low.watch .balance-flag::after { color: #a16207; }
.balance-cell.is-unknown { color: var(--muted); font-size: 12px; }
tr.balance-overdue-row > td:first-child { box-shadow: inset 3px 0 0 var(--err); }
tr.balance-low-row > td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.spike-day-ago { margin-top: 2px; font-size: 11px; white-space: nowrap; }
@media (max-width: 720px) {
  .watchboard-search-controls .watchboard-quick-nav { width: 100%; margin-left: 0; }
  .filter-search-main.watchboard-search-controls > input, .filter-search-main.watchboard-search-controls > .picker-search { width: 100%; }
  .overdue-source-head { display: block; }
  .overdue-source-head span { display: block; margin-top: 3px; text-align: left; }
  .balance-risk-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spike-table .spike-trend-cell { min-width: 288px; }
}

/* ===== 消耗看板 · 渠道单页报告 ===== */
.channel-report-scroll { overflow-x: auto; margin-bottom: 16px; border-radius: 6px; }
/* 固定画布：图表 viewBox 按下面的面板像素尺寸生成，尺寸一致才不会等比缩放出左右留白。
   宽度由 JS 按容器实际宽度下发（下限 1400），窗口更宽时富余宽度全给左侧主图 */
.channel-report {
  box-sizing: border-box; width: 1400px; min-width: 1400px; height: 780px; padding: 16px 20px 12px;
  display: grid; grid-template-rows: 62px 210px 250px minmax(175px, 1fr); gap: 5px;
  color: #202124; background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow);
}
.channel-report-head {
  display: grid; grid-template-columns: minmax(300px, 1.25fr) minmax(210px, .8fr) minmax(240px, .9fr);
  align-items: start; gap: 18px; border-bottom: 1px solid #e5e7eb;
}
.channel-report-identity h2 { margin: 0 0 3px; font-size: 17px; color: #202124; }
.channel-report-identity .muted { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-report-metric { min-width: 0; text-align: left; }
.channel-report-metric.center { text-align: center; }
.channel-report-metric.right { text-align: right; }
.channel-report-metric strong { display: block; font-size: 34px; line-height: 1.08; font-weight: 700; font-variant-numeric: tabular-nums; }
.channel-report-metric span { display: block; margin-top: 5px; color: #5f6368; font-size: 11.5px; white-space: nowrap; }
/* 右栏固定 300px：条形榜不需要很宽，富余宽度全给左侧主图 */
.channel-report-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; min-height: 0; }
.channel-report-panel { min-width: 0; min-height: 0; overflow: hidden; }
.channel-report-chart { display: grid; grid-template-rows: 20px minmax(0, 1fr); }
.channel-report-chart > svg { width: 100%; height: 100%; }
/* 直客主图：一屏 15 个客户，超出部分横向滚动；SVG 按像素尺寸生成，滚动条粗细固定在预留的 12px 内 */
.channel-report-main-scroll { min-width: 0; height: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: #94a3b8 #f1f5f9; }
.channel-report-main-viewport { position: relative; min-width: 0; height: 100%; overflow: hidden; }
.channel-report-main-yaxis, .channel-report-main-rpad { position: absolute; top: 0; z-index: 1; pointer-events: none; background: #fff; }
.channel-report-main-yaxis { left: 0; display: block; }
.channel-report-main-rpad { right: 0; }
.channel-report-main-scroll::-webkit-scrollbar { height: 10px; }
.channel-report-main-scroll::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 5px; }
.channel-report-main-scroll::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 5px; }
.channel-report-main-scroll:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; }
.direct-report-board { min-width: 0; }
.direct-report-card { margin-bottom: 14px; }
.channel-report-table td.channel-report-table-empty { padding: 14px 7px; text-align: center; white-space: normal; }
/* PBI 式堆积图：图例在图表上方居中一行，横向宽度全给图表；容器相对定位承载跟随式工具提示 */
.stacked-legend-wrap { position: relative; display: flex; flex-direction: column; gap: 2px; height: 100%; min-height: 0; }
.chart-tip { position: absolute; z-index: 30; pointer-events: none; background: rgba(32, 33, 36, .94); color: #fff; padding: 7px 10px; border-radius: 6px; font-size: 12px; line-height: 1.5; box-shadow: 0 4px 14px rgba(0, 0, 0, .28); max-width: 340px; white-space: nowrap; }
.chart-tip b { display: block; font-size: 11.5px; color: #bdc1c6; font-weight: 600; }
.chart-tip .chart-tip-val { font-variant-numeric: tabular-nums; font-weight: 600; }
.stacked-legend-wrap svg { flex: 1; min-height: 0; width: 100%; }
.stacked-legend { flex: none; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 14px; padding: 0 4px; max-height: 32px; overflow: hidden; }
.stacked-legend-title { font-size: 11.5px; font-weight: 700; color: #202124; margin-right: 2px; }
.stacked-legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: #4b5563; white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.stacked-legend-item i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
/* 日图的 SVG 必须占满与上方主图相同的面板；图例使用 SVG 已预留的顶部空间，避免等比缩放产生左右留白。 */
.channel-report-daily .stacked-legend-wrap { display: block; }
.channel-report-daily .stacked-legend { position: absolute; z-index: 1; top: 0; left: 0; width: 100%; box-sizing: border-box; }
.channel-report-daily .stacked-legend-wrap > svg { display: block; width: 100%; height: 100%; }
.channel-report-chart-title { height: 20px; text-align: center; color: #4b5563; font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-report-ranking { height: calc(100% - 20px); overflow-y: auto; padding: 1px 5px 0 0; scrollbar-gutter: stable; }
.channel-report-ranking .bar-row { gap: 6px; margin: 5px 0; --bar-ch: 5.9px; }
.channel-report-ranking .bar-label { width: 50%; font-size: 10.5px; }
.channel-report-ranking .bar-track { height: 13px; border-radius: 2px; }
.channel-report-ranking .bar-fill { border-radius: 2px; background: #118dff; }
.channel-report-ranking .bar-val { padding-left: 5px; font-size: 10.5px; color: #5f6368; }
.channel-report-table-frame { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; min-height: 0; overflow: hidden; isolation: isolate; background: #fff; border: 1px solid #dbeafe; border-radius: 0 0 4px 4px; }
.channel-report-table-wrap { min-height: 0; min-width: 0; overflow-x: hidden; overflow-y: scroll; scrollbar-gutter: stable; background: #fff; }
.channel-report-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; background: #fff; font-size: 11px; }
.channel-report-table th, .channel-report-table td { padding: 5px 7px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.channel-report-table th { position: sticky; top: 0; z-index: 2; background: #fff; color: #4b5563; border-bottom: 2px solid #60a5fa; }
.channel-report-table th:nth-child(1) { width: 12%; }
.channel-report-table th:nth-child(2) { width: 7%; }
.channel-report-table th:nth-child(3) { width: 17%; }
.channel-report-table th:nth-child(4) { width: 13%; }
.channel-report-table th:nth-child(5) { width: 12%; }
.channel-report-table th:nth-child(6) { width: 17%; }
.channel-report-table th:nth-child(7) { width: 6%; }
.channel-report-table th:nth-child(8), .channel-report-table th:nth-child(9) { width: 8%; }
.channel-report-table tbody tr.channel-report-sub-row { cursor: pointer; }
.channel-report-table tbody tr.channel-report-sub-row:hover td { background: #f1f5f9; }
.channel-report-table tbody tr.channel-report-sub-row:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; }
.channel-report-table tbody tr.channel-report-sub-row.is-selected td { background: #dbeafe; color: #1e3a8a; font-weight: 600; }
.channel-report-table tbody tr.channel-report-sub-row.is-selected td:first-child { box-shadow: inset 3px 0 0 #2563eb; }
.channel-report-daily-panel .channel-report-chart-title { display: flex; align-items: center; justify-content: center; gap: 8px; }
.channel-report-daily-panel .channel-report-chart-title > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* 全部汇总主图下钻层标题：「← 全部渠道」返回按钮 + 渠道名 · 实体轴，与日图标题同一排版 */
.channel-report-drill-title { display: flex; align-items: center; justify-content: center; gap: 8px; }
.channel-report-drill-title > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* 主图标题右侧额度图例（色块 = 柱体各段）：空间不够时先截断标题文字，图例金额尽量完整 */
.channel-report-drill-title.has-quota { gap: 14px; }
.channel-report-drill-title > .channel-report-title-text { flex: 0 1000 auto; }
.channel-report-drill-title > .channel-report-quota { flex: 0 1 auto; display: inline-flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 500; color: #64748b; font-variant-numeric: tabular-nums; }
.channel-report-quota-item { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.channel-report-quota-item strong { font-weight: 700; color: #0f172a; }
.channel-report-quota-item.limit { padding-right: 10px; border-right: 1px solid #e2e8f0; }
.channel-report-quota-item.within strong { color: #166534; }
.channel-report-quota-item.over strong { color: #b91c1c; }
.channel-report-quota-item.unlimited strong { color: #0369a1; }
.channel-report-quota-item.remaining strong { color: #15803d; }
.channel-report-chart-reset { flex: none; height: 18px; padding: 0 8px; border: 1px solid #bfdbfe; border-radius: 9px; background: #eff6ff; color: #1d4ed8; font-size: 11px; line-height: 16px; cursor: pointer; }
.channel-report-chart-reset:hover { background: #dbeafe; }
/* 右栏资源 / Meter 榜点选联动：标题内「取消选择」与日图标题同款小按钮；选中行加深，其余行淡出（Power BI 式高亮） */
.channel-report-ranking-title { display: flex; align-items: center; justify-content: center; gap: 8px; }
.channel-report-ranking-title > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bar-row.is-selectable { cursor: pointer; border-radius: 3px; }
.bar-row.is-selectable:hover { background: #f1f5f9; }
.bar-row.is-selectable:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.bar-list.has-selection .bar-row:not(.is-selected) { opacity: .42; }
.bar-row.is-selected .bar-label { color: #1e3a8a; font-weight: 700; }
.channel-report-ranking .bar-row.is-selected .bar-fill { background: #0b4fa0; }
/* 联动结果加载中：依赖服务端结果的面板淡出（资源 / Meter 联动时日图与明细表也依赖服务端） */
.channel-report-focus-dependent, .channel-report-daily-panel, .channel-report-table-frame { transition: opacity .15s; }
.channel-report.is-focus-loading .channel-report-focus-dependent,
.channel-report.is-focus-loading.is-detail-focus .channel-report-daily-panel,
.channel-report.is-focus-loading.is-detail-focus .channel-report-table-frame,
.channel-report-models.is-focus-loading .time-stack { opacity: .45; }
/* ===== 消耗看板 · 模型消耗分布（一页报告第二页，与报告同宽、同一横向滚动） ===== */
.channel-report-models {
  box-sizing: border-box; width: 1400px; min-width: 1400px; margin-top: 12px; padding: 14px 20px 12px;
  color: #202124; background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow);
}
.channel-models-head { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 8px; padding-bottom: 10px; border-bottom: 1px solid #e5e7eb; }
.channel-models-identity { display: grid; gap: 3px; min-width: 260px; }
.channel-models-identity h3 { margin: 0; font-size: 17px; color: #202124; }
.channel-models-identity .muted { font-size: 12px; font-variant-numeric: tabular-nums; }
.channel-models-focus { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; font-size: 12px; }
.channel-focus-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 380px; height: 24px; padding: 0 9px; border: 1px solid #bfdbfe; border-radius: 12px; background: #eff6ff; color: #1d4ed8; font-size: 12px; cursor: pointer; }
.channel-focus-chip > span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.channel-focus-chip > b { flex: none; font-size: 13px; line-height: 1; }
.channel-focus-chip:hover, .channel-focus-chip:focus-visible { border-color: #2563eb; background: #dbeafe; }
.channel-models-loading { color: #64748b; font-size: 12px; }
.channel-models-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.channel-models-error { display: flex; align-items: center; gap: 10px; }
.channel-models-note { margin: 8px 0 0; font-size: 11.5px; }
/* 时间堆积图：SVG 按面板像素宽生成（宽度变了整页重建），提示框沿用 .chart-tip 深色样式 */
.time-stack { display: grid; gap: 8px; }
.time-stack-plot { position: relative; min-width: 0; }
.time-stack-svg { display: block; width: 100%; height: auto; }
.time-stack-grid { stroke: #eef2f7; stroke-width: 1; }
.time-stack-axis { stroke: #cbd5e1; stroke-width: 1; }
.time-stack-tick { fill: #64748b; font-size: 11px; font-variant-numeric: tabular-nums; }
.time-stack-label { fill: #475569; font-size: 11px; }
.time-stack-band { fill: #e2e8f0; opacity: .6; }
.time-stack-guide { stroke: #475569; stroke-width: 1; stroke-dasharray: 3 3; }
.time-stack-seg.is-active { stroke: #111827; stroke-width: 1.5; }
.time-stack-area { fill-opacity: .82; stroke: #fff; stroke-width: .6; }
.time-stack-hit { fill: transparent; outline: none; }
.time-stack-hit:focus-visible { stroke: #2563eb; stroke-width: 2; }
.time-stack-tip { position: fixed; min-width: 230px; max-width: 380px; }
.time-stack-tip b { margin-bottom: 4px; color: #fff; font-size: 13px; }
.time-stack-tip-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 8px; color: #e5e7eb; }
.time-stack-tip-row i { width: 9px; height: 9px; border-radius: 2px; }
.time-stack-tip-row i.is-blank { background: transparent; }
.time-stack-tip-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.time-stack-tip-row strong { font-variant-numeric: tabular-nums; }
.time-stack-tip-row.is-total { margin-bottom: 2px; padding-bottom: 3px; border-bottom: 1px solid rgba(255, 255, 255, .18); color: #fff; }
.time-stack-tip-row.is-active { color: #fff; font-weight: 700; }
.time-stack-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; }
.time-stack-legend-item { display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px; border: 0; border-radius: 4px; background: none; color: #475569; font-size: 12px; cursor: pointer; }
.time-stack-legend-item:hover, .time-stack-legend-item:focus-visible { background: #f1f5f9; }
.time-stack-legend-item i { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.time-stack-legend-item.is-off { color: #94a3b8; text-decoration: line-through; }
.time-stack-legend-item.is-off i { background: #cbd5e1 !important; }
.time-stack-legend-item[disabled] { cursor: default; }
.chart-axis-link { fill: #1d4ed8; cursor: pointer; text-decoration: underline dotted; }
.chart-axis-link:hover, .chart-axis-link:focus-visible { fill: #1e3a8a; text-decoration: underline; outline: none; }
/* 已结束的订阅组 / 客户名称灰字（与 charts.js ENDED_AXIS_FILL 同色），对应主图斜纹柱；悬停略加深，选中时仍按选中样式 */
.chart-axis-link.is-ended { fill: #94a3b8; }
.chart-axis-link.is-ended:not(.is-selected):hover, .chart-axis-link.is-ended:not(.is-selected):focus-visible { fill: #64748b; }
.chart-axis-link.is-selected { fill: #1e3a8a; font-weight: 700; text-decoration: underline; }
.channel-mail-scope { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.channel-mail-scope-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; font-size: 13px; }
.channel-mail-scope-head .muted { font-size: 12px; }
.channel-mail-scope-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 8px 14px; }
.channel-mail-scope-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: 'check name usd badge' '. meta meta action'; align-items: center; gap: 2px 8px; min-width: 0; padding: 7px 8px; border-radius: 6px; font-size: 12.5px; }
.channel-mail-scope-item:hover { background: #f8fafc; }
.channel-mail-scope-item input { grid-area: check; width: auto; margin: 0; cursor: pointer; }
.channel-mail-scope-name { grid-area: name; min-width: 0; overflow-wrap: anywhere; font-weight: 600; cursor: pointer; }
.channel-mail-scope-meta { grid-area: meta; min-width: 0; font-size: 11.5px; overflow-wrap: anywhere; }
.channel-mail-scope-meta .tag { margin-left: 6px; font-size: 11px; }
.channel-mail-scope-usd { grid-area: usd; font-variant-numeric: tabular-nums; white-space: nowrap; }
.channel-mail-scope-badge { grid-area: badge; justify-self: end; padding: 1px 7px; border-radius: 9px; font-size: 11px; white-space: nowrap; background: #dcfce7; color: #166534; }
.channel-mail-scope-actions { grid-area: action; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 4px; }
.channel-mail-scope-settings { padding: 1px 8px; border-radius: 6px; font-size: 11.5px; line-height: 1.5; white-space: nowrap; }
.channel-directory-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.channel-directory-body { margin-top: 10px; } /* 折叠时 hidden → display:none，卡片只剩表头信息 */
.channel-directory-toggle { display: inline-flex; align-items: baseline; gap: 6px; padding: 0; border: 0; background: none; box-shadow: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.channel-directory-toggle:hover { color: var(--primary); background: none; }
.channel-directory-caret { display: inline-block; width: 12px; color: var(--muted); font-size: 12px; transition: transform .15s; }
.channel-directory-toggle[aria-expanded="true"] .channel-directory-caret { transform: rotate(90deg); }
.channel-profile-auto[hidden] { display: none; } /* button 的显式 display 会覆盖 hidden 属性默认样式：无可一键指定的渠道时须真正隐藏 */
/* 各渠道表格统一固定列宽（tableKit .tk-fixed-cols 不写内联列宽）：多张卡片 8 列上下对齐，窄屏横向滚动 */
.channel-directory-table { table-layout: fixed; min-width: 1160px; }
.channel-directory-table th { white-space: normal; }
.channel-directory-table td { overflow-wrap: anywhere; }
.channel-directory-table th:nth-child(1) { width: 20%; }
.channel-directory-table th:nth-child(2) { width: 18%; }
.channel-directory-table th:nth-child(3) { width: 17%; }
.channel-directory-table th:nth-child(4) { width: 8%; }
.channel-directory-table th:nth-child(5) { width: 6%; }
.channel-directory-table th:nth-child(6), .channel-directory-table th:nth-child(7) { width: 9%; }
.channel-directory-table th:nth-child(8) { width: 13%; }
.channel-directory-table td:nth-child(4) { white-space: nowrap; }
.channel-directory-section td { vertical-align: top; }
.channel-directory-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.channel-directory-actions > button, .channel-directory-actions > .btn { padding: 2px 9px; border-radius: 6px; font-size: 12px; line-height: 1.5; white-space: nowrap; }
.channel-directory-owner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; font-size: 12.5px; }
.channel-directory-owner select { max-width: 280px; padding: 3px 8px; font-size: 12.5px; }
.channel-directory-owner > button { padding: 2px 10px; font-size: 12px; line-height: 1.5; }
.channel-account-section { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 4px; }
.channel-account-section h3 { margin: 10px 0 4px; font-size: 15px; }
.channel-account-section table { margin-top: 6px; }
.channel-account-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 8px; }
.channel-account-form input[type="text"] { flex: 1; min-width: 180px; }
.channel-account-voided .channel-account-amount { color: var(--muted); text-decoration: line-through; }
.discount-settings-list { display: grid; gap: 8px; }
.discount-settings-heading { margin: 14px 0 6px; font-weight: 600; }
.discount-settings-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 6px; overflow-wrap: anywhere; }
.discount-settings-row .muted { font-size: 12px; }
.discount-settings-row label { display: flex; gap: 6px; align-items: center; }
.discount-settings-row input { width: 110px; }
.recharge-settings-toolbar { margin-bottom: 10px; flex-wrap: wrap; }
.recharge-settings-toolbar > select, .recharge-settings-toolbar > input { max-width: 100%; min-width: 0; }
@media screen and (max-width: 600px) {
  .recharge-settings-toolbar > select, .recharge-settings-toolbar > input { width: 100% !important; }
  .recharge-settings .form-grid { grid-template-columns: minmax(0, 1fr); }
  .channel-mail-scope-item { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: 'check name name' '. usd badge' '. meta meta' '. action action'; }
  .discount-settings-row { grid-template-columns: minmax(0, 1fr); }
}
.channel-mail-scope-item.is-excluded { color: #6b7280; }
.channel-mail-scope-item.is-excluded .channel-mail-scope-name { font-weight: 500; text-decoration: line-through; }
.channel-mail-scope-item.is-excluded .channel-mail-scope-badge { background: #f3f4f6; color: #6b7280; }
.channel-report-table-total { display: grid; grid-template-columns: 12fr 7fr 17fr 13fr 12fr 17fr 6fr 8fr 8fr; flex: none; min-height: 28px; padding-right: 15px; background: #fff; border-top: 2px solid #60a5fa; box-shadow: 0 -1px 0 #fff; font-size: 11px; font-weight: 700; }
.channel-report-table-total > span { min-width: 0; padding: 5px 7px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.channel-report-id { color: #64748b; font-family: Consolas, monospace; font-size: 10.5px; }
.channel-email-form { display: grid; gap: 12px; }
.channel-email-addresses { display: grid; grid-template-columns: repeat(2, minmax(320px, 1fr)); gap: 12px; }
.channel-email-addresses .field { min-width: 0; margin: 0; }
.channel-email-addresses input { width: 100%; min-width: 0; box-sizing: border-box; }
.channel-email-schedule { display: grid; gap: 4px; min-width: 0; }
.channel-email-schedule-label { font-size: 13px; color: var(--muted); }
.channel-email-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.channel-email-controls > input, .channel-email-controls > button { box-sizing: border-box; height: 36px; margin: 0; }
.channel-email-controls > input { flex: 0 0 200px; width: 200px; min-width: 0; }
.channel-email-controls > button { padding: 0 14px; line-height: 34px; white-space: nowrap; }
.channel-email-controls > .channel-email-preset { padding: 0 12px; font-size: 12.5px; }
.channel-email-enabled { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 4px; font-size: 13px; white-space: nowrap; cursor: pointer; }
.channel-email-enabled input { width: auto; margin: 0; }
.channel-email-divider { width: 1px; height: 22px; margin: 0 4px; background: var(--border); }
@media (max-width: 1440px) {
  .channel-report-scroll { border: 1px solid var(--border); }
  .channel-report { border: 0; box-shadow: none; }
  .channel-report-models { margin-top: 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; box-shadow: none; }
}
@media (max-width: 760px) {
  .channel-email-addresses { grid-template-columns: 1fr; }
  .channel-email-controls > input { flex: 1 1 100%; width: 100%; }
  .channel-email-divider { display: none; }
  .channel-mail-scope-list { grid-template-columns: 1fr; }
}

/* ===== 登录页 ===== */
body.login-page #main { padding: 0; max-width: none; }
.login-wrap { box-sizing: border-box; min-height: 100vh; display: flex; align-items: center; justify-content: center; width: 100%; position: relative; overflow: hidden; padding-bottom: 54px; background: linear-gradient(135deg, #eaf3fc 0%, #e7eefb 45%, #eef6fd 100%); }
.login-blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; pointer-events: none; will-change: transform; }
.login-blob.b1 { width: 480px; height: 480px; left: -140px; top: -120px; background: radial-gradient(circle at 30% 30%, #aecffb, #cfe3fd 65%, transparent 72%); animation: fx-d1 22s ease-in-out infinite alternate; }
.login-blob.b2 { width: 540px; height: 540px; right: -180px; bottom: -160px; background: radial-gradient(circle at 60% 40%, #c3d2ff, #d9e6ff 60%, transparent 72%); animation: fx-d2 26s ease-in-out infinite alternate; }
.login-blob.b3 { width: 380px; height: 380px; left: 8%; top: 55%; opacity: .5; background: radial-gradient(circle at 45% 45%, #b5f0f0, #d3f4f8 60%, transparent 74%); animation: fx-d3 19s ease-in-out infinite alternate; }
@keyframes fx-d1 { to { transform: translate(90px, 60px) scale(1.12); } }
@keyframes fx-d2 { to { transform: translate(-110px, -70px) scale(1.08); } }
@keyframes fx-d3 { to { transform: translate(-70px, -90px) scale(.9); } }
.fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.fx-ripple { position: absolute; width: 10px; height: 10px; border-radius: 50%; border: 2px solid rgba(90, 150, 235, .6); box-shadow: 0 0 18px rgba(120, 180, 255, .45) inset; transform: translate(-50%, -50%); pointer-events: none; z-index: 0; animation: fx-ripple .85s cubic-bezier(.2, .6, .3, 1) forwards; }
@keyframes fx-ripple {
  from { opacity: .9; width: 10px; height: 10px; border-width: 2.5px; }
  to { opacity: 0; width: 240px; height: 240px; border-width: 1px; }
}
@media (prefers-reduced-motion: reduce) {
  .login-blob { animation: none; }
  .fx-canvas, .fx-ripple { display: none; }
}
.login-card { position: relative; z-index: 1; width: 360px; background: none; border: none; box-shadow: none; border-radius: 16px; padding: 30px; }
.login-card h1 { text-align: center; font-size: 20px; }
.login-card button { width: 100%; margin-top: 6px; }
.login-footer { position: absolute; z-index: 1; left: 20px; right: 20px; bottom: 18px; color: #64748b; font-size: 12px; line-height: 1.5; text-align: center; }
@media (max-width: 480px) {
  .login-wrap { padding-bottom: 66px; }
  .login-footer { left: 14px; right: 14px; bottom: 14px; }
}
@media (max-height: 560px) {
  .login-card { padding-top: 8px; padding-bottom: 8px; }
  .login-card form > img { width: 100px !important; margin-bottom: 2px !important; }
  .login-card h1 { margin: 6px 0; }
}

/* ===== toast/modal ===== */
#toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #1e293b; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); font-size: 13.5px; max-width: 380px; white-space: pre-wrap; }
.toast.err { background: #b91c1c; } .toast.ok { background: #15803d; }
#modal-wrap, .modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
#modal-wrap.hidden { display: none; }
.modal { background: #fff; border-radius: 12px; padding: 22px 24px; width: 560px; max-width: 96vw; max-height: 92vh; overflow-y: auto; position: relative; }
.modal h2 { margin-top: 0; padding-right: 26px; }
.modal-close { position: absolute; top: 10px; right: 12px; width: 30px; height: 30px; padding: 0; border: none; background: transparent; color: #94a3b8; font-size: 22px; line-height: 1; cursor: pointer; border-radius: 8px; }
.modal-close:hover { background: #f1f5f9; color: #334155; }
@keyframes modalShake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
.modal-shake { animation: modalShake .32s ease; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.modal pre { background: #0f172a; color: #e2e8f0; padding: 12px; border-radius: 8px; font-size: 12px; overflow-x: auto; white-space: pre-wrap; }
.totp-manager { min-width: 0; }
.totp-table-scroll { width: 100%; overflow-x: auto; }
.totp-table { min-width: 1100px; }
.totp-table td:nth-child(2) { overflow-wrap: anywhere; }
.totp-table th:nth-child(5) { min-width: 165px; }
.totp-table th:last-child { min-width: 200px; }
.totp-table th:last-child .tk-handle { right: 0; }
.totp-binding-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 6px 10px; align-items: start; }
.totp-binding-inputs { display: grid; gap: 6px; min-width: 0; }
.totp-binding-inputs input { width: 100%; min-width: 0; }
.totp-customer-picker .customer-picker-panel { width: 100%; max-width: 100%; }
@media screen and (max-width: 720px) {
  .totp-binding-fields { grid-template-columns: minmax(0, 1fr); }
}

/* ===== 向导 ===== */
.wizard-steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.wizard-step { flex: 1; min-width: 110px; text-align: center; padding: 8px 4px; background: #eef2f7; border-radius: 8px; font-size: 12.5px; color: var(--muted); }
.wizard-step.active { background: var(--primary); color: #fff; }
.wizard-step.done { background: #dcfce7; color: var(--ok); }
.devicecode-box { text-align: center; padding: 16px; }
.devicecode-box .code { font-size: 30px; font-weight: 700; letter-spacing: 5px; color: var(--primary); margin: 8px 0; user-select: all; }
.sub-check { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; cursor: pointer; }
.sub-check:hover { border-color: var(--primary); }
.sub-check input { width: auto; }

.mono { font-family: Consolas, monospace; font-size: 12.5px; }
/* 可复制 ID：悬停浮现复制小按钮（触屏无 hover 时常显半透明） */
.copy-chip { display: inline-flex; align-items: center; gap: 3px; }
.copy-chip-btn { opacity: 0; display: inline-flex; align-items: center; border: none; background: none; cursor: pointer; padding: 1px 2px; line-height: 1; color: #64748b; border-radius: 4px; transition: opacity .12s; }
.copy-chip:hover .copy-chip-btn, .copy-chip-btn:focus-visible { opacity: 1; }
.copy-chip-btn:hover { color: #0f6cbd; background: #eef4fb; }
@media (hover: none) { .copy-chip-btn { opacity: .55; } }
.copyable-field { margin-bottom: 12px; }
.copyable-field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.copy-field { display: flex; align-items: stretch; min-width: 0; }
.copy-field > input { flex: 1; width: auto; min-width: 0; border-radius: 8px 0 0 8px; }
.copy-field-btn { flex: none; width: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 0 8px 8px 0; border-left: 0; background: #f8fafc; color: #64748b; }
.copy-field-btn:hover { background: #eef4fb; color: var(--primary); }
.copy-field-btn svg { width: 15px; height: 15px; }
.muted { color: var(--muted); }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
a.plain { color: var(--primary); }
@media (max-width: 760px) {
  #main { padding: 64px 14px 14px; }
  .mobile-nav-button {
    display: inline-flex; position: fixed; z-index: 102; top: 12px; left: 12px; width: 40px; height: 40px; padding: 0;
    align-items: center; justify-content: center; border-color: #cbd5e1; background: #fff; box-shadow: var(--shadow); font-size: 20px;
  }
  .login-page .mobile-nav-button { display: none; }
  .mobile-nav-backdrop { position: fixed; z-index: 100; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; background: rgba(15,23,42,.42); }
  .mobile-nav-backdrop:not([hidden]) { display: block; }
  #sidebar, #sidebar.collapsed {
    display: flex; position: fixed; z-index: 101; inset: 0 auto 0 0; width: min(84vw, 300px); height: 100dvh;
    transform: translateX(-102%); transition: transform .2s ease; box-shadow: 8px 0 28px rgba(15,23,42,.28);
  }
  #sidebar.mobile-open { transform: translateX(0); }
  #sidebar.hidden { display: none; }
  #sidebar.collapsed .brand { padding: 18px 16px; justify-content: flex-start; }
  #sidebar.collapsed .brand-text { display: block; }
  #sidebar.collapsed #nav { padding: 10px 8px; }
  #sidebar.collapsed #nav a { padding: 9px 12px; text-align: left; font-size: 14px; }
  #sidebar.collapsed #nav a::before { display: none; }
  #sidebar.collapsed .sidebar-foot { padding: 12px 16px; text-align: left; }
  #sidebar.collapsed #whoami { display: block; }
  #sidebar.collapsed .sidebar-foot a { display: block; padding: 4px 0; font-size: 13px; }
  #sidebar.collapsed .sidebar-foot a::before { display: none; }
  .nav-flyout { display: block; position: static; min-width: 0; padding: 0 0 2px 14px; background: none; border: 0; box-shadow: none; }
  #sidebar #nav .nav-flyout a, #sidebar.collapsed #nav .nav-flyout a { padding: 7px 12px; font-size: 13px; }
  #nav .nav-planned { padding: 7px 12px; font-size: 13px; }
  #nav .nav-group > a::after { content: none; }
  body.mobile-nav-open { overflow: hidden; }
}

/* ===== 对账单（Power BI 风格三栏） ===== */
.bill-layout { display: flex; gap: 14px; align-items: flex-start; }
.bill-nav { width: 240px; flex-shrink: 0; padding: 14px; position: sticky; top: 10px; height: calc(100vh - 20px); max-height: calc(100vh - 20px); overflow: hidden; display: flex; flex-direction: column; transition: width .18s ease, padding .18s ease; }
.bill-nav-inner { display: flex; flex-direction: column; flex: 1; min-height: 0; height: 100%; overflow: hidden; }
.bill-nav h2, .bill-filters h2 { font-size: 14px; margin: 0 0 10px; }
/* 左（客户目录）右（筛选器）两栏共用的折叠头部 */
.bill-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 2px; flex: none; }
.bill-panel-head h2 { margin: 0; }
.bill-panel-toggle { width: 28px; height: 28px; flex: none; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: #64748b; font-size: 22px; line-height: 1; }
.bill-panel-toggle:hover { background: #f1f5f9; color: var(--primary); }
.bill-nav.collapsed { width: 42px; height: auto; padding: 8px 6px; overflow: hidden; }
.bill-nav.collapsed .bill-panel-head { justify-content: center; margin-bottom: 0; }
.bill-nav.collapsed .bill-panel-head h2, .bill-nav.collapsed .bill-nav-inner { display: none; }
.bill-nav-controls { display: grid; gap: 6px; margin-bottom: 7px; flex: none; }
.bill-nav-controls input, .bill-nav-controls select { width: 100%; min-width: 0; font-size: 12px; padding: 6px 8px; }
.hq-bill-nav-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.hq-bill-nav-search { grid-column: 1 / -1; }
.hq-bill-nav-search input { width: 100%; }
.bill-nav-search { display: grid; grid-template-columns: minmax(0, 1fr); }
.bill-nav-search input { width: 100%; box-sizing: border-box; }
.bill-nav-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; min-width: 0; }
.bill-nav-selects-wide { grid-template-columns: 1fr; }
.bill-nav-count { color: var(--muted); font-size: 11px; margin: 0 2px 7px; }
/* 左侧客户目录激活的区域筛选提示条（仅在右侧勾选了公司名称区域/地址区域时显示） */
.bill-nav-region-chip {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 6px;
  margin: 0 0 7px; padding: 6px 8px; border-radius: 7px;
  background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; font-size: 11.5px; line-height: 1.4; flex: none;
}
.bill-nav-region-text { min-width: 0; flex: 1 1 auto; word-break: break-word; font-weight: 500; }
.bill-nav-region-actions { display: inline-flex; gap: 6px; flex: none; white-space: nowrap; }
.bill-nav-region-actions .link-btn { padding: 0; font-size: 11.5px; font-weight: 600; color: #1d4ed8; }
.bill-nav-region-actions .link-btn:hover { text-decoration: underline; }
.bill-nav-list { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 3px; scrollbar-gutter: stable; }
.bill-nav-list > * { flex: none; } /* 列表项按内容高度排布并溢出滚动，避免 61 项被压扁重叠 */
.bill-nav-item { display: block; padding: 8px 10px; border-radius: 7px; color: #334155; text-decoration: none; font-size: 13px; overflow: hidden; }
.bill-nav-item:hover { background: #f1f5f9; }
.bill-nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
/* 分订阅出账客户的订阅子条目：缩进 + 左侧连线，点击直达该订阅单独对账单 */
.bill-nav-item.bill-nav-sub { margin-left: 14px; padding: 6px 8px; border-left: 2px solid #e2e8f0; border-radius: 0 7px 7px 0; font-size: 12.5px; }
.bill-nav-item.bill-nav-sub.active { border-left-color: var(--primary); }
.help-toc-group { margin: 10px 2px 4px; padding-top: 8px; border-top: 1px solid #e2e8f0; color: #64748b; font-size: 12px; font-weight: 700; } /* 帮助中心目录分组标题（开发者文档） */
.bill-nav-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bill-nav-name-alt { margin-top: 1px; color: #64748b; font-size: 11.5px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bill-nav-item.active .bill-nav-name-alt { color: rgba(255,255,255,.88); }
.bill-nav-meta { display: flex; gap: 8px; margin-top: 3px; color: #64748b; font-size: 11px; font-weight: 500; line-height: 1.35; white-space: nowrap; overflow: hidden; }
.bill-nav-meta > span { flex: none; }
.bill-nav-meta > .shrink { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; min-width: 2em; }
.bill-nav-item.active .bill-nav-meta { color: rgba(255,255,255,.9); }
.bill-nav-meta > .bill-nav-channel { color: #0369a1; font-weight: 600; }
.bill-nav-meta > .bill-nav-channel:not(.shrink) { max-width: 11em; overflow: hidden; text-overflow: ellipsis; } /* 订阅组条目：简称完整显示，超长才截断 */
.bill-nav-item.active .bill-nav-meta > .bill-nav-channel { color: #fff; }
.bill-nav-item.is-ended:not(.is-end-usage):not(.active) .bill-nav-meta > .bill-nav-channel { color: inherit; }
/* 已标记结束的订阅组 / 客户：灰色标签 + 淡化 + 虚线连线；结束后仍有消耗改红色、不淡化 */
.bill-nav-name-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bill-nav-name-row > .bill-nav-name { flex: 1 1 auto; min-width: 0; }
.bill-nav-name-row > .bill-nav-end { flex: none; margin-left: auto; padding: 0 6px; border-radius: 99px; background: #e2e8f0; color: #475569; font-size: 11px; font-weight: 600; line-height: 1.5; }
.bill-nav-item.is-ended:not(.is-end-usage):not(.active), .bill-nav-item.is-ended:not(.is-end-usage):not(.active) .bill-nav-meta,
.bill-nav-item.is-ended:not(.is-end-usage):not(.active) .bill-nav-name-alt { color: #94a3b8; }
.bill-nav-item.bill-nav-sub.is-ended:not(.active) { border-left-style: dashed; border-left-color: #cbd5e1; }
.bill-nav-item.is-end-usage .bill-nav-name-row > .bill-nav-end { background: #fee2e2; color: #b91c1c; }
.bill-nav-item.bill-nav-sub.is-end-usage:not(.active) { border-left-color: #f87171; }
.bill-nav-item.active .bill-nav-name-row > .bill-nav-end { background: rgba(255,255,255,.22); color: #fff; }
.bill-nav-item.active.is-end-usage .bill-nav-name-row > .bill-nav-end { background: #fee2e2; color: #b91c1c; }
/* 禁用登记（连接与授权「禁用登记 / 客户停用登记」）：已禁用红色、申请中 / 部分禁用橙色，仅内部账号可见；与「已结束」并排 */
.bill-nav-name-row > .bill-nav-disable { flex: none; padding: 0 6px; border-radius: 99px; font-size: 11px; font-weight: 600; line-height: 1.5; background: #ffedd5; color: #c2410c; }
.bill-nav-name-row > .bill-nav-end + .bill-nav-disable { margin-left: 0; }
.bill-nav-name-row > .bill-nav-name + .bill-nav-disable { margin-left: auto; }
.bill-nav-name-row > .bill-nav-disable.is-disabled { background: #fee2e2; color: #b91c1c; }
.bill-nav-item.active .bill-nav-name-row > .bill-nav-disable { background: #fff; }
.bill-nav-item.bill-nav-sub.is-disable-registered:not(.active) { border-left-style: dashed; border-left-color: #fca5a5; }
.bill-disable-tag { margin-left: 8px; vertical-align: middle; font-size: 12px; font-weight: 600; }
.bill-title h1 .bill-domestic-link { vertical-align: middle; }
.bill-disable-note { margin-top: 4px; font-size: 12px; color: #b91c1c; }
.bill-filters { width: 250px; flex-shrink: 0; padding: 14px; position: sticky; top: 10px; max-height: calc(100vh - 40px); overflow-y: auto; transition: width .18s ease, padding .18s ease; }
.bill-filters.collapsed { width: 42px; padding: 8px 6px; overflow: hidden; }
.bill-filters.collapsed .bill-panel-head { justify-content: center; }
.bill-filters.collapsed .bill-panel-head h2, .bill-filters.collapsed > div:not(.bill-panel-head) { display: none; }
/* 对账单筛选器悬浮态（香港/国内/HQ）：与 .filter-aside 同款——固定在视口右边缘，折叠为 38px 箭头、展开为覆盖在页面上方的面板，
   不占 .bill-layout 宽度，展开/收起不重排账单主体；hq-raw 等默认展开的页仍用上方的行内 sticky 版 */
.bill-filters.bill-filters-drawer {
  position: fixed; z-index: 46; top: 76px; right: 12px; bottom: 12px; width: min(340px, calc(100vw - 24px)); max-height: none;
  padding: 12px; overflow: auto; overscroll-behavior: contain; box-shadow: 0 14px 38px rgba(15,23,42,.2); transition: none;
}
.bill-filters.bill-filters-drawer.collapsed { top: 92px; right: 0; bottom: auto; width: 38px; max-width: 38px; padding: 8px 4px; overflow: hidden; border-radius: 8px 0 0 8px; box-shadow: 0 3px 12px rgba(15,23,42,.16); }
.bill-filters.bill-filters-drawer.collapsed.has-active-filter { border-color: #60a5fa; background: #eff6ff; box-shadow: 0 3px 12px rgba(37,99,235,.22); }
.bill-filters.bill-filters-drawer.collapsed.has-active-filter .bill-panel-toggle { position: relative; color: #1d4ed8; font-weight: 700; }
.bill-filters.bill-filters-drawer.collapsed.has-active-filter .bill-panel-toggle::after {
  content: ''; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: #2563eb;
}
.bill-filter-hint { font-size: 11.5px; line-height: 1.45; margin-bottom: 6px; }
.bill-filter-group { border-top: 1px solid #e2e8f0; }
.bill-filter-group:last-child { border-bottom: 1px solid #e2e8f0; }
.bill-filter-group > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 14px; align-items: center; gap: 8px; padding: 10px 2px; cursor: pointer; font-size: 12.5px; font-weight: 650; color: #334155; list-style: none; }
.bill-filter-group > summary .tag { white-space: nowrap; justify-self: end; }
.bill-filter-title { min-width: 0; }
.bill-filter-badge { text-align: right; font-variant-numeric: tabular-nums; }
.bill-filter-group > summary::-webkit-details-marker { display: none; }
.bill-filter-group > summary::after { content: '›'; order: 3; color: #94a3b8; font-size: 18px; line-height: 1; transform: rotate(90deg); transition: transform .15s ease; }
.bill-filter-group[open] > summary::after { transform: rotate(-90deg); }
.bill-filter-group-body { padding: 0 2px 10px; }
.bill-filter-group-body .field { margin-bottom: 8px; }
.bill-filter-group-body .field > span { font-size: 11.5px; }
.bill-filter-info { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: baseline; font-size: 12px; }
.bill-filter-info span { color: var(--muted); }
.bill-filter-info strong { text-align: right; overflow-wrap: anywhere; }
.bill-filter-svcs { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; margin-top: 6px; }
.bill-filter-svc { display: flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; }
.bill-filter-svc input { width: auto; margin: 0; }
.bill-filter-svc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bill-filter-svc small { margin-left: auto; color: var(--muted); font-size: 10.5px; }
.bill-filter-select-all { padding-bottom: 5px; margin-bottom: 1px; border-bottom: 1px solid #e2e8f0; }
.bill-filter-search { width: 100%; min-width: 0; padding: 6px 8px; font-size: 12px; }
.bill-main { flex: 1; min-width: 0; padding: 26px 32px; }
/* 切换客户/订阅/订阅组取数期间：保留上一份账单淡化显示，数据到齐后一次性替换（无闪白、不塌陷） */
.bill-main.bill-switching { opacity: .55; pointer-events: none; transition: opacity .15s ease .08s; }
.period-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.period-chip { padding: 4px 12px; border: 1px solid #cbd5e1; border-radius: 999px; background: #fff; font-size: 12.5px; cursor: pointer; color: #334155; }
.period-chip:hover:not(:disabled) { border-color: #2563eb; color: #2563eb; }
.period-chip.active { background: #2563eb; border-color: #2563eb; color: #fff; font-weight: 600; }
.period-chip:disabled { opacity: 0.35; cursor: not-allowed; }
.reconcile-toolbar { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; padding: 10px 16px; }
.reconcile-toolbar-left { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; white-space: nowrap; }
.reconcile-mode-controls { display: flex; align-items: center; gap: 6px; flex: none; }
.reconcile-mode-controls button, .reconcile-toolbar-actions button { padding: 7px 10px; white-space: nowrap; }
.reconcile-mode-controls button.active { background: #10243e; border-color: #10243e; color: #fff; font-weight: 650; }
.reconcile-range-controls { display: flex; align-items: center; gap: 6px; min-width: 0; }
.time-quick-controls { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.time-quick-controls button { padding-inline: 8px; }
.reconcile-range-controls label { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.month-year-picker { position: relative; display: inline-flex; }
.month-year-picker.open { z-index: 50; }
.reconcile-toolbar:has(.month-year-picker.open) { z-index: 60; }
.month-year-picker > input { display: none; }
.month-picker-trigger {
  width: 142px;
  min-height: 30px;
  padding: 6px 30px 6px 7px;
  color: var(--text);
  text-align: left;
  font-size: 12px;
  font-weight: 400;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  white-space: nowrap;
}
.month-picker-trigger::after { content: 'v'; position: absolute; right: 8px; color: var(--muted); font-size: 12px; }
.month-picker-panel {
  position: absolute;
  z-index: 61;
  top: calc(100% + 4px);
  left: 0;
  width: 226px;
  padding: 8px;
  background: #fff;
  opacity: 1;
  border: 1px solid var(--border);
  box-shadow: 0 8px 20px rgb(15 23 42 / 18%);
}
.month-picker-heading { display: flex; align-items: center; justify-content: center; min-height: 28px; color: var(--text); font-size: 12px; font-weight: 700; }
.month-picker-heading.month-picker-year { display: block; width: 100%; margin-bottom: 4px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; text-align: left; }
.month-picker-back { position: absolute; left: 8px; padding: 2px 7px; border: 0; background: transparent; font-size: 20px; line-height: 1; }
.month-picker-months, .month-picker-years { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
.month-picker-months button, .month-picker-years button { min-width: 0; padding: 7px 2px; border: 0; border-radius: 0; background: transparent; color: var(--text); font-size: 12px; }
.month-picker-months button:hover, .month-picker-years button:hover { background: #e5f1ff; }
.month-picker-months button.selected, .month-picker-years button.selected { background: #9ca3af; color: #fff; font-weight: 700; }
.month-picker-months button:disabled { color: var(--muted); background: transparent; cursor: not-allowed; }
.reconcile-range-controls input[type="month"] { width: 142px; padding: 6px 7px; font-size: 12px; } /* 英文月份（如 September 2026）+ 日历图标完整显示 */
.reconcile-range-controls input[type="date"] { width: 120px; padding: 6px 7px; font-size: 12px; }
.reconcile-range-controls select { width: 82px; padding: 6px 7px; font-size: 12px; }
.reconcile-range-controls button { padding: 7px 10px; white-space: nowrap; }
.reconcile-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: none; margin-left: auto; }
.export-dropdown { position: relative; }
.export-dropdown > summary { list-style: none; cursor: pointer; padding: 7px 10px; white-space: nowrap; border-radius: 6px; }
.export-dropdown > summary::-webkit-details-marker { display: none; }
.export-dropdown > summary::after { content: ' ▾'; font-size: 10px; }
.export-dropdown[open] > summary::after { content: ' ▴'; }
.export-dropdown-menu { position: absolute; z-index: 30; top: calc(100% + 5px); right: 0; display: grid; min-width: 220px; padding: 5px; background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 10px 28px rgba(15, 23, 42, .16); }
.export-dropdown-menu button { width: 100%; text-align: left; border: 0; background: transparent; }
.export-dropdown-menu button:hover { background: #eef6ff; }
.bill-bind-dropdown > summary, .toolbar-more > summary { border: 1px solid var(--border); background: #fff; color: var(--fg); font-size: 13px; }
.bill-bind-dropdown > summary:hover, .toolbar-more > summary:hover { background: #f8fafc; }
.toolbar-more[hidden] { display: none; }
.toolbar-more .export-dropdown-menu { min-width: 160px; }
@media (max-width: 1350px) {
  .reconcile-toolbar { flex-wrap: wrap; }
  .reconcile-toolbar-left { flex-wrap: wrap; }
  .reconcile-range-controls { flex-wrap: wrap; }
  .reconcile-toolbar-actions { margin-left: auto; }
}
@media (max-width: 850px) {
  .reconcile-toolbar-left, .reconcile-toolbar-actions { width: 100%; flex-wrap: wrap; justify-content: flex-start; }
  .reconcile-toolbar-actions { margin-left: 0; }
  .time-quick-controls { width: 100%; flex-wrap: wrap; }
}
.bill-title { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; border-bottom: 2px solid #0f172a; padding-bottom: 12px; margin-bottom: 18px; }
.bill-title h1 { min-width: 0; line-height: 1.25; overflow-wrap: anywhere; }
.bill-title h1.long { font-size: 18px; }
.bill-title h1.very-long { font-size: 15px; }
.bill-title > .muted { grid-column: 1 / -1; }
.hq-bill-title-name { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hq-bill-title-status { color: var(--err); font-size: 13px; font-weight: 800; white-space: nowrap; }
.bill-brand-logos { margin: 0; display: flex; align-items: center; justify-content: flex-end; justify-self: end; gap: 1px; max-width: none; white-space: nowrap; }
.bill-company-logo { display: block; width: auto; max-width: 150px; height: auto; max-height: 44px; object-fit: contain; }
.bill-azure-logo { display: block; width: auto; max-width: 165px; height: auto; max-height: 38px; object-fit: contain; }
.bill-azure-logo.m365-logo { max-width: 200px; max-height: 42px; }
.m365-refresh-pick { width: 16px; height: 16px; margin: 0 2px 0 0; cursor: pointer; flex: none; }
.m365-group-name { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.m365-group-name .tag { font-weight: 600; }
.brand-logo-preview { min-height: 82px; display: flex; align-items: center; justify-content: center; border: 1px dashed #cbd5e1; background: #f8fafc; padding: 12px; }
.brand-logo-preview img { max-width: 320px; max-height: 72px; object-fit: contain; }

/* ===== 汇率维护 ===== */
.fx-sync-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0; font-size: 13px; }
.fx-entry-form { display: grid; grid-template-columns: minmax(360px, 2.4fr) minmax(130px, .8fr) repeat(2, minmax(80px, .5fr)) minmax(110px, .7fr) minmax(150px, 1fr) auto; gap: 12px; align-items: end; }
.fx-entry-form .field { margin: 0; }
.fx-entry-form input, .fx-entry-form select, .fx-entry-form > button { height: 38px; }
.fx-entry-form > button { min-width: 64px; white-space: nowrap; }
.fx-customer-picker { min-width: 320px; }
/* 单客户税率设置（客户管理行 / 编辑客户 / 应收报告）：起始月 · 税率 · 回到全局默认 · 备注 · 保存 一行对齐，缺「回到全局默认」时不错位 */
.tax-entry-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.tax-entry-form .field { margin: 0; }
.tax-entry-form .tax-entry-period { flex: 0 0 160px; }
.tax-entry-form .tax-entry-rate { flex: 0 0 110px; }
.tax-entry-form .tax-entry-note { flex: 1 1 200px; }
.tax-entry-form .tax-entry-clear { display: flex; align-items: center; gap: 6px; height: 38px; white-space: nowrap; font-size: 13px; }
.tax-entry-form input:not([type=checkbox]), .tax-entry-form > button { height: 38px; box-sizing: border-box; }
.tax-entry-form > button { min-width: 64px; white-space: nowrap; }
/* 编辑客户「开票税率」：只读展示 + 税率设置按钮，与相邻输入框同高 */
.customer-tax-field { margin-bottom: 12px; }
.customer-tax-field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.customer-tax-value { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; box-sizing: border-box; padding: 3px 4px 3px 10px; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; }
.customer-tax-text { font-size: 13px; line-height: 1.4; }
.customer-tax-value > button { padding: 4px 10px; font-size: 12.5px; flex-shrink: 0; }
.customer-tax-value > button[hidden] { display: none; } /* button 的显式 display 会覆盖 hidden 属性默认样式：USD / HKD 或表单口径未保存时须真正隐藏 */
/* 批量结算/汇率/税率：税率区与上方结算 / 汇率分隔，税率 · 起始月 · 备注一行 */
.bulk-tax-section { border-top: 1px dashed var(--border); padding-top: 10px; margin: 2px 0 12px; }
.bulk-tax-title { display: flex; gap: 8px; align-items: baseline; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.bulk-tax-title .muted { font-weight: 400; font-size: 12px; }
.bulk-tax-grid { display: grid; grid-template-columns: 120px 170px minmax(0, 1fr); gap: 12px; }
.bulk-tax-grid .field { margin-bottom: 6px; }
.bulk-tax-hint { font-size: 12px; line-height: 1.6; }
@media (max-width: 1350px) {
  .fx-entry-form { grid-template-columns: repeat(4, minmax(140px, 1fr)); }
  .fx-entry-form .fx-scope-field { grid-column: span 2; }
}
@media (max-width: 900px) {
  .bill-layout { flex-direction: column; }
  .bill-layout > .bill-nav { width: 100%; position: static; height: min(75vh, 650px); max-height: min(75vh, 650px); overflow: hidden; display: flex; }
  .bill-layout > .bill-nav .bill-nav-inner { display: flex; height: 100%; overflow: hidden; }
  .bill-layout > .bill-nav .bill-nav-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 4px; overflow-y: auto; }
  .bill-layout > .bill-main { width: 100%; }
}
@media (max-width: 700px) {
  .fx-entry-form { grid-template-columns: 1fr; }
  .fx-entry-form .fx-scope-field { grid-column: auto; }
  .fx-customer-picker { min-width: 0; }
}

/* ===== Azure / M365 统一订阅视图 ===== */
.subscription-page-actions { justify-content: flex-end; }
.subscription-common-filters { display: grid; grid-template-columns: minmax(260px, 1.5fr) repeat(6, minmax(120px, 1fr)); gap: 10px; width: 100%; }
.subscription-common-filters[hidden] { display: none; }
.recharge-ledger-filters { display: grid; grid-template-columns: minmax(250px, 2fr) repeat(4, minmax(112px, 1fr)) auto auto; gap: 8px; align-items: end; }
.recharge-ledger-filters .customer-picker { min-width: 0; }
.subscription-filter-panel { position: sticky; top: 0; z-index: 30; padding: 0 16px 14px; }
.subscription-filter-head { display: flex; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.subscription-tabs { display: flex; align-self: stretch; gap: 2px; margin-right: auto; }
.subscription-tabs button { border: 0; border-radius: 0; background: transparent; color: #475569; padding: 10px 16px 8px; border-bottom: 3px solid transparent; }
.subscription-tabs button.active { color: var(--primary); font-weight: 700; border-bottom-color: var(--primary); }
.subscription-tabs button:hover { background: #f1f5f9; }
/* 客户档案产品线标签页（全部 | Azure | M365 | … | 多产品 | 未分类）：数量随其他筛选联动 */
.customer-line-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin: -4px 0 10px; border-bottom: 1px solid var(--border); }
.customer-line-tabs button { display: inline-flex; align-items: center; gap: 6px; margin-bottom: -1px; border: 0; border-radius: 0; background: transparent; color: #475569; padding: 9px 14px 7px; border-bottom: 3px solid transparent; }
.customer-line-tabs button.active { color: var(--primary); font-weight: 700; border-bottom-color: var(--primary); }
.customer-line-tabs button:hover { background: #f1f5f9; }
.customer-line-count { min-width: 20px; padding: 0 6px; border-radius: 99px; background: #f1f5f9; color: #64748b; font-size: 11.5px; font-weight: 600; line-height: 18px; text-align: center; }
.customer-line-tabs button.active .customer-line-count { background: #dbeafe; color: var(--primary); }
.customer-line-churned { opacity: .6; }
/* 客户表单「产品线」：占整行；每条 = 勾选 + 状态 + 自动识别说明 */
.product-line-field { grid-column: 1 / -1; margin-bottom: 12px; }
.product-line-field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.product-line-picker { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 2px 0; }
.product-line-option { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.product-line-option label { display: inline-flex; align-items: center; gap: 4px; margin: 0; cursor: pointer; }
.product-line-option select { width: auto; padding: 2px 6px; font-size: 12px; }
.product-line-option .muted { font-size: 11.5px; }
.subscription-filter-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.subscription-filter-head > button:last-child { margin-left: auto; }
.subscription-filter-grid { display: grid; grid-template-columns: minmax(320px, 1.7fr) minmax(190px, 1fr) repeat(6, minmax(110px, .65fr)); gap: 8px; align-items: end; }
.subscription-filter-field { min-width: 0; }
.subscription-filter-field > span { display: block; color: var(--muted); font-size: 11px; margin: 0 0 3px 2px; }
.subscription-filter-field input, .subscription-filter-field select { width: 100%; min-width: 0; }
.subscription-filter-field input[type="checkbox"], .subscription-filter-field input[type="radio"] { width: auto; flex: 0 0 auto; }
.filter-aside .customer-picker-panel { width: 100%; max-width: 100%; }
.filter-aside .customer-picker-option span { white-space: normal; overflow-wrap: anywhere; }
.tenant-cell { min-width: 220px; line-height: 1.45; }
.tenant-cell-name { font-weight: 600; }
.tenant-cell-id { font-size: 11.5px; overflow-wrap: anywhere; }
.tenant-cell-domain { font-size: 11.5px; overflow-wrap: anywhere; }
.subscription-common-filters.kw-only { grid-template-columns: minmax(260px, 560px); }
.subscription-common-filters > [hidden] { display: none; }
.overview-count-btn { padding: 2px 10px; font-size: 12px; }
.subscription-customer-filter { grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr); }
.subscription-group-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 0 0 10px; }
.subscription-group-actions .muted { margin-right: auto; }
.subscription-group-actions button { padding: 4px 9px; font-size: 12px; }
.subscription-resource-group { border-top: 1px solid var(--border); }
.subscription-resource-group:last-child { border-bottom: 1px solid var(--border); }
.subscription-resource-group > summary { padding: 12px 10px; cursor: pointer; display: grid; grid-template-columns: 14px minmax(0, 2.6fr) minmax(110px, .4fr); gap: 10px; align-items: center; list-style: none; }
.subscription-resource-group > summary::-webkit-details-marker { display: none; }
.subscription-resource-group > summary::before { content: '›'; color: var(--muted); font-size: 20px; line-height: 1; transition: transform .15s ease; }
.subscription-resource-group[open] > summary::before { transform: rotate(90deg); }
.subscription-resource-group > summary:hover { background: #f8fafc; }
/* 分组标题：固定列宽网格——客户名弹性列 + 徽章/摘要信息固定列，跨行对齐不随名字长短浮动；折叠态即可浏览概况 */
.subscription-group-title { display: grid; grid-template-columns: minmax(0, 1fr) 96px 84px 170px 150px 120px; gap: 8px; align-items: center; min-width: 0; }
.subscription-group-title .tag { justify-self: start; white-space: nowrap; }
.subscription-group-extra { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subscription-group-extra.warn-text { color: #d97706; }
.subscription-group-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.subscription-group-title strong { overflow-wrap: anywhere; }
.subscription-group-meta { justify-content: flex-end; font-size: 11.5px; }
.subscription-group-meta > span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.subscription-group-meta b { color: var(--muted); font-weight: 500; white-space: nowrap; }
.subscription-group-table { overflow-x: auto; border-top: 1px solid var(--border); }
.subscription-group-table table { min-width: 980px; }
@media (max-width: 1350px) {
  .subscription-filter-grid { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
  .subscription-filter-field:first-child { grid-column: span 2; }
  .subscription-resource-group > summary { grid-template-columns: 14px minmax(0, 1fr); }
  .subscription-group-title { grid-template-columns: minmax(0, 1fr) 96px 84px; }
  .subscription-group-title .subscription-group-extra { display: none; }
  .subscription-group-meta { grid-column: 2; justify-content: flex-start; }
}
@media (max-width: 760px) {
  .subscription-page-actions, .subscription-page-actions > * { width: 100%; }
  .subscription-common-filters { grid-template-columns: 1fr; }
  .recharge-ledger-filters { grid-template-columns: 1fr 1fr; }
  .recharge-ledger-filters .customer-picker { grid-column: 1 / -1; }
  .subscription-filter-panel { position: static; }
  .subscription-group-title { display: flex; flex-wrap: wrap; }
  .subscription-filter-head { align-items: stretch; flex-wrap: wrap; padding: 8px 0; }
  .subscription-tabs { width: 100%; overflow-x: auto; }
  .subscription-tabs button { flex: 1 0 auto; }
  .subscription-filter-head > button:last-child { margin-left: 0; }
  .subscription-filter-grid { grid-template-columns: 1fr; }
  .subscription-filter-field:first-child { grid-column: auto; }
  .subscription-customer-filter { grid-template-columns: 1fr; }
  .subscription-group-actions { justify-content: flex-start; flex-wrap: wrap; }
  .subscription-group-actions .muted { width: 100%; }
}

/* ===== M365 许可业务控件（兼容弹窗） ===== */
.m365-toolbar { align-items: end; }
.m365-customer-filter { grid-template-columns: minmax(180px, 1fr) minmax(170px, 1fr); min-width: min(430px, 100%); }
.m365-group-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 0 0 10px; }
.m365-group-actions .muted { margin-right: auto; }
.m365-group-actions button { padding: 4px 9px; font-size: 12px; }
.m365-license-group { border-top: 1px solid var(--border); }
.m365-license-group:last-child { border-bottom: 1px solid var(--border); }
.m365-license-group > summary { padding: 12px 10px; cursor: pointer; display: grid; grid-template-columns: 14px minmax(220px, .8fr) minmax(0, 2fr); gap: 10px; align-items: center; list-style: none; }
.m365-license-group > summary::-webkit-details-marker { display: none; }
.m365-license-group > summary::before { content: '›'; color: var(--muted); font-size: 20px; line-height: 1; transform: rotate(0deg); transition: transform .15s ease; }
.m365-license-group[open] > summary::before { transform: rotate(90deg); }
.m365-license-group > summary:hover { background: #f8fafc; }
.m365-group-title, .m365-group-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.m365-group-title strong { overflow-wrap: anywhere; }
.m365-group-meta { justify-content: flex-end; font-size: 11.5px; }
.m365-group-meta > span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.m365-group-meta b { color: var(--muted); font-weight: 500; white-space: nowrap; }
.m365-group-table { overflow-x: auto; border-top: 1px solid var(--border); }
.m365-group-table table { min-width: 980px; }
@media (max-width: 1100px) {
  .m365-license-group > summary { grid-template-columns: 14px minmax(0, 1fr); }
  .m365-group-meta { grid-column: 2; }
  .m365-group-meta { justify-content: flex-start; }
}
@media (max-width: 700px) {
  .m365-customer-filter { grid-template-columns: 1fr; min-width: 100%; }
  .m365-toolbar, .m365-toolbar > * { width: 100%; }
  .m365-group-actions { justify-content: flex-start; flex-wrap: wrap; }
  .m365-group-actions .muted { width: 100%; }
}

/* ===== 贺顷（我方）租户身份区（客户订阅页 HQ 标签复用） ===== */
.own-tenant-identity { display: grid; grid-template-columns: minmax(250px, .7fr) minmax(0, 1.6fr); gap: 24px; align-items: center; }
.own-tenant-name h2 { margin: 2px 0 3px; font-size: 18px; }
.own-tenant-name > div:last-child { font-size: 12px; }
.own-tenant-kvs { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)); gap: 12px 18px; margin: 0; }
.own-tenant-kvs div { min-width: 0; }
.own-tenant-kvs dt { color: var(--muted); font-size: 11.5px; }
.own-tenant-kvs dd { margin: 2px 0 0; overflow-wrap: anywhere; }
@media (max-width: 1200px) {
  .own-tenant-identity { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .own-tenant-kvs { grid-template-columns: 1fr; }
}

/* 客户管理 · 创建时间筛选 */
.customer-created-filter-wrap { min-width: 0; }
.customer-created-filter-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; align-items: end; }
.customer-created-filter-dates > input { grid-column: 1 / -1; width: 100%; }
.customer-created-filter-dates label { min-width: 0; }
.customer-created-filter-dates label > span { display: block; margin: 0 0 3px 2px; color: #64748b; font-size: 11px; }
.customer-created-filter-dates input { width: 100%; min-width: 0; }
@media (max-width: 700px) { .customer-created-filter-dates { grid-template-columns: 1fr; } }

/* 测试跟踪 · HQ Foundry 成本归属 */
.trials-foundry-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.trials-foundry-kpis article { padding: 13px 15px; border: 1px solid #dbe3ed; border-top: 3px solid #0284c7; background: #fff; }
.trials-foundry-kpis span { display: block; color: #64748b; font-size: 11.5px; font-weight: 700; }
.trials-foundry-kpis strong { display: block; margin-top: 5px; color: #0f172a; font-size: 22px; }
@media (max-width: 700px) { .trials-foundry-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Foundry 账号创建 · ainew 同款模型模板编辑表 */
.foundry-create-model-head, .foundry-create-model-row { display: grid; grid-template-columns: 105px minmax(130px, 1fr) minmax(150px, 1.4fr) 120px 145px 90px 45px 64px; gap: 8px; align-items: center; min-width: 980px; }
.foundry-create-model-head { margin: 10px 0 3px; padding: 0 6px; color: #64748b; font-size: 11.5px; font-weight: 700; }
.foundry-create-model-row { padding: 5px 6px; border-top: 1px solid #e2e8f0; }
.foundry-create-model-row input, .foundry-create-model-row select { width: 100%; min-width: 0; }
.foundry-create-model-row button { padding: 6px 8px; }
.foundry-operation-detail summary { color: #0369a1; font-weight: 700; }
.foundry-operation-meta { margin: 7px 0; color: #64748b; font-size: 11.5px; }
.foundry-command-block { max-height: 220px; margin: 5px 0 10px; padding: 10px; overflow: auto; white-space: pre-wrap; word-break: break-all; background: #0f172a; color: #dbeafe; border-radius: 4px; font-size: 11px; }
.foundry-operation-results { max-height: 220px; margin: 5px 0 0; padding-left: 20px; overflow: auto; font-size: 11.5px; }

/* 系统管理子页面 */
.admin-tabs { display: flex; align-items: center; gap: 2px; margin: 0 0 14px; padding: 4px; overflow-x: auto; border: 1px solid #dbe3ed; background: #f8fafc; }
.admin-tabs button { flex: 0 0 auto; min-height: 36px; padding: 7px 16px; border: 0; border-radius: 4px; background: transparent; color: #475569; font-weight: 700; }
.admin-tabs button:hover { background: #eef4fa; color: #0f172a; }
.admin-tabs button.active { background: #0f5f96; color: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .15); }
.admin-tab-panel[hidden] { display: none; }
.admin-section-intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 12px; padding: 14px 16px; border-left: 4px solid #0ea5e9; background: #f7fbff; }
.admin-section-intro h2 { margin: 0 0 3px; color: #0f172a; font-size: 18px; }
.admin-section-intro p { margin: 0; color: #64748b; font-size: 12.5px; line-height: 1.5; }
.admin-section-actions { flex: 0 0 auto; }
.admin-monitor-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.admin-monitor-kpis article { min-width: 0; padding: 13px 15px; border: 1px solid #dbe3ed; border-top: 3px solid #0ea5e9; background: #fff; }
.admin-monitor-kpis span { display: block; color: #64748b; font-size: 11.5px; font-weight: 700; }
.admin-monitor-kpis strong { display: block; margin: 5px 0 2px; color: #0f172a; font-size: 22px; line-height: 1.15; }
.admin-monitor-kpis small { display: block; color: #64748b; font-size: 11px; }
@media (max-width: 700px) {
  .admin-section-intro { align-items: flex-start; flex-direction: column; }
  .admin-tabs { scrollbar-width: thin; }
  .admin-monitor-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 字段维护 · 按功能页面分区 */
.field-maintenance-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 12px; align-items: start; }
.field-maintenance-nav { position: sticky; top: 12px; display: grid; gap: 3px; padding: 6px; border: 1px solid #dbe3ed; background: #f8fafc; }
.field-maintenance-nav button { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 38px; padding: 8px 10px; border: 0; border-left: 3px solid transparent; border-radius: 3px; background: transparent; color: #334155; text-align: left; }
.field-maintenance-nav button:hover { background: #eef4fa; }
.field-maintenance-nav button.active { border-left-color: #0f75bd; background: #e7f2fb; color: #075985; font-weight: 700; }
.field-maintenance-nav small { flex: none; color: #64748b; font-size: 10.5px; font-weight: 400; }
.field-maintenance-panel { min-width: 0; border: 1px solid #dbe3ed; background: #fff; }
.field-maintenance-context { display: flex; align-items: center; min-height: 58px; padding: 10px 14px; border-bottom: 1px solid #e2e8f0; background: #f8fbfe; }
.field-maintenance-context strong { color: #0f172a; font-size: 15px; }
.field-maintenance-context p { margin: 3px 0 0; color: #64748b; font-size: 11.5px; }
.field-maintenance-tabs { display: flex; gap: 2px; padding: 7px 10px 0; overflow-x: auto; border-bottom: 1px solid #dbe3ed; }
.field-maintenance-tabs button { flex: 0 0 auto; min-height: 36px; padding: 7px 12px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: #475569; }
.field-maintenance-tabs button:hover { background: #f1f5f9; }
.field-maintenance-tabs button.active { border-bottom-color: #0f75bd; color: #075985; font-weight: 700; }
.field-maintenance-content { min-width: 0; padding: 14px; }
.field-maintenance-note { margin-top: 20px; padding-top: 16px; border-top: 1px solid #dbe3ed; }
.field-maintenance-note h2 { margin: 0 0 10px; font-size: 16px; }
.nav-title-tree h3 { margin: 16px 0 8px; font-size: 14px; }
.nav-title-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); gap: 12px; }
.nav-title-group { min-width: 0; padding: 8px 10px; border: 1px solid #dbe3ed; background: #fbfdff; }
.nav-title-group h4 { margin: 0 0 6px; font-size: 13px; }
@media (max-width: 820px) {
  .field-maintenance-layout { grid-template-columns: 1fr; }
  .field-maintenance-nav { position: static; display: flex; overflow-x: auto; }
  .field-maintenance-nav button { flex: 0 0 auto; min-width: 132px; border-left: 0; border-bottom: 3px solid transparent; }
  .field-maintenance-nav button.active { border-bottom-color: #0f75bd; }
}

/* 帮助中心 */
.help-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start; }
.help-layout .bill-nav { position: sticky; top: 16px; }
.help-sidebar { padding: 13px; max-height: calc(100vh - 32px); overflow-y: auto; }
.help-sidebar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 2px 10px; }
.help-sidebar-head h2 { margin: 0; font-size: 16px; }
.help-sidebar-head span { color: #64748b; font-size: 11.5px; }
.help-sidebar .bill-nav-item { padding: 7px 9px; font-size: 13px; min-height: 34px; }
.help-toc-group { margin: 12px 3px 5px; padding: 8px 6px 3px; border-top: 1px solid #e2e8f0; color: #475569; font-size: 11.5px; font-weight: 800; letter-spacing: 0; }
.help-toc-group:first-child { margin-top: 2px; border-top: 0; padding-top: 2px; }
.help-content { padding: 24px 30px 34px; max-width: 980px; min-width: 0; }
.help-chapter-head { border-bottom: 1px solid #dbe3ed; margin: 0 0 16px; padding: 0 0 14px; }
.help-chapter-head h2 { margin: 8px 0 0; color: #0f172a; font-size: 24px; line-height: 1.3; }
.help-audience-tag, .help-category-tag { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 4px; font-size: 11.5px; font-weight: 700; }
.help-audience-tag { background: #e8f3ff; color: #075985; border: 1px solid #bae6fd; }
.help-category-tag { margin-left: 6px; background: #f1f5f9; color: #475569; border: 1px solid #dbe3ed; }
.help-chapter-nav { margin: 0 0 20px; padding: 12px 14px; border-left: 3px solid #0ea5e9; background: #f7fbff; }
.help-chapter-nav strong { display: block; margin-bottom: 7px; color: #0f172a; font-size: 12.5px; }
.help-chapter-nav div { display: flex; flex-wrap: wrap; gap: 5px 14px; }
.help-chapter-nav a { color: #0369a1; font-size: 12.5px; text-decoration: none; }
.help-chapter-nav a:hover { text-decoration: underline; }
.help-body h3 { margin: 24px 0 8px; color: #0f172a; font-size: 17px; }
.help-body h4 { scroll-margin-top: 18px; margin: 26px 0 9px; padding-left: 10px; border-left: 3px solid #2563eb; color: #0f172a; font-size: 15px; line-height: 1.4; }
.help-body p, .help-body li { line-height: 1.75; font-size: 13.5px; color: #334155; }
.help-body p { margin: 8px 0 12px; }
.help-body ol, .help-body ul { margin: 7px 0 15px; padding-left: 24px; }
.help-body li { margin: 4px 0; padding-left: 2px; }
.help-body strong, .help-body b { color: #0f172a; font-weight: 700; }
.help-body code, .help-body .mono { color: #075985; background: #eef7ff; border-radius: 3px; padding: 1px 4px; }
.help-body pre { margin: 12px 0 18px; padding: 14px 16px; overflow-x: auto; border: 1px solid #dbe3ed; border-radius: 6px; background: #f8fafc; color: #1e293b; font-size: 12px; line-height: 1.65; }
.help-table { border-collapse: separate; border-spacing: 0; width: 100%; margin: 12px 0 20px; overflow: hidden; border: 1px solid #dbe3ed; border-radius: 6px; font-size: 13px; }
.help-table th, .help-table td { border-right: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0; padding: 9px 11px; text-align: left; vertical-align: top; line-height: 1.6; }
.help-table th:last-child, .help-table td:last-child { border-right: 0; }
.help-table tr:last-child td { border-bottom: 0; }
.help-table th { background: #f1f5f9; color: #1e293b; font-weight: 700; white-space: nowrap; }

.bill-subscription-table-wrap { overflow-x: auto; }
.bill-subscription-table { width: 100%; min-width: 1360px; }
.bill-subscription-table th, .bill-subscription-table td { vertical-align: middle; line-height: 1.45; }
.bill-subscription-table th:nth-child(1) { width: 15%; }
.bill-subscription-table th:nth-child(2) { width: 10%; }
.bill-subscription-table th:nth-child(3) { width: 7%; }
.bill-subscription-table th:nth-child(4) { width: 7%; }
.bill-subscription-table th:nth-child(5) { width: 19%; }
.bill-subscription-table th:nth-child(6) { width: 10%; }
.bill-subscription-table th:nth-child(7) { width: 11%; }
.bill-subscription-table th:nth-child(8) { width: 12%; }
.bill-subscription-table th:nth-child(9) { width: 6%; }
.bill-subscription-table th:nth-child(10) { width: 13%; }
.bill-subscription-table td:nth-child(1),
.bill-subscription-table td:nth-child(2),
.bill-subscription-table td:nth-child(5),
.bill-subscription-table td:nth-child(6),
.bill-subscription-table td:nth-child(8) { white-space: normal; overflow-wrap: anywhere; }
.bill-subscription-table td:nth-child(3),
.bill-subscription-table td:nth-child(4),
.bill-subscription-table td:nth-child(7),
.bill-subscription-table td:nth-child(9) { white-space: nowrap; }
.bill-subscription-actions { display: grid; grid-template-columns: repeat(2, minmax(68px, 1fr)); gap: 6px; min-width: 142px; }
.bill-subscription-actions button { width: 100%; min-width: 0; white-space: nowrap; padding-inline: 8px; }
.help-table tbody tr:nth-child(even) td { background: #fbfdff; }
@media (max-width: 900px) { .help-layout { grid-template-columns: 1fr; } .help-layout .bill-nav { position: static; } }
@media (max-width: 900px) { .help-sidebar { max-height: none; } .help-content { padding: 20px; } }
@media (max-width: 600px) { .help-content { padding: 16px; } .help-chapter-head h2 { font-size: 20px; } .help-chapter-nav div { display: grid; gap: 6px; } }
@media screen and (max-width: 700px) {
  .bill-title { grid-template-columns: auto minmax(0, 1fr); }
  .bill-brand-logos { grid-column: 1 / -1; max-width: 100%; gap: 1px; }
  .bill-company-logo { max-width: 120px; max-height: 42px; }
  .bill-azure-logo { max-width: 110px; max-height: 26px; }
}
.bill-title h1 { margin: 0; font-size: 21px; }
.bill-badge { background: #10243e; color: #fff; font-size: 13px; padding: 4px 12px; border-radius: 4px; font-weight: 600; }
.bill-h2 { color: #2563eb; font-size: 16px; margin: 0 0 10px; }
.bill-section { margin-bottom: 26px; }
.bill-summary { display: flex; gap: 32px; align-items: flex-start; flex-wrap: wrap; justify-content: space-between; }
.bill-kvs { flex: 1 1 560px; min-width: 0; max-width: 680px; display: grid; grid-template-columns: repeat(2, minmax(250px, 1fr)); gap: 0 24px; align-content: start; }
.bill-kv { display: flex; justify-content: flex-start; gap: 14px; padding: 7px 0; border-bottom: 1px dashed #e2e8f0; font-size: 14px; }
.bill-kv-label { min-width: 4.5em; color: var(--muted); flex-shrink: 0; }
.bill-kv-val { font-weight: 600; }
.bill-kv.full, .bill-kvs > .muted { grid-column: 1 / -1; }
.bill-kv.full { justify-content: flex-start; gap: 28px; }
.bill-kv.full .bill-kv-val { font-size: 15.5px; margin-left: 0; text-align: left; }
.bill-kv-label { color: var(--muted); white-space: nowrap; }
.bill-kv-val { font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.bill-kv:not(.full) .bill-kv-val { white-space: nowrap; overflow-wrap: normal; }
.bill-kv .bill-kv-val { margin-left: auto; font-variant-numeric: tabular-nums; }
.bill-kv-val.bill-settle { color: #dc2626; font-size: 16px; }
/* 人民币结算 CSP 客户：累计充值 / 余额主值为不含税，下方小字括注含税金额（右对齐，与主值同列） */
.bill-donut { flex-shrink: 0; }
/* 账单版式断点只作用于屏幕：打印按纸张宽度匹配媒体查询，未限定 screen 会把 PDF 概要压成单列 */
@media screen and (max-width: 1220px) {
  .bill-summary { gap: 24px; }
  .bill-kvs { flex-basis: 500px; grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}
@media screen and (max-width: 960px) {
  .bill-kvs { flex-basis: 100%; max-width: none; grid-template-columns: 1fr; }
  .bill-donut { width: 100%; }
}
.hq-summary-card .bill-summary { flex-wrap: nowrap; gap: 28px; }
.hq-summary-kvs { max-width: none; min-width: 0; flex: 1 1 54%; }
.hq-summary-card .bill-donut { flex: 1 1 46%; min-width: 300px; align-self: center; }
.hq-summary-card .bill-summary.no-chart .hq-summary-kvs { flex-basis: 100%; }
.hq-primary-metric { min-height: 48px; align-items: center; }
.hq-primary-metric .bill-kv-val { margin-left: auto; font-size: 18px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.hq-usage-progress { align-items: center; }
.hq-usage-progress-main { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(100px, 1fr) 52px; gap: 10px; align-items: center; }
.hq-usage-progress-main strong { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.hq-usage-track { height: 7px; overflow: hidden; border-radius: 4px; background: #e2e8f0; }
.hq-usage-track > span { display: block; height: 100%; border-radius: inherit; }
.tone-danger { color: #dc2626; }
.tone-warn { color: #d97706; }
.tone-info { color: #2563eb; }
.tone-success { color: #059669; }
.tone-bg-danger { background: #dc2626; }
.tone-bg-warn { background: #d97706; }
.tone-bg-success { background: #10b981; }
.hq-allowance-summary { align-items: flex-start; }
.hq-allowance-table-wrap { width: 100%; overflow-x: auto; }
.hq-allowance-table { width: 100%; min-width: 1120px; table-layout: fixed; }
.hq-allowance-table th:nth-child(1) { width: 24%; }
.hq-allowance-table th:nth-child(2) { width: 17%; }
.hq-allowance-table th:nth-child(3) { width: 7%; }
.hq-allowance-table th:nth-child(4), .hq-allowance-table th:nth-child(5),
.hq-allowance-table th:nth-child(6), .hq-allowance-table th:nth-child(7) { width: 10%; }
.hq-allowance-table th:nth-child(8) { width: 8%; }
.hq-allowance-table th:nth-child(9) { width: 10%; }
.hq-allowance-table th, .hq-allowance-table td { vertical-align: middle; overflow-wrap: anywhere; }
.hq-allowance-table td.num { white-space: nowrap; }
.hq-chart-caption { margin: -4px 0 8px; font-size: 11px; }
.hq-allowance-list { min-width: 0; width: 100%; display: grid; gap: 5px; }
.hq-allowance-warning { color: #b45309; margin-bottom: 2px; }
.hq-allowance-row { padding: 8px 0; border-bottom: 1px dashed #e2e8f0; }
.hq-allowance-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.hq-allowance-name { min-width: 0; overflow-wrap: anywhere; font-weight: 700; }
.hq-allowance-metrics { display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: 1px 20px; }
.hq-allowance-metric { min-width: 0; display: grid; grid-template-columns: minmax(4.2em, auto) minmax(0, 1fr); align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dotted #e2e8f0; }
.hq-allowance-metric span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.hq-allowance-metric strong { min-width: 0; text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hq-allowance-metric .tone-danger { color: #dc2626; }
.hq-allowance-metric .tone-warn { color: #d97706; }
.hq-allowance-metric .tone-info { color: #2563eb; }
.hq-allowance-metric .tone-success { color: #059669; }
@media screen and (max-width: 1000px) {
  .hq-summary-card .bill-summary { flex-wrap: wrap; }
  .hq-summary-card .bill-donut { min-width: 0; width: 100%; }
}
@media (max-width: 620px) {
  .hq-allowance-metrics { grid-template-columns: 1fr; }
}
.donut-wrap { display: flex; gap: 14px; align-items: center; width: 100%; min-width: 0; justify-content: center; }
.donut-wrap > svg { min-width: 0; }
.donut-legend { display: flex; flex-direction: column; gap: 4px; max-width: 200px; }
.donut-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.donut-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.donut-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
.bill-chart-title { text-align: center; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
/* M365 对账单：付费许可 / 免费与试用 两页签（参考设计：信息条、图标 KPI、风险横幅、分配条、建议面板、按购买渠道分表） */
.m365-tenant-list { display: grid; gap: 6px; }
.m365-tenant-list b { font-weight: 600; }
.m365-tenant-meta { color: var(--muted); font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
.m365-sku-part { color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 1px; overflow-wrap: anywhere; }
.m365-tabs { display: flex; gap: 4px; border-bottom: 2px solid #e2e8f0; margin: 0 0 18px; }
.m365-tabs button { border: 0; border-radius: 8px 8px 0 0; background: transparent; padding: 9px 18px; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: -2px; border-bottom: 2px solid transparent; cursor: pointer; }
.m365-tabs button:hover { color: #1d4ed8; background: #f1f5f9; }
.m365-tabs button.active { color: #1d4ed8; border-bottom-color: #2563eb; background: #eff6ff; }
.m365-tab-count { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: #e2e8f0; color: #334155; font-size: 11.5px; line-height: 18px; }
.m365-tabs button.active .m365-tab-count { background: #2563eb; color: #fff; }
.m365-tab-panel.is-hidden { display: none; }
.m365-section-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.m365-section-head .bill-h2 { margin: 0; }
.m365-section-head .muted { font-size: 12px; }
.m365-action-link { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.m365-section-head .m365-action-link:first-of-type { margin-left: auto; }
.m365-icon { display: inline-flex; flex: none; width: 18px; height: 18px; }
.m365-icon svg { width: 100%; height: 100%; }
.m365-ov-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.m365-ov-kpi { display: flex; align-items: center; gap: 10px; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; background: #fff; min-width: 0; }
.m365-ov-kpi > .m365-icon { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: #eff6ff; color: #2563eb; }
.m365-ov-kpi-text { min-width: 0; display: grid; }
.m365-ov-kpi-text span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.m365-ov-kpi-text b { font-size: 21px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.m365-ov-kpi-text small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.m365-ov-kpi.ok > .m365-icon { background: #ecfdf5; color: #059669; }
.m365-ov-kpi.ok b { color: #059669; }
.m365-ov-kpi.warn { border-color: #fde68a; background: #fffbeb; }
.m365-ov-kpi.warn > .m365-icon { background: #fef3c7; color: #d97706; }
.m365-ov-kpi.warn b { color: #d97706; }
.m365-ov-kpi.err { border-color: #fecaca; background: #fef2f2; }
.m365-ov-kpi.err > .m365-icon { background: #fee2e2; color: #dc2626; }
.m365-ov-kpi.err b { color: #dc2626; }
.m365-risks { display: grid; gap: 8px; }
.m365-risk { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 8px; border: 1px solid #bfdbfe; background: #eff6ff; color: #1e3a8a; font-size: 13px; }
.m365-risk > b { white-space: nowrap; }
.m365-risk > span:not(.m365-icon) { flex: 1; min-width: 0; }
.m365-risk.warn { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.m365-risk.err { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.m365-risk.ok { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.m365-grid3 { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, .9fr); gap: 14px; align-items: stretch; }
.m365-panel { border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 14px; min-width: 0; background: #fff; }
.m365-panel .bill-chart-title { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; font-weight: 600; }
.m365-alloc { display: grid; gap: 9px; }
.m365-alloc-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); }
.m365-legend::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; background: #2563eb; }
.m365-legend.free::before { background: #dbeafe; }
.m365-alloc-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; margin-bottom: 3px; }
.m365-alloc-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m365-alloc-val { flex: none; color: #334155; font-variant-numeric: tabular-nums; }
.m365-alloc-bar { height: 9px; border-radius: 999px; background: #dbeafe; overflow: hidden; }
.m365-alloc-bar > span { display: block; height: 100%; border-radius: 999px; background: #2563eb; }
.m365-alloc-bar.over > span { background: #dc2626; }
/* 关键发现与建议：按级别着色底纹 + 左侧色条 + 标签，字号放大；「查看续费跟进」固定在卡片右下角 */
.m365-insights { display: flex; flex-direction: column; }
.m365-insights ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
.m365-insights li { display: flex; gap: 8px; align-items: flex-start; min-width: 0; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.55; padding: 7px 10px; border-radius: 8px; border-left: 3px solid #2563eb; background: #eff6ff; color: #1e3a8a; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.m365-insights li > .m365-icon { flex: none; width: 16px; height: 16px; margin-top: 3px; color: #2563eb; }
.m365-insights li > span { flex: 1 1 auto; min-width: 0; }
.m365-insights li.ok { border-left-color: #16a34a; background: #f0fdf4; color: #166534; }
.m365-insights li.ok > .m365-icon { color: #059669; }
.m365-insights li.warn { border-left-color: #f59e0b; background: #fffbeb; color: #92400e; }
.m365-insights li.warn > .m365-icon { color: #d97706; }
.m365-insights li.err { border-left-color: #dc2626; background: #fef2f2; color: #991b1b; }
.m365-insights li.err > .m365-icon { color: #dc2626; }
.m365-insight-tag { display: inline-block; margin-right: 6px; padding: 0 7px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 19px; white-space: nowrap; background: #dbeafe; color: #1d4ed8; }
.m365-insights li.ok .m365-insight-tag { background: #dcfce7; color: #15803d; }
.m365-insights li.warn .m365-insight-tag { background: #fef3c7; color: #b45309; }
.m365-insights li.err .m365-insight-tag { background: #fee2e2; color: #b91c1c; }
.m365-insights-foot { margin-top: auto; padding-top: 12px; text-align: right; }
.m365-channel-block { margin-bottom: 16px; }
.m365-channel-head { display: flex; align-items: baseline; gap: 10px; padding: 8px 12px; border-left: 4px solid #2563eb; background: #f1f5f9; border-radius: 6px 6px 0 0; }
.m365-channel-head h3 { margin: 0; font-size: 14.5px; color: #10243e; }
.m365-channel-head .muted { font-size: 12px; }
.m365-channel-block .bill-detail-table-wrap { border-top-left-radius: 0; border-top-right-radius: 0; }
.m365-pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 19px; white-space: nowrap; font-variant-numeric: tabular-nums; background: #eff6ff; color: #1d4ed8; }
.m365-pill.ok { background: #dcfce7; color: #15803d; }
.m365-pill.warn { background: #fef3c7; color: #b45309; }
.m365-pill.err { background: #fee2e2; color: #b91c1c; }
.m365-pill.muted { background: #f1f5f9; color: #64748b; font-weight: 500; }
.m365-dot { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12.5px; }
.m365-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; }
.m365-dot.ok::before { background: #16a34a; }
.m365-dot.info::before { background: #2563eb; }
.m365-dot.warn::before { background: #f59e0b; }
.m365-dot.err::before { background: #dc2626; }
.m365-dot.muted { color: var(--muted); }
.m365-left { font-size: 11.5px; color: var(--muted); }
.m365-left.warn { color: #d97706; font-weight: 600; }
/* 订阅明细：同一许可多条订阅合并「产品名称 / 已分配 / 可用」单元格，许可之间加分隔线；所有单元格靠上对齐（合并与非合并的数字在同一高度）；计费信息放最后一列 */
.m365-table td { vertical-align: top; }
.m365-table tr.m365-row-start > td { border-top: 1px solid #cbd5e1; }
.m365-table th.m365-billing-th { white-space: nowrap; }
.m365-table td.m365-billing { font-size: 12px; color: #475569; min-width: 150px; overflow-wrap: anywhere; vertical-align: top; line-height: 1.4; }
.m365-billing .m365-billing-to { color: #0f172a; font-weight: 600; }
.m365-billing .m365-billing-account { font-size: 11px; color: #64748b; }
.m365-table tfoot tr.m365-total td { font-weight: 700; color: #0f172a; border-top: 2px solid #cbd5e1; vertical-align: top; }
.m365-table .m365-total-note { font-size: 11px; font-weight: 500; color: #64748b; white-space: nowrap; }
/* 许可明细整表展开（客户许可通常不多），不出内部滚动条 */
.bill-detail-table-wrap.m365-table-wrap { max-height: none; overflow-y: visible; scrollbar-gutter: auto; }
.m365-table td.m365-account { font-size: 12px; color: #475569; min-width: 110px; max-width: 200px; overflow-wrap: anywhere; }
.m365-table td.m365-name { min-width: 150px; }
/* 到期分布：图表填满面板剩余高度（与同排面板等高），SVG 按容器像素重绘 */
.m365-panel-fill { display: flex; flex-direction: column; }
.m365-expiry-chart { position: relative; flex: 1 1 auto; min-height: 220px; }
.m365-expiry-chart > svg { position: absolute; inset: 0; }
@media (max-width: 1280px) {
  .m365-grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .m365-grid3 > .m365-insights { grid-column: 1 / -1; }
}
@media (max-width: 1100px) {
  .m365-grid3 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .m365-grid3 { grid-template-columns: 1fr; }
}
.bill-table { width: 100%; }
.bill-table th { background: #10243e; color: #fff; font-weight: 600; }
.bill-table thead tr.bill-head-en th { padding-top: 0; font-size: 11px; font-weight: 400; color: #cbd5e1; letter-spacing: .1px; }
.bill-table thead tr:has(+ tr.bill-head-en) th { padding-bottom: 3px; }
.bill-table tfoot td { background: #f1f5f9; }
.bill-detail-table-wrap { max-height: 460px; overflow: auto; border: 1px solid #e2e8f0; scrollbar-gutter: stable; }
.bill-detail-table-wrap .bill-table { margin: 0; min-width: 760px; }
/* 整个表头吸顶（双语两行表头不再各自 top:0 叠在一起） */
.bill-detail-table-wrap thead { position: sticky; top: 0; z-index: 2; }
.bill-detail-table-wrap tfoot td { position: sticky; bottom: 0; z-index: 2; box-shadow: 0 -1px 0 #cbd5e1; }
.overview-table-wrap { max-height: calc(100vh - 260px); overflow: auto; border: 1px solid #e2e8f0; scrollbar-gutter: stable; }
.overview-table-wrap .bill-table { margin: 0; min-width: 1180px; }
.overview-table-wrap thead th { position: sticky; top: 0; z-index: 3; box-shadow: 0 1px 0 #10243e; }
.overview-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: #e2e8f0; border: 1px solid #e2e8f0; margin-bottom: 20px; }
.overview-kpis > div { background: #fff; padding: 12px 14px; min-width: 0; }
.overview-kpis span { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 4px; }
.overview-kpis strong { display: block; font-size: 17px; overflow-wrap: anywhere; }
.overview-table td { font-size: 12.5px; vertical-align: middle; }
.overview-table td.num { white-space: nowrap; }
@media (max-width: 1100px) { .bill-filters:not(.bill-filters-drawer) { display: none; } }
@media (max-width: 900px) {
  .bill-filters.bill-filters-drawer { top: 64px; right: 8px; bottom: 8px; width: calc(100vw - 16px); }
  .bill-filters.bill-filters-drawer.collapsed { top: 74px; right: 0; bottom: auto; width: 36px; max-width: 36px; }
}

/* 总代账单：批次审核与 API 差异核对 */
.partner-guide summary { cursor: pointer; font-weight: 700; }
.partner-guide[open] summary { margin-bottom: 12px; }
.partner-import { padding: 16px; }
.partner-import-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 12px; }
.partner-mapping-summary { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 12px; }
.partner-compare th, .partner-compare td { font-size: 12px; }
.partner-rows { min-width: 1080px; }
.partner-rows th { position: sticky; top: 0; z-index: 1; }
.partner-rows details summary { cursor: pointer; color: var(--primary); }
@media (max-width: 900px) { .partner-import-head { flex-direction: column; } }

/* 连接回补任务进度 */
.pull-progress { margin-top: 10px; padding: 9px 12px; }
.pull-progress-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 12.5px; }
.pull-progress-track { height: 6px; background: #dbeafe; border-radius: 3px; overflow: hidden; margin-top: 7px; }
.pull-progress-bar { height: 100%; background: #1677c8; border-radius: 3px; transition: width .25s ease; }

/* 连接授权状态：持久显示逐订阅与根管理组结果 */
.connection-auth-status { margin-top: 10px; padding: 8px 11px; background: #f8fafc; border: 1px solid #e2e8f0; }
.connection-auth-status-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.connection-auth-failures { margin-top: 7px; color: #b91c1c; font-size: 12px; line-height: 1.65; }
.connection-auth-failures div { overflow-wrap: anywhere; }
.connection-subscriptions { margin-top: 10px; border: 1px solid #dbe3ed; background: #fff; }
.connection-subscriptions > summary { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 7px 10px; cursor: pointer; color: #334155; font-weight: 700; list-style: none; }
.connection-subscriptions > summary::-webkit-details-marker { display: none; }
.connection-subscriptions > summary::before { content: '›'; color: #64748b; font-size: 20px; line-height: 1; transform: rotate(0deg); transition: transform .15s ease; }
.connection-subscriptions[open] > summary::before { transform: rotate(90deg); }
.connection-subscriptions-hint { margin-left: auto; font-size: 11px; font-weight: 400; }
.connection-subscriptions[open] .connection-subscriptions-hint { display: none; }
.connection-subscriptions-table { overflow-x: auto; border-top: 1px solid #e2e8f0; }
.connection-subscriptions-table table { margin: 0; }

/* 连接/订阅组合筛选 */
.connect-filter-panel { padding: 12px 16px; }
.connect-filter-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.connect-filter-top > input { width: min(420px, 100%); }
.connect-filter-count { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.disable-record-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.disable-record-history { font-size: 12px; }
.disable-record-history td { overflow-wrap: anywhere; }
.disable-registry-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
.disable-registry-toolbar select { width: auto; }
.disable-registry-toolbar > button { margin-left: auto; }
.disable-registry-table { max-height: 62vh; overflow: auto; }
.disable-registry-table table { font-size: 12.5px; }
.disable-registry-table td { overflow-wrap: anywhere; vertical-align: top; }
.ms-request-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 12px; }
.ms-request-subs { max-height: 220px; overflow: auto; border: 1px solid var(--border, #e5e7eb); border-radius: 6px; padding: 6px 8px; margin: 4px 0 6px; }
.ms-request-subs .sub-check { display: flex; gap: 8px; align-items: center; margin: 3px 0; }
.connect-filter-top > button { margin-left: auto; }
.connect-filter-grid { display: grid; grid-template-columns: repeat(9, minmax(105px, 1fr)); gap: 8px; }
.connect-filter-field { min-width: 0; }
.connect-filter-field > span { display: block; color: var(--muted); font-size: 11px; margin: 0 0 3px 2px; }
.connect-filter-field select { width: 100%; min-width: 0; padding: 6px 24px 6px 8px; font-size: 12px; }
@media (max-width: 1450px) { .connect-filter-grid { grid-template-columns: repeat(5, minmax(120px, 1fr)); } }
@media (max-width: 850px) {
  .connect-filter-top { flex-wrap: wrap; }
  .connect-filter-top > input { width: 100%; }
  .connect-filter-top > button { margin-left: 0; }
  .connect-filter-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
}

/* 核心列表/看板统一布局：顶部只留搜索，其他筛选默认收在右栏。 */
.filter-search-row { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 9px 14px; }
.filter-search-row > input, .filter-search-row .picker-search { width: min(620px, 100%); }
.filter-search-main { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; }
.filter-search-main > input, .filter-search-main > .picker-search { width: min(420px, 38%); flex: 0 0 auto; }
.unified-date-search-toolbar { flex-wrap: nowrap; }
.unified-date-search-toolbar > .time-filter { width: auto; flex: 1 1 0; flex-wrap: nowrap; }
.unified-date-search-toolbar .reconcile-mode-controls,
.unified-date-search-toolbar .reconcile-range-controls { gap: 4px; flex-wrap: nowrap; }
.unified-date-search-toolbar .reconcile-mode-controls button,
.unified-date-search-toolbar .reconcile-range-controls button { padding-inline: 8px; }
.unified-date-search-toolbar .time-quick-controls { gap: 3px; }
.unified-date-search-toolbar .time-quick-controls button { padding-inline: 6px; }
.unified-date-search-toolbar > input[type="search"],
.unified-date-search-toolbar > .picker-search {
  box-sizing: border-box; width: 360px; min-width: 360px; max-width: 360px; margin-left: auto; flex: 0 0 360px;
}
.unified-date-search-toolbar > .customer-picker {
  box-sizing: border-box; width: 260px; min-width: 260px; max-width: 260px; flex: 0 0 260px;
}
.unified-date-search-toolbar > .customer-search-placeholder {
  box-sizing: border-box; width: 280px; min-width: 280px; max-width: 280px; margin-left: auto; flex: 0 0 280px;
}
.dashboard-date-toolbar.unified-date-search-toolbar > input[type="search"] { height: 38px; }
.filter-search-row .filter-search-count { margin-left: auto; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.filter-page-layout { display: block; position: relative; }
.filter-page-content { min-width: 0; }
.filter-aside {
  position: fixed; z-index: 46; top: 76px; right: 12px; bottom: 12px; width: min(340px, calc(100vw - 24px));
  min-width: 0; padding: 12px; overflow: auto; overscroll-behavior: contain;
  box-shadow: 0 14px 38px rgba(15,23,42,.2); transition: opacity .16s ease-out, transform .16s ease-out;
}
.filter-aside-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.filter-aside-head h2 { margin: 0; font-size: 14px; }
.filter-aside-toggle { width: 28px; height: 28px; padding: 0; flex: 0 0 28px; font-size: 18px; }
.filter-page-layout.collapsed .filter-aside { top: 92px; right: 0; bottom: auto; width: 38px; padding: 8px 4px; overflow: hidden; border-radius: 8px 0 0 8px; box-shadow: 0 3px 12px rgba(15,23,42,.16); max-width: 38px; }
.filter-page-layout.collapsed .filter-aside-head { justify-content: center; }
.filter-page-layout.collapsed .filter-aside-head h2, .filter-page-layout.collapsed .filter-aside-body { display: none; }
.filter-aside-body { margin-top: 10px; }
.filter-aside-controls { display: grid; gap: 9px; }
.filter-aside-field > span { display: block; margin: 0 0 3px 2px; color: var(--muted); font-size: 11px; }
.filter-aside-field select, .filter-aside-field input { width: 100%; min-width: 0; }
.filter-aside-body .dashboard-filters, .filter-aside-body .subscription-filter-panel, .filter-aside-body .connect-filter-panel {
  position: static; margin: 0; padding: 0; border: 0; box-shadow: none; background: transparent;
}
.filter-aside-body .dashboard-filter-head, .filter-aside-body .subscription-filter-head { margin-bottom: 10px; }
.filter-aside-body .dashboard-filter-head h2 { display: none; }
.filter-aside-body .dashboard-filter-grid, .filter-aside-body .subscription-filter-grid, .filter-aside-body .connect-filter-grid { grid-template-columns: 1fr; }
.filter-aside-body .dashboard-filter-grid > label, .filter-aside-body .subscription-filter-grid > label { grid-column: auto !important; }
.time-filter { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; }
.subscription-compare-compact { flex-wrap: nowrap; }
.subscription-compare-compact .time-filter { flex: 1 1 460px; flex-wrap: nowrap; gap: 4px; }
.subscription-compare-compact .reconcile-mode-controls { gap: 3px; }
.subscription-compare-compact .reconcile-mode-controls button { padding-inline: 7px; }
.subscription-compare-compact .reconcile-range-controls { gap: 3px; }
.subscription-compare-compact .reconcile-range-controls label { gap: 2px; }
.subscription-compare-compact .reconcile-range-controls input[type="month"],
.subscription-compare-compact .reconcile-range-controls input[type="date"] { width: 92px; padding-inline: 5px; }
.subscription-compare-compact .reconcile-range-controls button { padding-inline: 8px; }
.subscription-channel-filter { width: 96px; min-width: 88px; flex: 0 1 96px; }
.subscription-compare-compact > .customer-picker { width: clamp(190px, 14vw, 250px); min-width: 180px; flex: 0 1 240px; }
.subscription-compare-compact .subscription-compare-actions { margin: 0 0 0 auto; flex: 0 0 auto; flex-wrap: nowrap; }
@media (max-width: 900px) {
  .filter-page-content { max-width: 100%; overflow-x: auto; }
  .filter-aside { top: 64px; right: 8px; bottom: 8px; width: calc(100vw - 16px); }
  .filter-page-layout.collapsed .filter-aside { top: 74px; right: 0; bottom: auto; width: 36px; max-width: 36px; }
  .filter-search-row { flex-wrap: wrap; }
  .filter-search-main { flex-wrap: wrap; }
  .filter-search-main > input, .filter-search-main > .picker-search { width: 100%; }
  .unified-date-search-toolbar { flex-wrap: wrap; }
  .unified-date-search-toolbar > .time-filter,
  .unified-date-search-toolbar > input[type="search"],
  .unified-date-search-toolbar > .picker-search,
  .unified-date-search-toolbar > .customer-picker,
  .unified-date-search-toolbar > .customer-search-placeholder {
    width: 100%; min-width: 0; max-width: none; margin-left: 0; flex-basis: 100%;
  }
  .dashboard-date-toolbar.unified-date-search-toolbar .reconcile-range-controls { flex-wrap: wrap; }
  .filter-search-row .filter-search-count { margin-left: 0; }
  .time-filter { width: 100%; max-width: 100%; min-width: 0; flex-wrap: wrap; }
  .time-filter .reconcile-range-controls { flex-wrap: wrap; }
  .subscription-compare-compact { flex-wrap: wrap; }
  .subscription-compare-compact .time-filter,
  .subscription-compare-compact > .subscription-channel-filter,
  .subscription-compare-compact > .customer-picker { width: 100%; max-width: 100%; flex-basis: 100%; }
  .subscription-compare-compact .time-filter { flex-wrap: wrap; }
  .subscription-compare-compact .reconcile-range-controls { max-width: 100%; }
  .subscription-compare-compact .reconcile-range-controls input[type="month"],
  .subscription-compare-compact .reconcile-range-controls input[type="date"] { width: min(92px, 24vw); }
  .subscription-compare-compact .subscription-compare-actions {
    width: 100%; max-width: 100%; min-width: 0; margin: 0; flex: 1 1 100%; flex-wrap: wrap;
  }
}

/* 成本分析 PBI 风格经营看板 */
.analytics-top-grid { display: grid; grid-template-columns: minmax(390px, 1fr) minmax(390px, 1fr) minmax(260px, .72fr); gap: 14px; align-items: stretch; }
.analytics-chart-card { overflow: hidden; }
.analytics-chart-card h2, .analytics-funds h2, .analytics-monthly h2, .analytics-rank-grid h2 { margin-top: 0; font-size: 15px; }
.analytics-chart-card .donut-wrap { justify-content: center; min-height: 245px; }
.analytics-chart-card svg { max-width: 100%; height: auto; }
.analytics-funds { display: flex; flex-direction: column; }
.analytics-money-metric { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; border-bottom: 1px dashed #dbe3ed; }
.analytics-money-metric span { color: var(--muted); font-size: 12.5px; }
.analytics-money-metric strong { font-size: 21px; font-weight: 700; }
.analytics-money-metric.negative strong { color: #dc2626; }
.analytics-money-metric.positive strong { color: #15803d; }
.analytics-period-summary { margin-top: auto; padding-top: 12px; display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.analytics-period-summary strong { color: #0f172a; font-size: 14px; }
.analytics-section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.analytics-rank-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.analytics-ranking { display: grid; gap: 5px; }
.analytics-rank-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 105px; align-items: center; gap: 7px; width: 100%; min-height: 29px; padding: 2px 4px; border: 0; background: transparent; border-radius: 3px; text-align: left; }
.analytics-rank-row:hover { background: #f1f5f9; }
.analytics-rank-index { color: #94a3b8; font-size: 10px; text-align: right; }
.analytics-rank-main { min-width: 0; display: grid; gap: 3px; }
.analytics-rank-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.analytics-rank-track { height: 5px; background: #e8eef5; overflow: hidden; }
.analytics-rank-fill { display: block; height: 100%; background: #1677c8; }
.analytics-rank-fill.negative { background: #ef4444; }
.analytics-rank-value { text-align: right; font-size: 11px; font-weight: 600; white-space: nowrap; }
.analytics-rank-value.negative { color: #dc2626; }
.analytics-subscription-compare h2 { margin: 0; font-size: 15px; }
.analytics-subscription-compare h3 { margin: 12px 0 8px; font-size: 13px; }
.analytics-subscription-grid { display: grid; grid-template-columns: minmax(360px, .42fr) minmax(600px, 1fr); gap: 18px; align-items: start; }
.analytics-subscription-grid .analytics-rank-row { grid-template-columns: 22px minmax(0, 1fr) 150px; }
.subscription-compare-search > input { width: min(420px, 34%); }
.subscription-compare-search > select { width: min(380px, 30%); }
.subscription-compare-actions { justify-content: flex-end; margin: -4px 0 10px; min-height: 36px; }
.subscription-snapshot-note { color: var(--muted); font-size: 12px; margin: -4px 2px 10px; }
.icon-btn { min-width: 30px; height: 30px; padding: 2px 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; line-height: 1; }
.subscription-group-board { margin-bottom: 14px; }
.subscription-group-board .section-head { display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px; }
.subscription-group-board h2 { margin: 0; }
.subscription-compare-table-wrap { width: 100%; overflow-x: auto; }
.subscription-compare-table-wrap table { width: 100%; table-layout: fixed; }
.subscription-compare-table-wrap th, .subscription-compare-table-wrap td { vertical-align: middle; overflow-wrap: anywhere; }
.subscription-compare-table-wrap .center { text-align: center; }
.subscription-group-budget-table tbody { display: table-row-group; height: auto; }
.subscription-group-budget-table tr { height: auto; }
.subscription-group-budget-table th, .subscription-group-budget-table td { height: auto; padding: 7px 8px; line-height: 1.35; }
.subscription-group-budget-table { min-width: 1180px; }
.subscription-group-budget-table th:nth-child(1) { width: 18%; }
.subscription-group-budget-table th:nth-child(2) { width: 5%; }
.subscription-group-budget-table th:nth-child(3) { width: 8%; }
.subscription-group-budget-table th:nth-child(4),
.subscription-group-budget-table th:nth-child(5),
.subscription-group-budget-table th:nth-child(6) { width: 7%; }
.subscription-group-budget-table th:nth-child(7) { width: 9%; }
.subscription-group-budget-table th:nth-child(8) { width: 6%; }
.subscription-group-budget-table th:nth-child(9) { width: 6%; }
.subscription-group-budget-table th:nth-child(10) { width: 13%; }
.subscription-group-budget-table th:nth-child(11) { width: 11%; }
.subscription-group-budget-table td:nth-child(10) { font-size: 12px; }
.subscription-group-budget-table td:nth-child(11) { white-space: nowrap; }
.subscription-group-budget-table td:nth-child(11) button { padding: 5px 8px; white-space: nowrap; }
.subscription-group-budget-table .all-subscriptions-row td { background: #f8fafc; }
.end-watch-tag { margin-top: 4px; }
.end-watch-section { margin-top: 14px; }
.end-watch-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.end-watch-toggle { display: flex; align-items: center; gap: 8px; }
.end-watch-hint { margin-top: 6px; font-size: 12px; color: var(--warn); }
.end-watch-hint:empty { display: none; }
.end-watch-status { margin-top: 8px; font-size: 12.5px; line-height: 1.55; }
.end-watch-note { margin-top: 8px; font-size: 11.5px; line-height: 1.5; }
.end-watch-inline { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.end-watch-inline-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.end-watch-inline-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.end-watch-inline-actions button { padding: 4px 12px; font-size: 12.5px; }
.end-watch-inline .end-watch-status { margin-top: 6px; font-size: 12px; }
.subscription-group-card.is-focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(15,108,189,.18); }
.subscription-service-table { font-size: 12px; }
.subscription-service-table th:nth-child(1) { width: 13%; }
.subscription-service-table th:nth-child(2) { width: 25%; }
.subscription-service-table th:nth-child(3) { width: 18%; }
.subscription-service-table th:nth-child(4) { width: 10%; }
.subscription-service-table th:nth-child(5) { width: 13%; }
.subscription-service-table th:nth-child(6) { width: 10%; }
.subscription-service-table th:nth-child(7) { width: 11%; }
.subscription-service-table tfoot td { background: #f1f5f9; font-weight: 700; border-top: 1px solid #cbd5e1; }
.subscription-service-table tfoot td:first-child { text-align: right; }
.subscription-id-filter, .subscription-group-filter { min-width: 180px; max-width: 260px; flex: 0 1 250px; }
.subscription-id-filter .msel, .subscription-group-filter .msel { width: 100%; }
.subscription-id-filter .msel-toggle, .subscription-group-filter .msel-toggle { min-height: 36px; }
.subscription-daily-compare { margin-top: 14px; min-width: 0; overflow-x: auto; }
.subscription-daily-compare > svg, .subscription-daily-compare > .stacked-legend-wrap { width: 100%; }
.subscription-daily-compare .stacked-legend-wrap { display: block; width: max(100%, 900px); height: auto; }
.subscription-daily-compare .stacked-legend-wrap > svg { display: block; width: 100%; min-width: 900px; height: auto; aspect-ratio: 1380 / 300; }
.subscription-daily-compare .stacked-legend { max-height: none; overflow: visible; row-gap: 5px; }
.subscription-daily-compare .stacked-legend-item { max-width: none; overflow: visible; text-overflow: clip; }
.subscription-daily-audit-wrap { margin-top: 12px; overflow-x: auto; }
.subscription-daily-audit { min-width: 680px; font-size: 12px; }
.subscription-daily-audit th:first-child, .subscription-daily-audit td:first-child { text-align: left; }
.subscription-daily-audit th:last-child, .subscription-daily-audit td:last-child { text-align: center; }
.subscription-daily-audit tbody tr.is-selectable { cursor: pointer; }
.subscription-daily-audit tbody tr.is-selectable:hover td { background: #f0f9ff; }
.subscription-daily-audit tbody tr.is-selected td { background: #e0f2fe; font-weight: 600; }
.subscription-day-link-hint { margin-top: 6px; font-size: 11.5px; }
.subscription-day-link-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.subscription-day-link-clear { flex: none; padding: 4px 10px; }
.subscription-rank-note { display: block; font-size: 10.5px; font-weight: 400; }
.subscription-compare-grid { display: grid; grid-template-columns: minmax(360px, .42fr) minmax(620px, 1fr); gap: 14px; }
.subscription-compare-grid .section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.subscription-compare-grid h2, .subscription-compare-kpis span { margin-top: 0; }
.subscription-compare-right { display: flex; flex-direction: column; gap: 14px; min-width: 0; align-self: start; }
.subscription-dimension-rankings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.subscription-dimension-rankings .card { min-width: 0; }
.subscription-dimension-rankings .bar-row { grid-template-columns: minmax(0, 1fr) minmax(130px, .7fr); }
.subscription-dimension-rankings .bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subscription-service-detail { min-width: 0; }
.subscription-snapshot-rank { grid-template-columns: 22px minmax(0, 1fr) 150px; }
.subscription-snapshot-rank .analytics-rank-main { min-width: 0; }
.subscription-snapshot-rank .analytics-rank-id {
  display: block; margin-top: 2px; color: var(--muted); font-size: 9.5px; overflow-wrap: anywhere;
}
.channel-overview { display: grid; gap: 14px; }
.channel-overview-total .section-head, .channel-overview-card .section-head { align-items: flex-start; }
.channel-overview-total .section-head h2, .channel-overview-card .section-head h2 { margin-bottom: 2px; }
.channel-overview-head { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 18px; padding-bottom: 12px; border-bottom: 1px solid #e2e8f0; margin-bottom: 0; }
.channel-overview-identity h2 { margin: 0 0 3px; }
.channel-overview-identity .muted { white-space: nowrap; }
.channel-overview-metric { min-width: 0; }
.channel-overview-metric.center { text-align: center; }
.channel-overview-metric.right { text-align: right; }
.channel-overview-metric strong { display: block; font-size: 24px; line-height: 1.08; font-variant-numeric: tabular-nums; }
.channel-overview-metric span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-overview-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; align-items: stretch; }
.channel-overview-total > .channel-overview-grid { margin: 0 -16px -16px; }
.channel-overview-total > .channel-overview-grid > .channel-overview-card { border-right: 1px solid #e2e8f0; }
.channel-overview-total > .channel-overview-grid > .channel-overview-card:last-child { border-right: 0; }
.channel-overview-total > .channel-overview-grid > .channel-overview-card:nth-child(n + 6) { border-top: 1px solid #cbd5e1; }
.channel-overview-card { position: relative; min-width: 0; height: 100%; padding: 14px 16px 16px; }
.channel-overview-card .section-head { min-height: 66px; padding-right: 112px; }
.channel-overview-card .section-head > div { min-width: 0; }
.channel-overview-card .section-head h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-card-link { color: inherit; text-decoration: none; }
.channel-card-link:hover, .channel-card-link:focus-visible { color: #0369a1; text-decoration: underline; text-underline-offset: 3px; outline: none; }
.channel-column-total { position: absolute; top: 14px; right: 16px; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.channel-overview-rank { grid-template-columns: 18px minmax(0, 1fr) 92px; gap: 5px; }
.channel-overview-rank .analytics-rank-value { font-size: 10.5px; }
/* 全部汇总渠道卡片：订阅组/客户额度条形图（与渠道页签同一实体轴） */
.channel-budget-legend { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; padding: 10px 0; border-bottom: 1px solid #e2e8f0; color: var(--muted); font-size: 11px; }
.channel-budget-intro { display: grid; gap: 5px; min-width: 0; }
.channel-budget-card .section-head .muted { display: block; margin-right: -112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-budget-title { color: #0f172a; font-size: 12.5px; }
.channel-budget-keys { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.channel-budget-keys > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.channel-budget-swatch { display: inline-block; width: 12px; height: 8px; border-radius: 1px; }
.channel-budget-swatch.limit { width: 2px; height: 12px; border-radius: 0; background: #334155; }
.channel-budget-swatch.used, .channel-budget-seg.used { background: #16a34a; }
.channel-budget-swatch.remaining, .channel-budget-seg.remaining { background: rgba(34, 197, 94, .24); box-shadow: inset 0 0 0 1px rgba(22, 163, 74, .45); }
.channel-budget-swatch.over, .channel-budget-seg.over { background: #dc2626; }
.channel-budget-swatch.unlimited, .channel-budget-seg.unlimited { background: #0ea5e9; }
.channel-budget-overall { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; font-variant-numeric: tabular-nums; }
.channel-budget-overall-label { color: #334155; font-weight: 600; }
.channel-budget-summary { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 2px 10px; min-height: 45px; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px dashed #e2e8f0; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.channel-budget-summary strong, .channel-budget-overall strong { color: #0f172a; }
.channel-budget-summary .remaining strong, .channel-budget-overall .remaining strong { color: #15803d; }
.channel-budget-summary .over strong, .channel-budget-overall .over strong { color: #b91c1c; }
.channel-budget-list { display: grid; gap: 1px; }
.channel-budget-row { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 5px; align-items: start; padding: 4px; border-radius: 3px; }
.channel-budget-row .analytics-rank-index { padding-top: 2px; }
.channel-budget-row.is-link { cursor: pointer; }
.channel-budget-row.is-link:hover, .channel-budget-row.is-link:focus-visible { background: #f1f5f9; }
.channel-budget-row.is-link:focus-visible { outline: 2px solid rgba(15, 108, 189, .45); outline-offset: -2px; }
.channel-budget-main { display: grid; gap: 3px; min-width: 0; }
.channel-budget-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.channel-budget-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.channel-budget-used { flex: none; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.channel-budget-used.over { color: #b91c1c; }
.channel-budget-track { position: relative; height: 12px; }
.channel-budget-seg { position: absolute; top: 0; bottom: 0; }
.channel-budget-limit { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: #334155; }
.channel-budget-note { margin-top: 8px; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.channel-consumption-overview .section-head { margin-bottom: 12px; }
.channel-consumption-ranking { display: grid; grid-template-columns: repeat(var(--channel-rank-columns), minmax(0, 1fr)); gap: 14px; align-items: start; }
.channel-consumption-column { display: grid; gap: 0; min-width: 0; }
.channel-consumption-rank { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 5px 8px; align-items: start; min-height: 62px; padding: 7px 4px; border-top: 1px solid #eef2f7; }
.channel-consumption-rank:first-child { border-top: 0; }
.channel-consumption-main { display: grid; gap: 5px; min-width: 0; }
.channel-consumption-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.channel-consumption-line a { min-width: 0; overflow: hidden; color: inherit; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.channel-consumption-line a:hover, .channel-consumption-line a:focus-visible { color: #0369a1; }
.channel-consumption-line strong { flex: none; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.channel-consumption-track { height: 10px; background: #e8eef5; }
.channel-consumption-track span { display: block; height: 100%; background: #16a34a; }
.channel-consumption-main > .muted { font-size: 10.5px; }
.channel-overview-unassigned-wrap { margin-top: 2px; }
.channel-overview-unassigned { width: 100%; }
.channel-overview-unassigned .section-head { padding-right: 0; }
.channel-unassigned-columns { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: start; }
.channel-unassigned-column { display: grid; gap: 5px; min-width: 0; }
/* 渠道看板独立格式化上下文：末尾卡片外边距留在看板内（视觉不变），静默刷新按实际高度锁看板才精确，停在页面底部不被钳回 */
.channel-board { display: flow-root; }
/* 全部汇总 · 各渠道消耗监控：逐层复刻各渠道页签的主图、近31天日图与订阅明细表。面板宽度由 JS 按看板宽度下发（图表 viewBox = 面板内容像素，不留白）；
   屏外面板跳过渲染，占位高度与实际一致（头 48 + 主图 210 + 日图 250 + 明细 215 + 行距 18 = 741 内容高），滚动与静默刷新不跳动 */
.channel-monitor-stack { margin-top: 0; }
/* 页眉吸顶：滚进本区后标题、快速跳转与更新时间常驻页面顶端，面板从下方滚过（页面底色遮挡），离开本区随之滚走；吸顶时加底部阴影 */
.channel-monitor-stack-head { position: sticky; top: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 4px; padding: 6px 2px; background: var(--bg); }
.channel-monitor-stack-head.is-stuck { box-shadow: 0 7px 8px -7px rgba(16,24,40,.28); }
.channel-monitor-stack-head > div:first-child { flex: 1 1 300px; min-width: 0; }
.channel-monitor-stack-head h2 { margin: 0 0 3px; }
.channel-monitor-stack-head .muted { font-size: 12px; }
.channel-monitor-stack-side { display: grid; justify-items: end; gap: 4px; margin-left: auto; text-align: right; }
.channel-monitor-jump { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
.channel-monitor-jump > span { color: var(--muted); font-size: 12px; font-weight: 600; }
.channel-monitor-jump button { height: 26px; padding: 0 11px; border: 1px solid #bfdbfe; border-radius: 13px; background: #eff6ff; color: #1d4ed8; font-size: 12px; font-weight: 600; line-height: 24px; white-space: nowrap; }
.channel-monitor-jump button:hover, .channel-monitor-jump button:focus-visible { border-color: var(--primary); background: #dbeafe; color: #1e3a8a; }
.channel-monitor-jump button[aria-current] { border-color: var(--primary); background: var(--primary); color: #fff; }
/* 近7天/近30天无消耗的渠道排在最后并用虚线灰字区分（与渠道页签分区一致）；被标为当前渠道时仍按当前高亮 */
.channel-monitor-jump button.is-idle:not([aria-current]) { border-style: dashed; border-color: #cbd5e1; background: #f8fafc; color: #64748b; font-weight: 500; }
.channel-monitor-jump button.is-idle:not([aria-current]):hover, .channel-monitor-jump button.is-idle:not([aria-current]):focus-visible { border-color: #94a3b8; color: #334155; }
.channel-monitor-jump .channel-monitor-jump-top { border-color: var(--border); background: #fff; color: var(--muted); }
.channel-monitor-scroll { overflow-x: auto; margin-bottom: 14px; border-radius: 6px; }
.channel-monitor-panel {
  box-sizing: border-box; display: grid; grid-template-rows: 48px 210px 250px 215px; gap: 6px; padding: 12px 16px 10px;
  color: #202124; background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow);
  content-visibility: auto; contain-intrinsic-size: auto 741px;
}
.channel-monitor-panel.is-empty { grid-template-rows: 48px auto; content-visibility: visible; }
.channel-monitor-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; border-bottom: 1px solid #e5e7eb; }
.channel-monitor-identity { min-width: 0; }
.channel-monitor-identity h3 { margin: 0 0 2px; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-monitor-identity .muted { display: block; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-monitor-total { text-align: center; }
.channel-monitor-total strong { display: block; font-size: 24px; line-height: 1.08; font-variant-numeric: tabular-nums; }
.channel-monitor-total span { display: block; margin-top: 2px; color: #5f6368; font-size: 11px; }
.channel-monitor-open { justify-self: end; display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border: 1px solid #bfdbfe; border-radius: 14px; background: #eff6ff; color: #1d4ed8; font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.channel-monitor-open:hover, .channel-monitor-open:focus-visible { background: #dbeafe; color: #1e3a8a; outline: none; }
.channel-monitor-daily { display: grid; min-height: 0; }
@media (max-width: 1400px) {
  .channel-overview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .channel-consumption-ranking { grid-template-columns: repeat(min(var(--channel-rank-columns), 3), minmax(0, 1fr)); }
  .channel-overview-total > .channel-overview-grid > .channel-overview-card:nth-child(3n) { border-right: 0; }
  .channel-overview-total > .channel-overview-grid > .channel-overview-card:nth-child(n + 4) { border-top: 1px solid #cbd5e1; }
  .channel-overview-total > .channel-overview-grid > .channel-overview-card:nth-child(n + 6) { border-top: 0; }
}
@media (max-width: 1100px) {
  .channel-overview-head { grid-template-columns: 1fr 1fr; }
  .channel-overview-identity { grid-column: 1 / -1; }
  .channel-overview-metric.center { text-align: left; }
  .channel-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .channel-overview-total > .channel-overview-grid > .channel-overview-card:nth-child(odd) { border-right: 1px solid #e2e8f0; }
  .channel-overview-total > .channel-overview-grid > .channel-overview-card:nth-child(even) { border-right: 0; }
  .channel-overview-total > .channel-overview-grid > .channel-overview-card:nth-child(n + 3) { border-top: 1px solid #cbd5e1; }
  .channel-consumption-ranking { grid-template-columns: repeat(min(var(--channel-rank-columns), 2), minmax(0, 1fr)); }
  .channel-unassigned-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.subscription-snapshot-status { white-space: nowrap; }
.analytics-subscriptions summary { cursor: pointer; font-weight: 700; }
.analytics-tabs { display: flex; gap: 2px; border-bottom: 1px solid #cbd5e1; margin: -3px 0 14px; }
.analytics-tabs button, .analytics-detail-controls button { border: 0; border-radius: 0; background: transparent; color: #475569; padding: 9px 16px; }
.analytics-tabs button.active, .analytics-detail-controls button.active { color: var(--primary); font-weight: 700; border-bottom: 3px solid var(--primary); }
.analytics-tabs button:hover, .analytics-detail-controls button:hover { background: #f1f5f9; }
.foundry-view-tabs { margin: 4px 0 12px; }
.foundry-quota-filters .dashboard-filter-grid { grid-template-columns: minmax(210px, 1fr) minmax(200px, 1fr) minmax(200px, 1fr) minmax(240px, 1.2fr); }
.foundry-table { width: 100%; min-width: 720px; table-layout: fixed; }
.foundry-table th, .foundry-table td { vertical-align: middle; }
.foundry-metric-table th:nth-child(1), .foundry-metric-table td:nth-child(1) { width: 25%; }
.foundry-metric-table th:nth-child(2), .foundry-metric-table td:nth-child(2) { width: 10%; }
.foundry-metric-table th:nth-child(3), .foundry-metric-table td:nth-child(3) { width: 25%; }
.foundry-traffic-table th:nth-child(1), .foundry-traffic-table td:nth-child(1) { width: 34%; }
.foundry-history-table { min-width: 760px; }
.foundry-history-table th:nth-child(1), .foundry-history-table td:nth-child(1) { width: 18%; }
.foundry-history-table th:nth-child(2), .foundry-history-table td:nth-child(2) { width: 18%; }
.foundry-history-table th:nth-child(3), .foundry-history-table td:nth-child(3) { width: 16%; }
.foundry-subpage { margin-top: 0; }
.foundry-subscription-content { margin: 10px -14px -14px; border-top: 1px solid var(--border); }
.foundry-account-row { padding: 12px 14px; }
.foundry-account-row + .foundry-account-row { border-top: 1px solid var(--border); }
.multi-line-wrap { min-width: 0; }
.multi-line-wrap .chart-box { overflow-x: auto; }
.multi-line-legend { display: flex; flex-wrap: wrap; gap: 5px 12px; max-height: 76px; overflow-y: auto; padding: 8px 4px 0; border-top: 1px solid #eef2f7; }
.multi-line-legend span { display: inline-flex; align-items: center; gap: 5px; max-width: 230px; color: #475569; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.multi-line-legend i { width: 10px; height: 3px; flex: 0 0 auto; }
/* 交互曲线（Power BI 缩放滑块）：时间/金额双滑块、对数刻度、图例点击隐藏系列 */
.mlc-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 22px; align-items: end; margin: 2px 0 10px; }
.mlc-control { display: grid; gap: 2px; min-width: 0; font-size: 12px; color: var(--muted); }
.mlc-control-head { display: flex; justify-content: space-between; gap: 8px; }
.mlc-control-head strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mlc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.mlc-actions button { padding: 3px 10px; font-size: 12px; }
.mlc-actions label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.mlc-note:empty { display: none; }
.dual-range { position: relative; height: 22px; }
.dual-range-track, .dual-range-fill { position: absolute; top: 9px; height: 4px; border-radius: 2px; pointer-events: none; }
.dual-range-track { left: 0; right: 0; background: #e2e8f0; }
.dual-range-fill { background: var(--primary); }
.dual-range input[type="range"] { position: absolute; inset: 0; width: 100%; height: 22px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; pointer-events: none; -webkit-appearance: none; appearance: none; }
.dual-range input[type="range"]::-webkit-slider-runnable-track { height: 22px; background: transparent; }
.dual-range input[type="range"]::-moz-range-track { background: transparent; }
.dual-range input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 14px; height: 14px; margin-top: 4px; border: 2px solid var(--primary); border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .25); cursor: ew-resize; }
.dual-range input[type="range"]::-moz-range-thumb { pointer-events: auto; width: 10px; height: 10px; border: 2px solid var(--primary); border-radius: 50%; background: #fff; cursor: ew-resize; }
.dual-range input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid #93c5fd; outline-offset: 1px; }
.multi-line-legend.interactive button { display: inline-flex; align-items: center; gap: 5px; max-width: 230px; padding: 1px 5px; border: 0; border-radius: 4px; background: none; color: #475569; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.multi-line-legend.interactive button:hover { background: #f1f5f9; }
.multi-line-legend.interactive button.off { color: #cbd5e1; text-decoration: line-through; }
.multi-line-legend.interactive button.off i { opacity: .3; }
.analytics-compare-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(380px, .75fr); gap: 14px; }
.analytics-table-wrap { overflow: auto; max-height: 620px; }

.asp-registry-list { display: grid; gap: 10px; }
.asp-registry-item { min-width: 0; overflow: hidden; border: 1px solid #dbe3ed; border-radius: 6px; background: #fff; }
.asp-registry-field-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.asp-registry-field { min-width: 0; height: 76px; padding: 9px 10px; overflow: hidden; border-right: 1px solid #e8edf3; }
.asp-registry-field:nth-child(n+13) { border-top: 1px solid #dbe3ed; }
.asp-registry-field:nth-child(12n) { border-right: 0; }
.asp-registry-field > span { display: block; margin-bottom: 6px; color: #64748b; font-size: 12.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asp-registry-field > strong { display: -webkit-box; color: #172b4d; font-size: 14.5px; font-weight: 600; line-height: 1.4; overflow: hidden; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.asp-registry-field:first-child strong { color: #0f5ea8; }
.asp-company-head { display: flex; align-items: center; gap: 20px; min-height: 60px; padding: 10px 12px; border-bottom: 1px solid #dbe3ed; background: #f8fafc; }
.asp-company-head > div:first-child { flex: 0 1 390px; min-width: 240px; }
.asp-company-head strong { display: block; color: #172b4d; font-size: 15px; }
.asp-company-identities b { display: block; margin-top: 2px; color: #334f73; font-size: 13px; font-weight: 600; line-height: 1.3; }
.asp-company-head span { display: block; margin-top: 2px; color: #64748b; font-size: 12px; }
.asp-company-achievement { display: flex; flex: 1 1 auto; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; overflow: hidden; }
.asp-company-achievement > span { flex: 0 0 auto; margin: 0; color: #526176; font-size: 12.5px; font-weight: 700; }
.asp-company-achievement > strong, .asp-achievement-summary { min-width: 0; max-width: 440px; padding: 5px 9px; border: 1px solid #dbe3ed; border-radius: 4px; background: #fff; color: #526176; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asp-achievement-summary { display: inline-flex; align-items: baseline; gap: 7px; }
.asp-achievement-summary .asp-achievement-scope { margin: 0; color: #526176; font-size: 12px; }
.asp-achievement-summary .asp-achievement-consumption { display: inline; color: #0f5ea8; font-size: 16px; font-weight: 750; }
.asp-achievement-summary b { color: #172b4d; font-size: 13px; }
.asp-company-link-customer { flex: 0 0 auto; min-height: 34px; padding: 6px 12px; white-space: nowrap; }
.asp-company-profile { border-bottom: 1px solid #dbe3ed; }
.asp-company-customer-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.asp-company-asp-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid #dbe3ed; background: #fbfdff; }
.asp-company-customer-grid .asp-registry-field:nth-child(n), .asp-company-asp-grid .asp-registry-field:nth-child(n) { border-top: 0; }
.asp-company-customer-grid .asp-registry-field:last-child, .asp-company-asp-grid .asp-registry-field:last-child { border-right: 0; }
.asp-company-asp-grid .asp-registry-field > span { color: #526176; font-weight: 600; }
.asp-field-status { display: inline-flex; width: fit-content; align-items: center; min-height: 24px; padding: 2px 8px; border: 1px solid #dbe3ed; border-radius: 12px; font-size: 11px; }
.asp-field-status.yes { border-color: #b8e6d1; background: #dcfff1; color: #216e4e; }
.asp-field-status.no { border-color: #dbe3ed; background: #eef2f7; color: #526176; }
.asp-field-status.unset { border-color: #f5d59b; background: #fff8e6; color: #974f0c; }
.asp-company-claims { border-top: 1px solid #dbe3ed; overflow-x: auto; }
.asp-company-claim-head, .asp-company-claim-row { display: grid; grid-template-columns: 30px minmax(160px, 1.1fr) 88px 66px minmax(180px, 1.25fr) 82px 86px 86px 86px 104px 102px; gap: 8px; align-items: center; padding: 7px 10px; }
.asp-company-claim-head { min-height: 36px; border-bottom: 1px solid #dbe3ed; background: #f8fafc; color: #526176; font-size: 12px; font-weight: 650; }
.asp-company-claim-head span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asp-company-claim-row { min-height: 54px; border-bottom: 1px solid #eef2f7; font-size: 12.5px; }
.asp-company-claim-row:last-child { border-bottom: 0; }
.asp-company-claim-row > strong, .asp-company-claim-row > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asp-company-engagement { display: block; }
.asp-company-engagement small { display: block; margin-top: 3px; color: #974f0c; font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.asp-company-stage { display: inline-flex; align-items: center; justify-content: center; padding: 3px 7px; border-radius: 3px; background: #e9f2ff; color: #0055cc; font-size: 11px; font-weight: 650; }
.asp-company-claim-id { color: #0c66e4; font-weight: 600; }
.asp-company-sequence { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 3px; background: #eef2f7; color: #526176; font-size: 11.5px; font-weight: 700; }
.asp-company-stage-cell { display: flex; align-items: center; gap: 5px; min-width: 0; }
.asp-company-stage-cell input, .asp-board-claim-item input[type="checkbox"] { width: 15px; height: 15px; margin: 0; flex: 0 0 15px; }
.asp-company-claim-actions { display: flex; gap: 4px; justify-content: flex-end; }
.asp-company-claim-actions button { min-height: 30px; padding: 5px 8px; font-size: 12px; }
.asp-registry-actions > div { display: flex; gap: 4px; }
.asp-registry-actions button { min-height: 30px; padding: 5px 9px; font-size: 12px; }
.asp-registry-toolbar { flex-wrap: wrap; }
.asp-registry-toolbar > input[type="search"] { min-width: 260px; flex: 1 1 320px; }
.asp-registry-date-filter { display: flex; align-items: center; gap: 5px; flex: 1 1 455px; }
.asp-registry-date-filter select { min-width: 120px; }
.asp-registry-date-filter input { width: 128px; min-width: 108px; }
.asp-registry-date-filter span { color: var(--muted); font-size: 12px; }
.asp-registry-view-toggle { flex: 0 0 auto; }
.asp-partner-center-link { flex: 0 0 auto; padding: 7px 10px; border: 1px solid #b3d4ff; border-radius: 6px; background: #f4f8ff; color: #0055cc; font-size: 12px; font-weight: 600; white-space: nowrap; }
.asp-registry-form-tabs { position: sticky; top: 0; z-index: 2; display: flex; gap: 2px; margin: 12px 0; padding: 4px; overflow-x: auto; border: 1px solid #dbe3ed; border-radius: 6px; background: #f8fafc; }
.asp-registry-form-tabs button { flex: 1 0 auto; min-height: 36px; padding: 7px 12px; border: 0; border-radius: 4px; background: transparent; color: #475569; font-size: 12.5px; font-weight: 700; }
.asp-registry-form-tabs button:hover { background: #eef4fa; color: #0f172a; }
.asp-registry-form-tabs button.active { background: #0f5f96; color: #fff; }
.asp-registry-tab-panel[hidden] { display: none; }
.asp-registry-form-section { margin: 10px 0; padding: 14px 16px; }
.asp-registry-form-section > h3 { margin: 0 0 12px; font-size: 14px; }
.asp-registry-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.asp-registry-form-grid > .field { min-width: 0; margin-bottom: 0; }
.asp-registry-form-grid > .field:has(textarea) { grid-column: 1 / -1; }
.asp-registry-review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.asp-registry-preparation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.asp-registry-preparation-grid .asp-registry-form-section { margin-bottom: 0; }
.asp-registry-preparation-grid .asp-registry-form-grid { grid-template-columns: 1fr; }
.asp-registry-review-grid .asp-registry-form-section { margin: 0; }
.asp-registry-review-grid .asp-registry-form-grid { grid-template-columns: 1fr; }
.asp-registry-editor > h2 { margin-bottom: 6px; font-size: 18px; }
.asp-registry-editor .asp-registry-form-tabs { margin: 6px 0 8px; }
.asp-registry-editor .asp-registry-form-tabs button { min-height: 30px; padding: 5px 10px; }
.asp-registry-editor .asp-registry-form-section { padding: 10px 12px; }
.asp-registry-editor .asp-registry-form-grid { gap: 7px 12px; }
.asp-registry-editor .field > span { margin-bottom: 3px; }
.asp-registry-editor input, .asp-registry-editor select, .asp-registry-editor textarea { padding: 5px 8px; }
.asp-registry-editor .asp-registry-form-section legend { font-size: 12px; }
.asp-registry-editor .modal-actions { margin-top: 8px; }
.asp-linked-customer { display: flex; align-items: baseline; gap: 10px; min-height: 40px; padding: 10px 12px; border: 1px solid #b3d4ff; border-radius: 5px; background: #f4f8ff; }
.asp-linked-customer strong { color: #0f5f96; font-size: 14px; }
.asp-linked-customer span { color: #526176; font-size: 12px; }
.asp-customer-picker-wrap { margin-bottom: 10px; }
.asp-partner-center-link:hover { background: #e9f2ff; }
.asp-application-toolbar { width: 100%; }
.asp-application-toolbar > input[type="search"] { flex: 1 1 360px; max-width: 620px; }
.asp-application-toolbar > button { margin-left: auto; }
.asp-application-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 8px 16px; }
.asp-application-form-column { display: flex; min-width: 0; flex-direction: column; }
.asp-application-form-column > .field { margin-bottom: 7px; }
.asp-application-form-column > fieldset { margin-bottom: 7px !important; padding: 8px 12px; }
.asp-application-form-column > fieldset label { margin: 4px 0 !important; }
.asp-application-category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 10px; }
.asp-application-editor > h2 { margin-bottom: 6px; font-size: 18px; }
.asp-application-editor > .banner { margin-bottom: 5px; padding: 7px 10px; }
.asp-application-editor > .toolbar { min-height: 28px; margin-bottom: 5px !important; }
.asp-application-editor .field > span { margin-bottom: 3px; }
.asp-application-editor input, .asp-application-editor select, .asp-application-editor textarea { padding: 5px 8px; }
.asp-application-editor textarea { min-height: 54px; }
.asp-application-editor .modal-actions { margin-top: 8px; }
.asp-status-source { margin-top: 3px; font-size: 10px; white-space: nowrap; }
.asp-application-registry-line { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 5px; min-height: 25px; white-space: nowrap; }
.asp-application-registry-line + .asp-application-registry-line { margin-top: 3px; }
.asp-application-registry-line .tag { min-width: 42px; padding-inline: 6px; text-align: center; }
.asp-application-registry-line > :first-child, .asp-application-category-line { text-align: left; }
.asp-application-registry-line > :last-child { justify-self: end; }
.asp-application-category-line { min-height: 25px; line-height: 25px; white-space: nowrap; }
.asp-application-activation { display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; }
.asp-application-activation .tag { padding-inline: 6px; font-size: 10.5px; }
.asp-activation-current { border-color: #93c5fd; background: #e8f3ff; color: #075985; }
.asp-activation-next { border-color: #f5d59b; background: #fff8e6; color: #974f0c; }
.asp-applications-table th, .asp-applications-table td { text-align: center; vertical-align: middle; }
.asp-applications-table th:nth-child(2), .asp-applications-table td:nth-child(2) { text-align: left; }
.asp-applications-table td.num { text-align: center; }
.asp-applications-table .asp-application-registry-line { width: 100%; }
.asp-application-timeline { display: grid; grid-template-columns: 1fr 12px 1fr 12px 1fr; align-items: center; width: 100%; min-width: 270px; padding: 7px 8px; border: 0; background: transparent; }
.asp-application-timeline:hover { background: #f1f7fd; }
.asp-application-timeline > span { min-width: 0; text-align: center; }
.asp-application-timeline .asp-application-activation-list { display: grid; gap: 3px; }
.asp-application-timeline .asp-application-activation-list > span { display: grid; grid-template-columns: 1fr auto; column-gap: 4px; align-items: center; text-align: left; }
.asp-application-timeline .asp-application-activation-list small, .asp-application-timeline .asp-application-activation-list strong { display: inline; overflow: visible; white-space: normal; }
.asp-application-timeline .asp-application-activation-list strong { text-align: right; }
.asp-application-timeline small, .asp-application-timeline strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asp-application-timeline small { color: var(--muted); font-size: 11px; }
.asp-application-timeline strong { color: var(--text); font-size: 12px; font-weight: 650; }
.asp-application-timeline em { display: inline-block; margin-top: 2px; padding: 0 5px; border: 1px solid; border-radius: 9px; font-size: 9px; font-style: normal; }
.asp-application-timeline .asp-timeline-current { border-color: #93c5fd; background: #e8f3ff; color: #075985; }
.asp-application-timeline .asp-timeline-next { border-color: #f5d59b; background: #fff8e6; color: #974f0c; }
.asp-application-timeline > i { height: 1px; background: #b8c7d9; }
.asp-application-timeline-detail { position: relative; display: grid; gap: 0; padding: 4px 0; }
.asp-application-timeline-detail::before { position: absolute; top: 18px; bottom: 18px; left: 92px; width: 2px; background: #b8c7d9; content: ''; }
.asp-application-timeline-event { display: grid; grid-template-columns: 78px 1fr; gap: 26px; position: relative; min-height: 58px; padding: 8px 0; }
.asp-application-timeline-event time { position: relative; z-index: 1; align-self: start; padding-top: 8px; color: #172b4d; font-size: 13px; font-weight: 700; text-align: right; }
.asp-application-timeline-event time::after { position: absolute; top: 7px; right: -21px; width: 11px; height: 11px; border: 3px solid #0f6cbd; border-radius: 50%; background: #fff; content: ''; }
.asp-application-timeline-event > div { display: grid; gap: 5px; min-width: 0; padding: 6px 8px; border: 1px solid #dbe3ed; border-radius: 4px; background: #f4f8ff; }
.asp-application-timeline-action { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.asp-application-timeline-action > strong { flex: 0 0 72px; padding-top: 3px; color: #172b4d; font-size: 12px; }
.asp-application-timeline-action > span { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.asp-application-timeline-action em { padding: 3px 6px; border-radius: 3px; background: #fff; color: #334f73; font-size: 11px; font-style: normal; line-height: 1.35; }
.asp-application-actions { display: flex; justify-content: center; gap: 5px; white-space: nowrap; }
.asp-application-actions button { padding-inline: 10px; }
.asp-pending-batch-controls { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 3px 7px; border: 1px solid #f1c5c2; border-radius: 6px; background: #fff7f6; }
.asp-pending-batch-controls:empty { display: none; }
.asp-pending-batch-controls label { display: inline-flex; align-items: center; gap: 5px; color: #7a271a; font-size: 11.5px; white-space: nowrap; }
.asp-pending-batch-controls input { width: 15px; height: 15px; margin: 0; }
.asp-pending-batch-controls > span { color: #64748b; font-size: 11.5px; white-space: nowrap; }
.asp-pending-batch-controls button { min-height: 28px; padding: 4px 8px; font-size: 11px; }
.asp-board-layout { display: grid; gap: 8px; }
.asp-board-empty-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; min-height: 32px; padding: 5px 8px; border: 1px solid #dbe3ed; border-radius: 6px; background: #f8fafc; }
.asp-board-empty-strip > span:first-child { margin-right: 3px; color: #64748b; font-size: 10.5px; font-weight: 600; }
.asp-board-empty-status { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 7px; border-radius: 3px; background: #e9eef5; color: #64748b; font-size: 10.5px; }
.asp-board-empty-status-editing { background: #eef2f7; color: #44546f; }
.asp-board-empty-status-submitted { background: #e9f2ff; color: #0055cc; }
.asp-board-empty-status-under-review { background: #eae6ff; color: #5e4db2; }
.asp-board-empty-status-approved { background: #dcfff1; color: #216e4e; }
.asp-board-empty-status-attention { background: #fff3eb; color: #974f0c; }
.asp-board-empty-status-cancelled { background: #ffeceb; color: #ae2a19; }
.asp-board { display: grid; grid-template-columns: repeat(3, minmax(230px, 1fr)); gap: 10px; align-items: start; }
.asp-board-cols-1 { grid-template-columns: minmax(280px, 1fr); }
.asp-board-cols-2 { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
.asp-board-column { min-width: 0; border: 1px solid #dbe3ed; border-radius: 6px; background: #f4f6f9; overflow: hidden; }
.asp-board-column-head { display: flex; width: 100%; align-items: center; gap: 8px; padding: 10px 12px; border: 0; border-bottom: 1px solid #dbe3ed; border-radius: 0; background: #fff; text-align: left; }
.asp-board-column-head:hover { filter: brightness(.98); }
.asp-board-column-head strong { color: #172b4d; font-size: 13px; }
.asp-board-column[data-status="Editing"] .asp-board-column-head { border-top: 3px solid #6b7c93; background: #f8fafc; }
.asp-board-column[data-status="Submitted"] .asp-board-column-head { border-top: 3px solid #0c66e4; background: #f4f8ff; }
.asp-board-column[data-status="Under review"] .asp-board-column-head { border-top: 3px solid #7f6ac8; background: #f7f5ff; }
.asp-board-column[data-status="Approved"] .asp-board-column-head { border-top: 3px solid #22a06b; background: #f3fcf8; }
.asp-board-column[data-status="Attention"] .asp-board-column-head { border-top: 3px solid #e56910; background: #fff8f2; }
.asp-board-column[data-status="Cancelled"] .asp-board-column-head { border-top: 3px solid #c9372c; background: #fff6f5; }
.asp-board-column[data-status="Submitted"] .asp-board-column-head strong { color: #0055cc; }
.asp-board-column[data-status="Under review"] .asp-board-column-head strong { color: #5e4db2; }
.asp-board-column[data-status="Approved"] .asp-board-column-head strong { color: #216e4e; }
.asp-board-column[data-status="Attention"] .asp-board-column-head strong { color: #974f0c; }
.asp-board-column[data-status="Cancelled"] .asp-board-column-head strong { color: #ae2a19; }
.asp-board-column-counts { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.asp-board-column-counts span { display: inline-flex; align-items: center; justify-content: center; min-height: 22px; padding: 2px 7px; border-radius: 11px; background: #e9eef5; color: #526176; font-size: 10px; white-space: nowrap; }
.asp-board-column-counts span:last-child { background: #f1f5f9; color: #64748b; }
.asp-board-column-body { display: grid; gap: 8px; min-height: 72px; max-height: 520px; padding: 8px; overflow-y: auto; }
.asp-board-card { min-width: 0; padding: 14px; border: 1px solid #dbe3ed; border-left: 4px solid #6b7c93; border-radius: 6px; background: #fff; box-shadow: 0 2px 5px rgba(15,23,42,.07); }
.asp-board-card[data-status="Approved"] { border-left-color: #22a06b; }
.asp-board-card[data-status="Attention"] { border-left-color: #e56910; }
.asp-board-card[data-status="Cancelled"] { border-left-color: #c9372c; }
.asp-board-card[data-status="Submitted"] { border-left-color: #0c66e4; }
.asp-board-card[data-status="Under review"] { border-left-color: #7f6ac8; }
.asp-board-card-head { display: flex; align-items: flex-start; gap: 8px; }
.asp-board-customer-name { flex: 1; min-width: 0; }
.asp-board-customer-name strong, .asp-board-customer-name span { display: block; overflow: hidden; text-overflow: ellipsis; }
.asp-board-customer-name strong { color: #172b4d; font-size: 15px; line-height: 1.35; }
.asp-board-customer-name span { margin-top: 3px; color: #526176; font-size: 12px; white-space: nowrap; }
.asp-board-card-head-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.asp-board-card-head-actions button { min-height: 28px; padding: 4px 8px; font-size: 11px; }
.asp-board-status { flex: 0 0 auto; padding: 3px 8px; border-radius: 4px; background: #e9eef5; color: #526176; font-size: 11px; font-weight: 600; }
.asp-board-status-editing { background: #eef2f7; color: #44546f; }
.asp-board-status-approved { background: #dcfff1; color: #216e4e; }
.asp-board-status-attention { background: #fff3eb; color: #974f0c; }
.asp-board-status-cancelled { background: #ffeceb; color: #ae2a19; }
.asp-board-status-submitted { background: #e9f2ff; color: #0055cc; }
.asp-board-status-under-review { background: #eae6ff; color: #5e4db2; }
.asp-board-achievement { min-width: 148px; padding: 7px 9px; border: 1px solid #c7d6e8; border-radius: 5px; background: #f4f8ff; text-align: right; }
.asp-board-achievement span, .asp-board-achievement small { display: block; color: #526176; font-size: 10px; }
.asp-board-achievement strong { display: block; margin: 2px 0; color: #064e7c; font-size: 14px; }
.asp-board-company-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 9px; color: #64748b; font-size: 11px; }
.asp-board-company-meta > span:not(.asp-board-status) { padding: 3px 7px; border-radius: 4px; background: #f1f5f9; }
.asp-board-asp-flags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.asp-board-asp-flags span { padding: 4px 7px; border: 1px solid #dbe3ed; border-radius: 4px; background: #f8fafc; color: #64748b; font-size: 10.5px; font-weight: 600; }
.asp-board-asp-flags span.done { border-color: #b8e6d1; background: #f3fcf8; color: #216e4e; }
.asp-board-asp-flags span.no { border-color: #dbe3ed; background: #eef2f7; color: #526176; }
.asp-board-asp-flags span:not(.done):not(.no) { border-color: #f5d59b; background: #fff8e6; color: #974f0c; }
.asp-board-claim-list { display: grid; gap: 6px; margin-top: 9px; }
.asp-board-claim-item { padding: 11px; border: 1px solid #dbe3ed; border-radius: 5px; background: #fbfcfe; }
.asp-board-claim-head { display: flex; align-items: center; gap: 7px; }
.asp-board-claim-head > strong { color: #0055cc; font-size: 12px; }
.asp-board-claim-item > div:first-child strong { flex: 1; min-width: 0; color: #0c66e4; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.asp-board-claim-title { margin-top: 5px; color: #344563; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asp-board-pc-alert { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 6px; padding: 5px 7px; border: 1px solid #fbd5b5; border-radius: 4px; background: #fff8f2; color: #974f0c; font-size: 10.5px; }
.asp-board-pc-alert strong { margin-left: auto; color: #7a3e08; }
.asp-board-comment { margin-top: 5px; color: #526176; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asp-board-claim { margin-top: 7px; color: #0c66e4; font-size: 12px; font-weight: 600; }
.asp-board-customer, .asp-board-engagement, .asp-board-pc-status { margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asp-board-customer { color: #344563; font-size: 12px; }
.asp-board-engagement, .asp-board-pc-status { color: #64748b; font-size: 12px; }
.asp-board-milestones { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin-top: 9px; }
.asp-board-milestone { min-width: 0; padding: 6px; border: 1px solid #e1e7ef; border-radius: 4px; background: #fff; }
.asp-board-milestone span, .asp-board-milestone strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asp-board-milestone span { color: #64748b; font-size: 10.5px; }
.asp-board-milestone strong { margin-top: 2px; color: #334155; font-size: 12px; }
.asp-board-milestone.done { border-color: #b8e6d1; background: #f3fcf8; }
.asp-board-milestone.done strong { color: #216e4e; }
.asp-board-progress { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.asp-board-progress span { padding: 3px 6px; border-radius: 3px; background: #fff3eb; color: #974f0c; font-size: 10px; }
.asp-board-progress span.done { background: #dcfff1; color: #216e4e; }
.asp-board-actions { display: flex; gap: 5px; justify-content: flex-end; margin-top: 9px; padding-top: 8px; border-top: 1px solid #eef2f7; }
.asp-board-actions button { min-height: 32px; padding: 5px 11px; font-size: 12px; }
.asp-status-overview { min-width: 0; }
.asp-status-overview-head { margin: -16px -16px 14px; padding: 14px 18px; border-bottom: 1px solid #dbe3ed; border-top: 4px solid #6b7c93; background: #f8fafc; }
.asp-status-overview-head h2 { margin: 0 0 4px; font-size: 18px; }
.asp-status-overview-head[data-status="Submitted"] { border-top-color: #0c66e4; background: #f4f8ff; }
.asp-status-overview-head[data-status="Under review"] { border-top-color: #7f6ac8; background: #f7f5ff; }
.asp-status-overview-head[data-status="Approved"] { border-top-color: #22a06b; background: #f3fcf8; }
.asp-status-overview-head[data-status="Attention"] { border-top-color: #e56910; background: #fff8f2; }
.asp-status-overview-head[data-status="Cancelled"] { border-top-color: #c9372c; background: #fff6f5; }
.asp-status-overview-grid { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 10px; max-height: calc(100vh - 190px); overflow-y: auto; padding: 2px; }
.asp-status-overview-grid .asp-board-card { height: fit-content; }
.asp-achievement-customer { min-width: 190px; text-align: left; }
.asp-achievement-customer strong, .asp-achievement-customer span { display: block; }
.asp-achievement-customer span { margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.asp-achievement-table-wrap { max-height: clamp(320px, calc(100vh - 390px), 680px); overflow: auto; }
.asp-achievement-table thead th { position: sticky; top: 0; z-index: 3; background: #f8fafc; box-shadow: 0 1px 0 #cbd5e1; }
.asp-ppr-section { margin-top: 14px; }
.asp-ppr-kpis { display: grid; grid-template-columns: repeat(3, minmax(210px, 1fr)); gap: 10px; margin: 12px 0; }
.asp-ppr-kpi { min-width: 0; padding: 12px 14px; }
.asp-ppr-kpi > .muted { display: block; font-size: 11.5px; }
.asp-ppr-kpi > strong { display: block; margin: 4px 0; color: #0f2f4f; font-size: 19px; overflow-wrap: anywhere; }
.asp-ppr-kpi > small { display: block; font-size: 11px; }
.asp-ppr-toolbar { margin: 10px 0; }
.asp-ppr-toolbar select { min-width: 180px; }
.asp-ppr-table-wrap { max-height: min(680px, calc(100vh - 280px)); overflow: auto; border: 1px solid #dbe3ed; }
.asp-ppr-section .asp-ppr-table-wrap { max-height: none; }
.asp-ppr-status-note { max-width: 300px; white-space: normal; }
.asp-ppr-table { min-width: 2240px; margin: 0; }
.asp-ppr-table thead th { position: sticky; top: 0; z-index: 3; background: #f8fafc; }
.asp-ppr-table td { vertical-align: top; }
.asp-ppr-table td.num { white-space: nowrap; text-align: right; }
.asp-ppr-table td small { display: block; margin-top: 3px; }
.asp-ppr-platform-value { display: flex; align-items: center; gap: 5px; margin: 2px 0; white-space: nowrap; }
.asp-ppr-platform-value b { color: #0f5f96; }
.asp-poe-monitor-section { margin-top: 14px; }
.asp-poe-monitor-table { min-width: 1900px; margin: 0; }
.asp-poe-monitor-table thead th { position: sticky; top: 0; z-index: 3; background: #f8fafc; }
.asp-poe-monitor-table td { vertical-align: top; min-width: 118px; }
.asp-poe-monitor-table td:first-child { min-width: 190px; }
.asp-poe-monitor-table td.num { white-space: nowrap; text-align: right; }
.asp-poe-monitor-table td small { display: block; margin-top: 4px; line-height: 1.35; }
.asp-poe-severity-error { background: #fff5f5; }
.asp-poe-severity-warning { background: #fffaf0; }
.asp-poe-items-editor { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 12px; margin: 10px 0; }
.asp-poe-item-field { margin: 0; }
.err-text { color: #b42318; }
.asp-ppr-trend { margin: 10px 0; padding: 10px 12px; }
.asp-ppr-trend summary { cursor: pointer; font-weight: 700; }
.asp-ppr-warnings { max-height: 220px; overflow: auto; }
.asp-ppr-diff { margin: 8px 0; padding: 9px 11px; border-radius: 5px; background: #f1f5f9; }
.asp-ppr-compare .toolbar { margin: 8px 0; }
.asp-ppr-compare-portfolio { width: auto; min-width: 420px; margin: 8px 0; }
.asp-ppr-compare-table { min-width: 1280px; }
.asp-ppr-compare-table tr[data-change="status"] { background: #fffaf0; }
/* ASP · AI 增长奖励（FY27 SMB Agentic AI Growth Campaign）*/
.asp-ai-growth .tag.muted { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.asp-ai-growth-quarters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.asp-ai-growth .kpi-row { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.asp-ai-growth .kpi .kpi-sub { margin-top: 3px; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.asp-ai-growth-rules summary { cursor: pointer; font-weight: 700; }
.asp-ai-growth-rules h3 { margin: 12px 0 6px; font-size: 14px; }
.asp-ai-growth-rules ol { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.7; }
.asp-ai-growth-rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.asp-ai-growth-footnote { margin-top: 10px; font-size: 12px; }
.asp-ai-growth-toolbar { margin: 10px 0; }
.aig-tenant-card > .section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.aig-view-tabs { flex-shrink: 0; }
.aig-toolbar-extra { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.asp-ai-growth-table td.num .aig-rank-pill { display: block; width: max-content; margin: 3px 0 0 auto; }
.aig-focus-hint { display: block; margin-top: 3px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.aig-focus-hint.is-chance { color: #1d4ed8; }
.aig-focus-hint.is-ai { color: #c2410c; }
.aig-budget-view .aig-hint { margin-top: 8px; font-size: 11.5px; }
/* 不限高、不设内部滚动：一页展示全部 Tenant，表头随页面滚动吸顶 */
.asp-ai-growth-table-wrap { overflow: visible; border: 1px solid #dbe3ed; }
.asp-ai-growth-table { min-width: 1240px; margin: 0; }
.asp-ai-growth-table thead th { position: sticky; top: 0; z-index: 3; background: #f8fafc; box-shadow: 0 1px 0 #cbd5e1; white-space: nowrap; }
.asp-ai-growth-table td { vertical-align: top; }
.asp-ai-growth-table td.num { white-space: nowrap; }
.asp-ai-growth-table td small { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); line-height: 1.35; }
.asp-ai-growth-table td.num .tag { margin-left: 4px; font-size: 11px; padding: 0 6px; }
.asp-ai-growth-detail tr.is-baseline td { font-weight: 700; color: #0f5f96; }
.asp-ai-growth-customer { min-width: 200px; }
.asp-ai-growth-customer strong, .asp-ai-growth-customer span { display: block; }
.asp-ai-growth-customer span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.asp-ai-growth-customer .tag { margin-top: 4px; font-size: 11px; padding: 0 6px; }
.asp-ai-growth-customer small.aig-domain { display: block; color: #0f766e; font-family: ui-monospace, Consolas, monospace; font-size: 10.5px; overflow-wrap: anywhere; }
.asp-ai-growth-status { min-width: 200px; max-width: 300px; }
.asp-ai-growth-next { min-width: 190px; max-width: 280px; }
.asp-ai-growth-next ul { margin: 0; padding-left: 16px; font-size: 12px; line-height: 1.5; }
.asp-ai-growth-actions { white-space: nowrap; }
.asp-ai-growth-actions button { padding: 3px 9px; font-size: 12px; }
.asp-ai-growth-actions button + button { margin-left: 6px; }
.asp-ai-growth-table .asp-ai-growth-select { width: 34px; text-align: center; }
.asp-ai-growth-select input { width: auto; margin: 0; }
.asp-ai-growth-batch-list { max-height: 96px; overflow: auto; margin: 10px 0 12px; font-size: 12px; line-height: 1.5; }
.asp-ai-growth-readiness .section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.asp-ai-growth-readiness h2 { margin: 0 0 2px; font-size: 15px; }
.asp-ai-growth-readiness-list { margin: 8px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; font-size: 13px; }
.asp-ai-growth-readiness-list li { display: flex; gap: 8px; color: #92400e; }
.asp-ai-growth-readiness-list li.is-done { color: var(--ok); }
.asp-ai-growth-check-mark { flex: 0 0 auto; font-weight: 700; }
.asp-ai-growth-detail section { margin-top: 16px; }
.asp-ai-growth-detail h3 { margin: 0 0 6px; font-size: 14px; }
.asp-ai-growth-detail table { font-size: 12.5px; }
.asp-ai-growth-detail td small { color: var(--muted); font-size: 11px; }
.asp-ai-growth-detail td small.asp-ai-growth-action-line { display: block; color: #0f5f96; }
.asp-ai-growth-review-summary { display: grid; gap: 4px; font-size: 13px; }
.asp-ai-growth-scroll { max-height: 380px; overflow: auto; border: 1px solid #e2e8f0; border-radius: 6px; }
.asp-ai-growth-faa { padding: 6px 0; border-bottom: 1px dashed #e2e8f0; }
.asp-ai-growth-check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; }
.asp-ai-growth-check input { width: auto; margin: 0; }
/* AI 增长奖励图解看板 */
.aig-dash .section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.aig-dash h2 { margin: 0 0 2px; font-size: 15px; }
.aig-dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.aig-panel { min-width: 0; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; background: #fff; }
.aig-panel.is-wide { grid-column: span 2; }
.aig-panel-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 6px; }
.aig-panel-head h3 { margin: 0; font-size: 13.5px; }
.aig-panel-head .muted { font-size: 11.5px; }
.aig-hint { margin-top: 6px; font-size: 11.5px; }
.aig-chart { display: block; width: 100%; height: auto; }
.aig-chart .aig-axis { font-size: 10.5px; fill: #64748b; }
.aig-chart .aig-group { font-size: 11px; fill: #64748b; }
.aig-chart .aig-group-active { fill: #3730a3; font-weight: 700; }
.aig-chart .aig-tag-text { font-size: 10px; fill: #334155; font-weight: 600; }
.aig-chart .aig-delta { font-size: 11px; font-weight: 700; }
.aig-chart .aig-baseline-text { font-size: 11px; fill: #dc2626; font-weight: 700; }
.aig-chart .aig-prospect-base { stroke: #fff; stroke-width: 4px; stroke-linejoin: round; paint-order: stroke; }
.aig-chart-mini { width: 120px; height: 34px; margin: 0 0 3px auto; }
.aig-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 11.5px; color: #475569; }
.aig-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.aig-swatch { display: inline-block; width: 12px; height: 10px; border-radius: 2px; }
.aig-swatch.is-candidate { background: #cbd5e1; }
.aig-swatch.is-baseline { background: #64748b; }
.aig-swatch.is-ai { background: #8b5cf6; }
.aig-swatch.is-other { background: #0ea5e9; }
.aig-swatch.is-target { background: #f8fafc; border: 1.2px dashed #475569; }
.aig-swatch.is-full { background: #fff7ed; border: 1.4px dashed #ea580c; }
.aig-swatch.is-line { height: 0; border-top: 2px dashed #dc2626; border-radius: 0; }
.aig-kpi-row .kpi.ok { border-color: #bbf7d0; background: #f0fdf4; }
.aig-kpi-row .kpi.info { border-color: #bfdbfe; background: #eff6ff; }
.aig-kpi-row .kpi.is-filter { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.aig-kpi-row .kpi.is-filter:hover, .aig-kpi-row .kpi.is-filter:focus-visible { border-color: #64748b; box-shadow: 0 1px 4px rgba(15, 23, 42, .12); outline: none; }
.aig-kpi-row .kpi.is-active { border-color: #1e293b; box-shadow: inset 0 0 0 1px #1e293b; }
.aig-kpi-row .kpi.is-active .kpi-label::after { content: ' · 已筛选'; color: #1e293b; font-weight: 600; }
.aig-example { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 8px; font-size: 12.5px; }
.aig-example-picker { width: 520px; max-width: 100%; }
.aig-md-split { justify-content: flex-end; gap: 0 6px; font-size: 10.5px; color: #475569; }
.aig-realized-line { padding: 3px 6px; border-radius: 4px; background: #ecfdf5; }
.aig-realized-line.is-actual { margin-top: 3px; background: #eff6ff; }
.aig-actual-line { padding: 2px 6px; border-left: 3px solid #93c5fd; color: #334155; }
.asp-ai-growth-table td.num small.aig-actual-hint { color: #1d4ed8; }
.aig-steps { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 8px; padding: 0; list-style: none; counter-reset: none; }
.aig-step { position: relative; min-width: 0; padding: 8px 9px; border: 1px solid #e2e8f0; border-top: 3px solid #94a3b8; border-radius: 6px;
  background: #f8fafc; font-size: 12px; line-height: 1.5; }
.aig-step.is-ok { border-top-color: #16a34a; }
.aig-step.is-fail { border-top-color: #dc2626; }
.aig-step + .aig-step::before { content: '→'; position: absolute; left: -9px; top: 10px; color: #94a3b8; font-weight: 700; }
.aig-step-head { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 4px; font-size: 12.5px; }
.aig-step-no { flex: 0 0 18px; height: 18px; border-radius: 50%; background: #334155; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.aig-step-body > div { margin-top: 3px; overflow-wrap: anywhere; }
.aig-step-body .muted { font-size: 11px; }
.aig-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.aig-chip { padding: 1px 6px; border-radius: 10px; background: #e2e8f0; color: #334155; white-space: nowrap; }
.aig-chip.is-pick { background: #475569; color: #fff; font-weight: 700; }
.aig-month-deltas { display: grid; gap: 3px; font-size: 11.5px; }
.aig-month-delta { padding: 2px 0 3px; border-bottom: 1px dashed #e2e8f0; }
.aig-month-delta:last-child { border-bottom: 0; }
.aig-md-line { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 6px; }
.aig-md-line .num { font-variant-numeric: tabular-nums; white-space: nowrap; margin-left: auto; }
.aig-up { color: #15803d; }
.aig-down { color: #b91c1c; }
.aig-formula-tabs { margin-bottom: 8px; }
.aig-rank { margin: 0; padding: 0; list-style: none; }
.aig-rank-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto 64px 64px; grid-template-areas: 'no name nums value actual' 'no gauge gauge value actual';
  align-items: center; gap: 1px 8px; width: 100%; padding: 4px 6px 5px 4px; border: 0; border-bottom: 1px solid #f1f5f9; border-radius: 6px; background: none; font-size: 12.5px; line-height: 1.3; text-align: left; cursor: pointer; }
/* 当月实际 vs 基线对比条（第二行铺满）：灰 = 基线以内，绿 = 超出基线，红 = 距基线还差，竖线 = 基线；数字在第一行右侧定宽对齐 */
.aig-gauge { grid-area: gauge; position: relative; height: 8px; margin: 2px 0 1px; border-radius: 4px; background: #f1f5f9; overflow: hidden; }
.aig-gauge > span { position: absolute; top: 0; bottom: 0; }
.aig-gauge-in { left: 0; background: #94a3b8; }
.aig-gauge-over { background: #16a34a; }
.aig-gauge-gap { background: repeating-linear-gradient(135deg, #fecaca 0 3px, #fee2e2 3px 6px); }
.aig-gauge-tick { width: 2px; margin-left: -1px; background: #0f172a; }
.aig-gauge.is-empty { background: repeating-linear-gradient(135deg, #f1f5f9 0 3px, #f8fafc 3px 6px); }
.aig-rank-row > .aig-gauge-text { grid-area: nums; }
.aig-gauge-text { display: grid; grid-template-columns: 54px 58px 52px; gap: 0 4px; text-align: right; font-size: 11px; color: #64748b; white-space: nowrap; font-variant-numeric: tabular-nums; }
.aig-gauge-text b { color: #0f172a; font-weight: 600; }
.aig-gauge-text em { font-style: normal; font-weight: 600; }
.aig-gauge-swatch { display: inline-block; width: 14px; height: 8px; margin-right: 3px; border-radius: 2px; vertical-align: middle; }
.aig-gauge-swatch.is-in { background: #94a3b8; }
.aig-gauge-swatch.is-over { background: #16a34a; }
.aig-gauge-swatch.is-gap { background: repeating-linear-gradient(135deg, #fecaca 0 3px, #fee2e2 3px 6px); }
.aig-rank-pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; background: #f1f5f9; color: #64748b; }
.aig-rank-pill.is-below { background: #fee2e2; color: #b91c1c; }
.aig-rank-pill.is-ai_short { background: #ffedd5; color: #c2410c; }
.aig-rank-pill.is-capped { background: #dbeafe; color: #1d4ed8; }
.aig-rank-bill { justify-self: start; max-width: 100%; color: #1d4ed8; text-decoration: none; }
.aig-rank-bill:hover, .aig-rank-bill:focus-visible { text-decoration: underline; }
.aig-rank-bill::after { content: ' ↗'; font-size: 10px; color: #94a3b8; }
.aig-rank-row.is-out .aig-rank-bill { color: #64748b; }
.aig-rank-cols { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto 64px 64px; gap: 0 8px; height: 22px; padding: 0 6px 0 32px; align-items: center; background: #fff; font-size: 10.5px; color: #94a3b8; }
.aig-rank-cols .aig-gauge-text, .aig-rank-cols .aig-gauge-text b, .aig-rank-cols .aig-gauge-text em { font-size: 10.5px; color: #94a3b8; font-weight: 400; }
.aig-rank-cols-value { text-align: right; }
.aig-rank-group { position: sticky; top: 22px; z-index: 1; margin-top: 4px; padding: 3px 6px; border-radius: 4px; background: #f1f5f9; color: #334155; font-size: 11px; font-weight: 600; }
.aig-rank-group.is-reward { background: #dcfce7; color: #166534; }
.aig-rank-group.is-none { background: #fef3c7; color: #92400e; }
.aig-rank-row:hover, .aig-rank-row:focus-visible { background: #f1f5f9; outline: none; }
.aig-rank-row.is-active { background: #ecfdf5; box-shadow: inset 3px 0 0 #16a34a; }
.aig-rank-row.is-out { color: #94a3b8; }
.aig-rank-no { grid-area: no; justify-self: end; color: #64748b; font-variant-numeric: tabular-nums; }
.aig-rank-name { grid-area: name; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.aig-rank-value { grid-area: value; display: grid; justify-items: end; line-height: 1.2; }
.aig-rank-value strong { font-size: 14px; color: #15803d; font-variant-numeric: tabular-nums; }
/* 实际奖励列（扣满本季基线）：蓝色区分预估；暂无奖励且实际也为 0 时原因标签横跨预估 / 实际两列 */
.aig-rank-value.is-actual { grid-area: actual; }
.aig-rank-value.is-actual strong { font-size: 13px; color: #1d4ed8; }
.aig-rank-value.is-wide { grid-column: value-start / actual-end; grid-row: 1 / 3; }
.aig-rank-zero { color: #94a3b8; font-variant-numeric: tabular-nums; }
.aig-rank-legend { display: inline-flex; flex-wrap: wrap; gap: 2px 10px; font-size: 11.5px; color: #475569; }
/* 计算过程图解两栏：左 = 分步卡片 + 柱形图，右 = 奖励排名；行高由左栏决定，排名绝对定位铺满同高格子，超出部分在列表内滚动 */
.aig-explain { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 30%); gap: 12px; align-items: stretch; }
.aig-explain-main { min-width: 0; }
.aig-explain-main .aig-steps { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.aig-rank-side { position: relative; min-height: 420px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; }
/* 中等宽度放不下 5 张分步卡片并排时：分步卡片铺满整行，柱形图与排名在下方并排 */
@media (max-width: 1680px) {
  .aig-explain { grid-template-areas: 'steps steps' 'chart side'; }
  .aig-explain-main { display: contents; }
  .aig-explain-main > .aig-steps { grid-area: steps; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); margin: 0; }
  .aig-explain-main > :last-child { grid-area: chart; min-width: 0; }
  .aig-explain > .aig-rank-side { grid-area: side; }
  .aig-rank-row { grid-template-areas: 'no name name value actual' 'no gauge nums value actual'; }
  /* 数字列移到对比条同一行后，列头左侧只剩极窄空间：隐藏「实际 vs 基线」，月份已标在实际数字列头 */
  .aig-rank-cols > span:first-child { visibility: hidden; }
}
.aig-rank-cols > span:first-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.aig-rank-box { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 8px 6px 6px 8px; }
.aig-rank-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; padding: 0 4px 6px 0; border-bottom: 1px solid #f1f5f9; margin-bottom: 4px; }
.aig-rank-head h4 { margin: 0; font-size: 13px; }
.aig-rank-head .muted { font-size: 11.5px; }
.aig-rank-box > .aig-rank, .aig-rank-box > .empty-tip { position: relative; flex: 1; min-height: 0; overflow-y: auto; }
.aig-panel.is-full { grid-column: 1 / -1; }
.aig-dash .aig-formula-panel .aig-chart { max-height: 520px; }
.aig-dash-grid[hidden] { display: none; } /* 收起图表：显式 display:grid 会覆盖 hidden 属性的默认样式 */
.aig-dash-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.aig-plan-target-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.aig-plan-target { min-width: 190px; }
.aig-formula-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 8px; }
.aig-formula-bar .aig-formula-tabs { margin-bottom: 0; }
.aig-plan-sub { font-size: 10px; fill: #475569; }
.aig-swatch.is-plan { background: none; border: 0; border-top: 3px solid; height: 0; border-radius: 2px; }
.aig-chart .aig-bar-head { font-size: 11.5px; font-weight: 700; fill: #0f172a; }
.aig-chart .aig-plan-mark-text { font-size: 10px; font-weight: 700; }
.aig-chart .aig-full-total, .aig-chart .aig-full-head, .aig-chart .aig-full-rest { font-weight: 700; }
.aig-chart .aig-full-actual { font-weight: 600; }
.aig-chart-caption { font-size: 12px; color: #475569; margin: 0 0 4px; line-height: 1.5; }
.aig-legend-break { color: #475569; font-weight: 600; }
.aig-plan-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.aig-plan-summary > div { display: grid; gap: 1px; padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 6px; background: #f8fafc; font-size: 12px; }
.aig-plan-summary strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.aig-plan-summary small { color: #64748b; font-size: 11px; }
.aig-plan-table-wrap { overflow-x: auto; }
.aig-plan-table { font-size: 12px; }
.aig-plan-table th:last-child .tk-handle { right: 0; }
.aig-plan-table td { vertical-align: top; }
.aig-plan-table td small { display: block; font-size: 10.5px; white-space: nowrap; }
.aig-plan-row { cursor: pointer; }
.aig-plan-row:hover td { background: #f8fafc; }
.aig-plan-name { max-width: 260px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.aig-plan-table td small.aig-plan-en { max-width: 260px; overflow: hidden; text-overflow: ellipsis; color: #475569; }
.aig-plan-table td small.aig-plan-domain { max-width: 260px; overflow: hidden; text-overflow: ellipsis; color: #0f766e; font-family: ui-monospace, Consolas, monospace; }
th.aig-sort-th { cursor: pointer; user-select: none; white-space: nowrap; }
th.aig-sort-th:hover { background: #eef2f7; }
th.aig-sort-th.is-sorted { color: #1d4ed8; }
.aig-sort-mark { color: #94a3b8; font-size: 10px; }
.aig-sort-th.is-sorted .aig-sort-mark { color: #1d4ed8; }
.aig-plan-cell { display: grid; gap: 0; min-width: 118px; padding: 3px 7px; border-left: 3px solid #94a3b8; border-radius: 3px; background: #f8fafc; line-height: 1.35; }
.aig-plan-cell strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.aig-plan-cell small { display: block; font-size: 10.5px; white-space: nowrap; }
.aig-plan-cell .aig-plan-ai { color: #7c3aed; }
.aig-plan-cell.is-ok { border-left-color: #16a34a; background: #f0fdf4; }
.aig-plan-cell.is-ok strong { color: #15803d; }
.aig-plan-cell.is-warn { border-left-color: #d97706; background: #fffbeb; }
.aig-plan-cell.is-warn strong { color: #b45309; }
.aig-plan-cell.is-bad { border-left-color: #dc2626; background: #fef2f2; }
.aig-plan-cell.is-bad strong { color: #b91c1c; }
.aig-plan-cell.is-plan { border-left-color: #f59e0b; background: #fefce8; }
.aig-plan-cell.is-plan strong { color: #a16207; }
.aig-plan-cell.is-done { color: #64748b; }
.aig-plan-more { margin-top: 6px; }
.aig-prospect summary { cursor: pointer; font-weight: 700; }
.aig-prospect summary .muted { font-weight: 400; font-size: 12px; }
.aig-prospect-form { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px 12px; margin: 10px 0; }
.aig-prospect-field { display: grid; gap: 3px; min-width: 0; font-size: 12px; }
.aig-prospect-field > span { color: #334155; font-weight: 600; }
.aig-prospect-field input, .aig-prospect-field select { width: 100%; min-width: 0; }
.aig-prospect-field small { font-size: 10.5px; }
.aig-prospect-results { display: grid; gap: 8px; }
.aig-prospect-chart .aig-prospect-q { font-size: 12.5px; font-weight: 700; }
.aig-prospect-months { display: flex; flex-wrap: wrap; gap: 2px 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.aig-prospect-status { display: inline-block; padding: 0 6px; border: 1px solid; border-radius: 10px; font-weight: 700; white-space: nowrap; }
.aig-prospect-table td small { white-space: normal; }
.aig-prospect-checklist h3 { margin: 12px 0 4px; font-size: 13.5px; }
.aig-prospect-checklist ol { margin: 0; padding-left: 20px; font-size: 12.5px; line-height: 1.7; }
@media (max-width: 1400px) { .aig-prospect-form { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) { .aig-prospect-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1600px) {
  .aig-dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: dense; }
}
@media (max-width: 900px) {
  .aig-dash-grid { grid-template-columns: minmax(0, 1fr); }
  .aig-panel.is-wide { grid-column: auto; }
  .aig-plan-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .aig-explain { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'steps' 'chart' 'side'; }
  .aig-explain-main > .aig-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aig-rank-side { height: 360px; }
}
@media (max-width: 1100px) {
  .aig-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aig-step + .aig-step::before { content: none; }
}
@media (max-width: 600px) { .aig-steps, .aig-explain-main > .aig-steps { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 960px) {
  .asp-ai-growth-rules-grid, .asp-ai-growth-readiness-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1200px) {
  .asp-registry-field-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .asp-registry-field:nth-child(12n) { border-right: 1px solid #e8edf3; }
  .asp-registry-field:nth-child(6n) { border-right: 0; }
  .asp-registry-field:nth-child(n+7) { border-top: 1px solid #dbe3ed; }
  .asp-board { grid-template-columns: repeat(2, minmax(230px, 1fr)); }
  .asp-company-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .asp-company-head > div:first-child { flex-basis: auto; min-width: 0; }
  .asp-company-achievement { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .asp-company-customer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .asp-company-asp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .asp-company-customer-grid .asp-registry-field:nth-child(n+4), .asp-company-asp-grid .asp-registry-field:nth-child(n+4) { border-top: 1px solid #dbe3ed; }
  .asp-company-customer-grid .asp-registry-field:nth-child(3n), .asp-company-asp-grid .asp-registry-field:nth-child(3n) { border-right: 0; }
  .asp-company-claim-head, .asp-company-claim-row { grid-template-columns: 28px minmax(145px, 1fr) 80px 62px minmax(150px, 1fr) 76px 96px 96px; }
  .asp-claim-date-col { display: none; }
  .asp-linked-customer { align-items: flex-start; flex-direction: column; gap: 3px; }
  .asp-status-overview-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
}
@media (max-width: 720px) {
  .asp-application-form-grid { grid-template-columns: 1fr; }
  .asp-application-category-grid { grid-template-columns: 1fr; }
  .asp-registry-form-grid, .asp-registry-review-grid, .asp-registry-preparation-grid { grid-template-columns: 1fr; }
  .asp-board-milestones { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asp-board-card-head { flex-direction: column; }
  .asp-board-card-head-actions, .asp-board-achievement { width: 100%; }
  .asp-board-achievement { box-sizing: border-box; text-align: left; }
  .asp-board { grid-template-columns: 1fr; }
  .asp-company-customer-grid, .asp-company-asp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asp-company-customer-grid .asp-registry-field:nth-child(n+3), .asp-company-asp-grid .asp-registry-field:nth-child(n+3) { border-top: 1px solid #dbe3ed; }
  .asp-company-customer-grid .asp-registry-field:nth-child(2n), .asp-company-asp-grid .asp-registry-field:nth-child(2n) { border-right: 0; }
  .asp-status-overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .asp-ppr-kpis { grid-template-columns: 1fr; }
  .asp-poe-items-editor { grid-template-columns: 1fr; }
  .channel-overview-head { grid-template-columns: 1fr; }
  .channel-overview-identity { grid-column: auto; }
  .channel-overview-metric.center, .channel-overview-metric.right { text-align: left; }
  .subscription-compare-table-wrap { overflow-x: auto; }
  .subscription-group-budget-table { min-width: 900px; }
  .subscription-service-table { min-width: 620px; }
  .subscription-compare-actions { justify-content: flex-start; flex-wrap: wrap; }
  .subscription-dimension-rankings { grid-template-columns: 1fr; }
}
.analytics-compare-table { min-width: 620px; }
.analytics-compare-table th { position: sticky; top: 0; z-index: 1; }
.analytics-compare-table .diff-up { color: #dc2626; font-weight: 700; }
.analytics-compare-table .diff-down { color: #15803d; font-weight: 700; }
.analytics-detail-controls { display: flex; gap: 2px; margin-bottom: 12px; border-bottom: 1px solid #cbd5e1; }
.analytics-diff-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.analytics-diff-kpis .stat .value.diff-up { color: #dc2626; }
.analytics-diff-kpis .stat .value.diff-down { color: #15803d; }
@media (max-width: 1350px) {
  .analytics-top-grid { grid-template-columns: repeat(2, minmax(360px, 1fr)); }
  .analytics-funds { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 24px; }
  .analytics-funds h2, .analytics-period-summary { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .analytics-top-grid, .analytics-rank-grid, .analytics-compare-grid, .analytics-subscription-grid, .subscription-compare-grid, .channel-overview-total .analytics-ranking { grid-template-columns: minmax(0, 1fr); }
  .analytics-compare-grid > .card { min-width: 0; }
  .channel-overview-grid { grid-template-columns: 1fr; }
  .channel-consumption-ranking { grid-template-columns: 1fr; min-width: 0; }
  .channel-overview-total > .channel-overview-grid > .channel-overview-card { border-right: 0; border-bottom: 1px solid #e2e8f0; }
  .channel-overview-total > .channel-overview-grid > .channel-overview-card { border-top: 0; }
  .channel-overview-total > .channel-overview-grid > .channel-overview-card:last-child { border-bottom: 0; }
  .channel-unassigned-columns { grid-template-columns: 1fr; }
  .analytics-funds { grid-column: auto; display: flex; }
  .analytics-diff-kpis { grid-template-columns: 1fr; }
}

/* 打印 = 导出 PDF：9:16 纵向画布（等比例于 1080×1920），只保留账单主体 */
@page { size: 1080px 1920px; margin: 40px; }

/* 账单邮件 PDF 导出态（html2canvas 捕获瞬间附加）：固定宽度保证任意窗口下版面一致；
   复用打印版明细规则（展开滚动区、限行）；azure_plain 模板隐藏我方公司 Logo */
.bill-main.bill-mail-export { width: 1080px; max-width: 1080px; box-shadow: none; border: none; }
.bill-main.bill-mail-export .no-print { display: none !important; }
.bill-main.bill-mail-export .bill-detail-table-wrap { max-height: none; overflow: visible; border: 0; }
.bill-main.bill-mail-export .bill-detail-table-wrap .bill-table { min-width: 0; table-layout: fixed; }
.bill-main.bill-mail-export .bill-detail-table-wrap th, .bill-main.bill-mail-export .bill-detail-table-wrap td { padding: 5px 6px; font-size: 10.5px; overflow-wrap: anywhere; }
.bill-main.bill-mail-export .bill-detail-table-wrap thead th, .bill-main.bill-mail-export .bill-detail-table-wrap tfoot td { position: static; }
.bill-main.bill-mail-export .bill-detail-table-wrap thead { position: static; }
.bill-main.bill-mail-export .bill-detail-table-wrap thead tr.bill-head-en th { padding-top: 0; font-size: 9px; }
.bill-main.bill-mail-export .bill-detail-table-wrap tbody tr:nth-child(n+25) { display: none; }
/* 捕获发生在屏幕上，窗口变窄会命中 screen 断点：导出态显式固定桌面概要版式 */
.bill-main.bill-mail-export .bill-summary { flex-wrap: wrap; gap: 32px; }
.bill-main.bill-mail-export .bill-kvs { flex: 1 1 560px; max-width: 680px; grid-template-columns: repeat(2, minmax(250px, 1fr)); gap: 0 24px; }
.bill-main.bill-mail-export .bill-donut { width: auto; }
.bill-main.bill-mail-export .bill-title { grid-template-columns: auto minmax(0, 1fr) auto; }
.bill-main.bill-mail-export .bill-brand-logos { grid-column: auto; }
.bill-main.bill-hide-company-logo .bill-company-logo { display: none !important; }

@media print {
  #sidebar, #btn-mobile-nav, #btn-nav-toggle, .no-print, #toast-wrap, #modal-wrap, .modal-overlay { display: none !important; }
  /* 禁用登记斜纹柱只给内部账号屏幕查看：打印 / 存 PDF（客户可见）还原原色实心柱，红虚框与灰色轴名称一并还原 */
  .bill-main .chart-ended-bar { fill: var(--chart-ended-fill) !important; stroke: none !important; }
  .bill-main .chart-ended-usage { display: none !important; }
  .bill-main .chart-ended-axis { fill: #475569 !important; }
  html, body { width: 100%; min-width: 0; }
  body { background: #fff; color: #1a2332; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #main { width: 100%; max-width: none; padding: 0; }
  .bill-layout { display: block; }
  .bill-main { width: 100%; max-width: none; box-shadow: none; border: none; padding: 0; margin: 0; }
  .bill-title { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 64px; padding-bottom: 12px; margin-bottom: 16px; }
  .bill-title h1 { min-width: 0; margin: 0; font-size: 23px; line-height: 1.2; white-space: normal; overflow: visible; overflow-wrap: anywhere; }
  .bill-title h1.long { font-size: 17px; }
  .bill-title h1.very-long { font-size: 14px; }
  .bill-badge { flex: none; padding: 5px 12px; font-size: 15px; line-height: 1.2; background: #10243e !important; color: #fff !important; }
  .bill-brand-logos { max-width: none; margin: 0; gap: 1px; flex-wrap: nowrap; white-space: nowrap; justify-self: end; }
  .bill-azure-logo { max-width: 165px; max-height: 38px; }
  .bill-azure-logo.m365-logo { max-width: 200px; max-height: 42px; }
  .bill-company-logo { max-width: 150px; max-height: 44px; }
  .bill-title > .muted { grid-column: 1 / -1; }
  /* 概要与页面同为两列表格；A4 等窄纸放不下环图时环图换到下方，而不是压窄金额列 */
  .bill-summary { flex-wrap: wrap; gap: 20px 30px; }
  .bill-kvs { flex: 1 1 460px; min-width: 460px; max-width: 500px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }
  .bill-donut { flex: 0 1 430px; width: auto; max-width: 430px; }
  .bill-donut svg { width: 100%; height: auto; max-height: 360px; }
  .bill-chart-title { font-size: 13px; color: #475569; }
  .bill-section { break-inside: avoid; }
  .bill-section { margin-bottom: 20px; }
  .bill-detail-table-wrap { max-height: none; overflow: visible; border: 0; }
  .bill-detail-table-wrap .bill-table { min-width: 0; table-layout: fixed; }
  .bill-detail-table-wrap th, .bill-detail-table-wrap td { padding: 5px 6px; font-size: 10.5px; overflow-wrap: anywhere; }
  .bill-detail-table-wrap thead th, .bill-detail-table-wrap tfoot td { position: static; }
  .bill-detail-table-wrap thead { position: static; }
  .bill-detail-table-wrap thead tr.bill-head-en th { padding-top: 0; font-size: 9px; }
  .bill-detail-table-wrap tbody tr:nth-child(n+25) { display: none; }
  /* M365 对账单：两个页签都打印（免费与试用另起一页），许可明细全部输出不截断 */
  .m365-tab-panel.is-hidden { display: block; }
  .m365-tab-free { break-before: page; }
  .bill-detail-table-wrap .m365-table tbody tr:nth-child(n+25) { display: table-row; }
  .m365-grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .m365-grid3 > .m365-insights { grid-column: 1 / -1; }
  .m365-ov-kpis { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .m365-ov-kpi > .m365-icon { width: 28px; height: 28px; padding: 6px; }
  .m365-ov-kpi-text b { font-size: 17px; }
  .m365-channel-block { break-inside: auto; }
  .m365-channel-head { break-after: avoid; }
  .bill-detail-table-wrap .m365-table td.m365-account, .bill-detail-table-wrap .m365-table td.m365-name { min-width: 0; }
  .bill-detail-table-wrap .m365-table td.m365-account { font-size: 9.5px; }
  .bill-detail-table-wrap .m365-table td.m365-billing { min-width: 0; font-size: 9.5px; }
  .bill-detail-table-wrap .m365-table td.m365-billing .m365-billing-account { font-size: 8.5px; }
  .m365-expiry-chart { min-height: 200px; }
  .m365-insights li { font-size: 12px; padding: 5px 8px; }
  .m365-insight-tag { font-size: 11px; line-height: 17px; }
  .m365-table tr { break-inside: avoid; }
  .m365-left { font-size: 9.5px; }
  .m365-dot { font-size: 10.5px; }
}


/* ===== 自定义报表工作台 ===== */
.report-cards { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.report-card { border: 1px solid var(--border, #e2e8f0); border-radius: 10px; padding: 10px 14px; background: #fff; min-width: 180px; max-width: 260px; cursor: pointer; transition: box-shadow .15s; }
.report-card:hover { box-shadow: 0 2px 8px rgba(15, 23, 42, .08); }
.report-card.dragging { opacity: .4; }
.rb-zone { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border: 1px dashed var(--border, #cbd5e1); border-radius: 8px; min-height: 44px; align-items: center; background: #f8fafc; }
.rb-chip { padding: 4px 12px; border-radius: 16px; background: #eef2ff; color: #3730a3; font-size: 12.5px; cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #e0e7ff; }
.rb-chip:hover { background: #e0e7ff; }
.rb-chip.sel { background: var(--primary, #2563eb); border-color: var(--primary, #2563eb); color: #fff; cursor: grab; }
.rb-chip.sel:active { cursor: grabbing; }
.rb-field { cursor: grab; } /* 报表画布：字段面板可拖字段 */
.rb-metric { background: #ecfdf5; border-color: #a7f3d0; color: #047857; } /* 度量字段绿色区分维度 */
.rb-zone.rb-over { border-color: #2563eb; background: #eff6ff; } /* 投放区拖入高亮 */
/* Power BI 式右侧面板：筛选器 | 可视化 | 数据，均可折叠成竖条 */
.pbi-panel { width: 232px; flex-shrink: 0; padding: 10px 12px; align-self: stretch; }
.pbi-panel.collapsed { width: 38px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; }
.pbi-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pbi-panel-head h2 { font-size: 13.5px; margin: 0; }
.pbi-toggle { padding: 1px 7px; font-size: 13px; line-height: 1.4; border-radius: 6px; }
.pbi-vtitle { writing-mode: vertical-rl; font-size: 12.5px; font-weight: 600; color: #475569; letter-spacing: 2px; }
.viz-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.viz-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px 6px; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; cursor: pointer; text-align: center; }
.viz-btn .viz-ico { display: flex; align-items: center; justify-content: center; height: 22px; }
.viz-btn .viz-txt { font-size: 11px; line-height: 1.2; color: #475569; }
.viz-btn:hover { border-color: #93c5fd; background: #f0f7ff; }
.viz-btn.active { border-color: #2563eb; background: #eff6ff; box-shadow: inset 0 0 0 1px #2563eb; }
.viz-btn.active .viz-txt { color: #1d4ed8; font-weight: 700; }
/* 下拉复选多选（关注/排除客户等）：收起只占一行，展开可搜可勾 */
.msel { position: relative; }
.msel-toggle { width: 100%; text-align: left; display: flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--border, #cbd5e1); border-radius: 8px; background: #fff; cursor: pointer; font-size: 13px; color: inherit; }
.msel-toggle:hover { border-color: var(--primary, #2563eb); }
.msel-toggle .msel-summary { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msel-toggle .msel-count { background: var(--primary, #2563eb); color: #fff; border-radius: 10px; font-size: 11.5px; padding: 1px 8px; flex-shrink: 0; }
.msel-panel { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60; background: #fff; border: 1px solid var(--border, #cbd5e1); border-radius: 10px; box-shadow: 0 8px 24px rgba(15, 23, 42, .14); padding: 8px; }
.msel-panel input[type="search"] { width: 100%; margin-bottom: 6px; }
.msel-tools { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 4px; color: #64748b; }
.msel-tools button { padding: 2px 8px; font-size: 12px; }
.msel-list { max-height: min(65vh, 560px); overflow: auto; scrollbar-gutter: stable; }
.msel-item { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.msel-item:hover { background: #f1f5f9; }
.field .msel-item input, .msel-item input { width: auto; margin: 0; flex-shrink: 0; }
.msel-item span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 日志中心告警筛选：独立全宽一行（不与页头标题挤列）；客户/订阅下拉加宽，展开面板放宽到能看全公司名与订阅 ID（msel 面板默认跟随窄按钮同宽） */
.alert-filter-toolbar { margin: 0 0 12px; }
.alert-filter-toolbar > input[type="search"] { flex: 0 1 200px; min-width: 160px; }
.alert-filter-toolbar .customer-picker { flex: 0 1 210px; min-width: 170px; }
.alert-filter-toolbar .customer-picker-panel { width: max(100%, 500px); }
.alert-filter-toolbar .customer-picker-option span { white-space: normal; overflow-wrap: anywhere; }
.alert-filter-toolbar .msel { flex: 0 1 210px; min-width: 170px; }
.alert-filter-toolbar .msel-panel { right: auto; width: max(100%, 520px); max-width: min(680px, 90vw); }
.alert-filter-toolbar .msel-item span { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .alert-filter-toolbar .customer-picker-panel, .alert-filter-toolbar .msel-panel { width: 100%; max-width: 90vw; }
}
.channel-navigation.card { padding:10px 14px; }
.channel-navigation-row { display:flex; align-items:center; gap:14px; min-width:0; }
.channel-active-region { flex:1; min-width:0; display:flex; align-items:center; gap:8px; }
.channel-unseen-regions { margin-left:auto; display:flex; align-items:center; gap:14px; min-width:0; }
.channel-unseen-region { display:flex; align-items:center; gap:8px; min-width:0; padding-left:14px; border-left:1px solid var(--border); }
.channel-region-title { font-size:12px; font-weight:600; white-space:nowrap; }
.channel-navigation .seg-tabs { min-width:0; }
.channel-navigation button { overflow-wrap:anywhere; }
.channel-maintenance { flex:none; }
.channel-activity-badge { margin-left:6px; font-size:11px; opacity:.75; }
@media screen and (max-width:900px) {
  .channel-navigation-row { flex-wrap:wrap; gap:10px; }
  .channel-active-region { flex-basis:100%; }
  .channel-unseen-regions { margin-left:0; flex:1; flex-wrap:wrap; gap:10px; }
  .channel-unseen-region { padding-left:10px; }
}
@media screen and (max-width:600px) {
  .watchboard-search-controls.unified-date-search-toolbar > .time-filter { flex-wrap:wrap; }
  .watchboard-search-controls.unified-date-search-toolbar .reconcile-range-controls { flex-wrap:wrap; }
  .channel-active-region, .channel-unseen-region { flex-wrap:wrap; }
  .channel-unseen-regions { flex-basis:calc(100% - 30px); }
  .channel-unseen-region { max-width:100%; box-sizing:border-box; }
}

.customer-provenance { padding: 10px 12px; margin: 8px 0 14px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 12px; line-height: 1.7; }
.customer-provenance.compact { border: 0; padding: 0; margin: 4px 0; color: #64748b; font-size: 11.5px; }

/* 分析中心「明细查询」：类 Excel 自动筛选表格 */
.grid-toolbar-card .grid-source { display: inline-flex; align-items: center; gap: 6px; }
.grid-conditions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12.5px; }
.grid-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.grid-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 999px; background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }
.grid-chip button { border: 0; background: transparent; color: inherit; padding: 0 6px; cursor: pointer; font-size: 14px; line-height: 1; }
.grid-summary { display: flex; flex-wrap: wrap; gap: 16px; align-items: baseline; margin: 10px 2px; font-size: 13px; }
.grid-table-wrap { max-height: 70vh; overflow: auto; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; background: #fff; }
.grid-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.grid-table thead th { position: sticky; top: 0; z-index: 2; background: #f8fafc; border-bottom: 1px solid var(--border, #e5e7eb); padding: 0; vertical-align: top; }
.grid-table td { white-space: nowrap; max-width: 360px; overflow: hidden; text-overflow: ellipsis; padding: 6px 10px; border-bottom: 1px solid #f1f5f9; }
.grid-table tbody tr { cursor: pointer; }
.grid-table tbody tr:hover td, .grid-table tbody tr:focus td { background: #f0f9ff; }
.grid-th { display: flex; align-items: stretch; }
.grid-th-label { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; border: 0; background: transparent; padding: 6px 4px 6px 10px; font: inherit; font-weight: 600; color: inherit; text-align: left; cursor: pointer; white-space: nowrap; }
th.num .grid-th-label { align-items: flex-end; text-align: right; }
.grid-th-label small { font-weight: 400; color: var(--muted, #64748b); font-size: 11px; }
.grid-filter-btn { border: 0; border-left: 1px solid transparent; background: transparent; padding: 0 8px; color: #94a3b8; cursor: pointer; font-size: 12px; }
.grid-filter-btn:hover { color: #1d4ed8; background: #eff6ff; }
.grid-filter-btn.active { color: #fff; background: #2563eb; }
.grid-popover { position: absolute; z-index: 1000; width: 360px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; box-shadow: 0 12px 32px rgba(15, 23, 42, .18); padding: 12px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.grid-popover-title { font-weight: 600; display: flex; gap: 8px; align-items: baseline; }
.grid-popover-title small { color: var(--muted, #64748b); font-weight: 400; }
.grid-popover-row { display: flex; gap: 6px; flex-wrap: wrap; }
.grid-popover-row select, .grid-popover-row input { flex: 1; min-width: 90px; }
.grid-popover-section { display: flex; justify-content: space-between; align-items: center; color: var(--muted, #64748b); font-size: 12px; border-top: 1px solid #f1f5f9; padding-top: 6px; }
.grid-popover-links { display: inline-flex; gap: 8px; }
.grid-values { max-height: 240px; overflow: auto; border: 1px solid #e2e8f0; border-radius: 6px; padding: 4px; }
.grid-value-row { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 4px; cursor: pointer; }
.grid-value-row:hover { background: #f8fafc; }
.grid-value-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-value-row small { color: var(--muted, #64748b); }
.grid-popover-actions { display: flex; gap: 6px; align-items: center; }
.grid-pager { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; margin: 10px 0; font-size: 13px; }
.grid-column-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; max-height: 60vh; overflow: auto; margin-top: 10px; }
.grid-column-group { border: 1px solid #e2e8f0; border-radius: 8px; padding: 6px 10px; margin: 0; }
.grid-column-group legend { font-weight: 600; font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; padding: 0 4px; }
.grid-column-group legend .link-btn { white-space: nowrap; font-weight: 400; }
.grid-column-option { display: flex; align-items: baseline; gap: 6px; padding: 2px 0; font-size: 12.5px; cursor: pointer; }
.grid-column-option small { color: var(--muted, #64748b); font-size: 11px; }
.grid-detail { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.grid-detail th { text-align: left; width: 38%; vertical-align: top; padding: 4px 8px; background: #f8fafc; border-bottom: 1px solid #eef2f7; font-weight: 500; }
.grid-detail th small { display: block; color: var(--muted, #64748b); font-weight: 400; font-size: 11px; }
.grid-detail td { padding: 4px 8px; border-bottom: 1px solid #eef2f7; }
.grid-detail-value { word-break: break-all; }
/* 明细查询：冻结列（sticky left）与列顺序面板 */
.grid-table .grid-frozen { position: sticky; z-index: 1; background: #fff; }
.grid-table thead th.grid-frozen { z-index: 3; background: #f1f5f9; }
.grid-table .grid-frozen-last { box-shadow: 4px 0 6px -4px rgba(15, 23, 42, .28); border-right: 1px solid #cbd5e1; }
.grid-popover-columns button { flex: 1; }
.grid-column-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; margin-top: 4px; }
.grid-column-layout .grid-column-groups { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid-order-panel { border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px; background: #f8fafc; }
.grid-order-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.grid-order-list { list-style: none; margin: 0; padding: 0; max-height: 56vh; overflow: auto; display: flex; flex-direction: column; gap: 3px; }
.grid-order-item { display: flex; align-items: center; gap: 6px; padding: 4px 6px; background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 12.5px; cursor: grab; }
.grid-order-item.frozen { background: #eff6ff; border-color: #bfdbfe; }
.grid-order-item.frozen-last { margin-bottom: 6px; box-shadow: 0 3px 0 -1px #93c5fd; }
.grid-order-item.dragging { opacity: .45; }
.grid-order-item.drop-target { border-top: 2px solid #2563eb; }
.grid-order-handle { color: #94a3b8; letter-spacing: -2px; }
.grid-order-index { color: #94a3b8; min-width: 18px; text-align: right; }
.grid-order-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-order-label small { color: var(--muted, #64748b); margin-left: 4px; font-size: 11px; }
.grid-order-btn { border: 1px solid #e2e8f0; background: #fff; border-radius: 4px; padding: 0 6px; line-height: 20px; cursor: pointer; }
.grid-order-btn:disabled { opacity: .35; cursor: default; }
@media (max-width: 900px) { .grid-column-layout { grid-template-columns: 1fr; } }

.channel-statement-entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.channel-statement-entry h2 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.channel-statement-dialog { min-width: 0; max-width: 100%; }
.channel-statement-dialog > h2 { font-size: 18px; margin: 0 28px 16px 0; overflow-wrap: anywhere; }
.channel-statement-dialog .toolbar { box-shadow: none; border: 0; padding: 8px 0; }
.channel-statement-dialog .toolbar > strong { overflow-wrap: anywhere; min-width: 0; }
.channel-statement-dialog [hidden] { display: none !important; }
.channel-statement-comparison { padding: 12px 0 18px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.channel-statement-comparison-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.channel-statement-comparison-head h3 { font-size: 15px; margin: 0 0 10px; }
.channel-statement-match { color: #15803d; font-weight: 600; }
.channel-statement-difference { color: #b45309; font-weight: 600; }
.channel-statement-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.channel-statement-metric { display: grid; align-content: start; gap: 4px; min-width: 0; font-size: 12px; }
.channel-statement-metric strong { font-size: 20px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.channel-statement-scope { font-size: 12px; line-height: 1.6; margin: 12px 0; overflow-wrap: anywhere; }
.channel-statement-comparison details > summary { cursor: pointer; font-size: 13px; padding: 6px 0; }
.channel-statement-table-scroll { overflow: auto; max-height: 300px; }
.channel-statement-table-scroll table { min-width: 700px; }
.channel-statement-table-scroll th { position: sticky; top: 0; background: var(--bg, #f8fafc); z-index: 1; }
.channel-statement-table-scroll td:first-child { overflow-wrap: anywhere; }
@media screen and (max-width: 680px) {
  .channel-statement-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .channel-statement-dialog .cs-doc { max-width: 100%; }
}
/* M365 续费跟进弹窗：按状态切换的行用 hidden 属性，label.field 的 display:block 与行内 display:flex 会覆盖其默认样式 */
.m365-renewal-dialog [hidden] { display: none !important; }

/* 神码对账单总账：客户横条（蓝色实段 = 折后应付，绿色虚框 = 折扣；段内放不下的金额溢出到条尾并带同色标记）、联动选中与筛选栏 */
.dc-bars { display: grid; gap: 6px; }
.dc-bar-row { display: grid; grid-template-columns: minmax(160px, 300px) minmax(0, 1fr) 190px; gap: 12px; align-items: center; font-size: 13px; border-radius: 4px; padding: 2px 4px; }
.dc-bar-row.is-selectable { cursor: pointer; }
.dc-bar-row.is-selectable:hover, .dc-bar-row.is-selectable:focus-visible { background: #f8fafc; outline: none; }
.dc-bars.has-selection .dc-bar-row:not(.is-selected) { opacity: .4; }
.dc-bar-row.is-selected { background: #eff6ff; }
.dc-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-bar-track { position: relative; display: flex; height: 20px; }
.dc-seg { position: relative; display: flex; align-items: center; justify-content: center; height: 100%; overflow: hidden; box-sizing: border-box; }
.dc-seg-net { background: #2563eb; border-radius: 3px 0 0 3px; }
.dc-seg-discount { background: rgba(22, 163, 74, .10); border: 1.5px dashed #16a34a; border-left: none; border-radius: 0 3px 3px 0; }
.dc-seg-label { font-size: 11px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; padding: 0 3px; }
.dc-seg-net .dc-seg-label { color: #fff; }
.dc-seg-discount .dc-seg-label { color: #15803d; }
.dc-bar-overflow { position: absolute; top: 0; height: 100%; display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; pointer-events: none; }
.dc-overflow-item { display: inline-flex; align-items: center; gap: 3px; }
.dc-overflow-item i { display: inline-block; width: 7px; height: 7px; border-radius: 1px; }
.dc-overflow-item.net { color: #2563eb; } .dc-overflow-item.net i { background: #2563eb; }
.dc-overflow-item.discount { color: #15803d; } .dc-overflow-item.discount i { background: #16a34a; }
.dc-bar-val { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dc-std-mark { color: #b45309; margin-left: 1px; }
tr.dc-clickable, td.dc-clickable { cursor: pointer; }
tr.dc-clickable:hover td, td.dc-clickable:hover { background: #f8fafc; }
tr.dc-selected td { background: #eff6ff; }
.dc-selected-cell { background: #dbeafe !important; font-weight: 600; }
.dc-focus { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.dc-focus-chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.dc-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.dc-card-head h2 { margin: 0; }
.dc-rows-search { max-width: 280px; }
.dc-batch-bar { display: flex; gap: 10px; flex-wrap: wrap; }
.dc-batch-bar select { flex: 1 1 280px; min-width: 0; }
.list-net-col:focus-within rect { outline: none; }
@media (max-width: 900px) { .dc-bar-row { grid-template-columns: 1fr; gap: 3px; } .dc-bar-val { text-align: left; } }
/* 神码对账单概要环图：按客户 / 按服务切换 */
.dc-donut { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dc-donut-toggle button { padding: 3px 12px; font-size: 12px; }
/* 总代账单「与 Cost API 对比」：深色表头上的排序样式，以及「只看需核对」开关 */
.partner-compare th.tk-sortable:hover { background: #1e3a5f; }
.partner-compare th.tk-sorted { color: #fff; }
.partner-compare th .tk-arrow { color: #93c5fd; }
.partner-compare-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.partner-compare-bar .partner-guide { flex: 1 1 auto; margin: 0; }
.partner-compare-filter { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; white-space: nowrap; cursor: pointer; }
