/* ============================================================
 * TCP 运营台样式 — 浅色控制室（ink 顶栏 + teal 强调）
 * 桌面为主，移动端不做适配。
 * ============================================================ */

:root {
  --ink: #0B1220;
  --accent: #0F766E;
  --accent-dark: #0D5F59;
  --accent-soft: #CCFBF1;
  --topbar-bg: var(--ink);
  --topbar-fg: #E8EEF5;
  --bg: #EEF1F4;
  --panel: #ffffff;
  --line: #D8DEE6;
  --text: #0B1220;
  --muted: #5B6572;
  --primary: var(--accent);
  --primary-dark: var(--accent-dark);
  --ok: #15803D;
  --danger: #DC2626;
  --warn: #C2410C;
  /* 状态色 */
  --st-active: #15803D;
  --st-active-bg: #DCFCE7;
  --st-suspended: #DC2626;
  --st-suspended-bg: #FEE2E2;
  --st-pending: #C2410C;
  --st-pending-bg: #FFEDD5;
  --st-inactive: #5B6572;
  --st-inactive-bg: #E8EDF2;
  --st-archived: #8B95A3;
  --st-archived-bg: #EEF1F4;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(11, 18, 32, 0.06);
  --font-num: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

code { font-family: var(--font-num); font-size: 12px; background: var(--st-inactive-bg); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); }

/* ═══════════════ 顶栏 ═══════════════ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--topbar-bg);
  color: var(--topbar-fg);
  padding: 10px 20px;
  flex-wrap: wrap;
}
.topbar__brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar__logo {
  font-weight: 800; letter-spacing: 1.5px;
  background: var(--accent); color: #fff;
  padding: 4px 9px; border-radius: 6px; font-size: 12px;
}
.topbar__title { font-weight: 600; font-size: 14px; color: #CBD5E1; }
.topbar__auth { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }
.topbar__auth-group { display: flex; align-items: center; gap: 8px; }
.break-glass { color: #64748B; font-size: 12px; opacity: 0.85; }
.break-glass summary { cursor: pointer; user-select: none; }
.break-glass__body { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; padding: 8px 0; }
.mock-auth { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.topbar__sep { color: #64748B; font-size: 12px; padding: 0 2px; }

.field--inline { display: flex; align-items: center; gap: 6px; }
.field--inline .field__label { color: #94A3B8; font-size: 12px; white-space: nowrap; }
.input--role { min-width: 190px; }
.input--sub { width: 150px; }

.chip {
  padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.chip--muted { background: #1E293B; color: #94A3B8; }
.chip--active { background: var(--ok); color: #fff; }
.chip--approval { background: #1E293B; color: #94A3B8; font-family: var(--font-num); }
.chip--approval-armed {
  background: var(--accent); color: #fff;
  box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.55);
  animation: approvalPulse 1.8s ease-out infinite;
}
@keyframes approvalPulse {
  0% { box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(15, 118, 110, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 118, 110, 0); }
}

.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.cal { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 5px; font-size: 10px; font-weight: 700; background: var(--st-active-bg); color: var(--st-active); vertical-align: middle; }
.cal--beta { background: var(--accent-soft); color: var(--accent-dark); }
.audit-detail { max-width: 420px; white-space: normal; }
.audit-detail code { font-size: 11px; color: var(--muted); }
.table--audit td { vertical-align: top; }
.audit-target { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.audit-recap { font-size: 13px; line-height: 1.45; }
.audit-raw { margin-top: 4px; }
.audit-raw summary {
  cursor: pointer; font-size: 11px; color: var(--muted); user-select: none;
}
.audit-raw__body { margin-top: 6px; }
.audit-raw pre {
  margin: 0 0 6px; padding: 8px; background: var(--st-inactive-bg);
  border-radius: 6px; font-size: 11px; color: var(--muted);
  white-space: pre-wrap; word-break: break-all;
  max-height: 180px; overflow: auto;
}

.sentinel-report { margin-top: 16px; }
.sentinel-report .audit-recap { font-size: 14px; line-height: 1.55; }
.sentinel-recap__verdict { font-weight: 700; }
.sentinel-recap__verdict--ok { color: var(--ok); }
.sentinel-recap__verdict--drift { color: var(--warn); }
.sentinel-recap__verdict--fail { color: var(--danger); }
.badge--staging { background: var(--warn); color: #fff; letter-spacing: 0.5px; }
.badge--prod { background: var(--danger); color: #fff; letter-spacing: 0.5px; box-shadow: 0 0 0 1px rgba(255,255,255,0.12); }
.badge--neutral { background: #1E293B; color: #CBD5E1; letter-spacing: 0.5px; }

/* ═══════════════ Tabs（主路径 + 更多） ═══════════════ */
.tabs {
  display: flex; align-items: stretch; gap: 0;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  position: relative;
}
.tabs__primary { display: flex; gap: 2px; flex: 1; min-width: 0; }
.tab {
  border: none; background: transparent; cursor: pointer;
  padding: 12px 16px; font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent; font-weight: 500;
}
.tab:hover { color: var(--text); }
.tab--active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tabs-more { position: relative; margin-left: auto; align-self: stretch; }
.tabs-more__summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 6px;
  padding: 12px 14px; font-size: 14px; font-weight: 500; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tabs-more__summary::-webkit-details-marker { display: none; }
.tabs-more__summary:hover { color: var(--text); }
.tabs-more--active > .tabs-more__summary {
  color: var(--accent); border-bottom-color: var(--accent); font-weight: 600;
}
.tabs-more__menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30;
  min-width: 180px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(11, 18, 32, 0.12);
  display: flex; flex-direction: column; gap: 2px;
}
.tabs-more__menu .tab {
  border-bottom: none; border-radius: 8px; padding: 9px 12px; text-align: left;
}
.tabs-more__menu .tab--active { background: var(--accent-soft); color: var(--accent-dark); }
.tabs-more[open] > .tabs-more__summary { color: var(--text); }

/* ═══════════════ 内容区 ═══════════════ */
.content { padding: 20px; max-width: 1400px; margin: 0 auto; }
.view { display: none; }
.view--active { display: block; }

.toolbar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.caliber { color: var(--muted); font-size: 12px; margin-left: auto; }

/* ═══════════════ 表单元素 ═══════════════ */
.input {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 7px 10px; font-size: 14px; background: #fff; color: var(--text);
  outline: none; min-width: 0;
}
.topbar .input { background: #0f172a; color: var(--topbar-fg); border-color: #334155; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); }
#orgKeyword { flex: 1; min-width: 220px; max-width: 380px; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field__label { font-size: 12px; color: var(--muted); font-weight: 500; }
.field__hint { font-size: 12px; color: var(--muted); line-height: 1.45; }

/* ═══════════════ 按钮 ═══════════════ */
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 7px 14px; border-radius: var(--radius); cursor: pointer;
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.btn:hover { background: #f8fafc; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); }
.btn--ghost { background: transparent; }
.btn--xs { padding: 4px 9px; font-size: 12px; }
.btn--ok { color: var(--ok); border-color: var(--ok); }
.btn--ok:hover { background: var(--st-active-bg); }
.btn--danger { color: var(--danger); border-color: var(--danger); }
.btn--danger:hover { background: var(--st-suspended-bg); }

/* ═══════════════ 表格 ═══════════════ */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: #f8fafc; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.table tbody tr:hover { background: #fafbfc; }
.table tbody tr:last-child td { border-bottom: none; }
.table__empty { text-align: center; color: var(--muted); padding: 40px 14px; }
.table__empty--error { color: var(--danger); }
.table__actions-col { width: 1%; white-space: nowrap; }
.table__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.cell--name { font-weight: 600; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell--sub { display: block; font-size: 12px; color: var(--muted); }

/* 状态 badge */
.badge--status { font-size: 11px; }
.badge--ACTIVE { background: var(--st-active-bg); color: var(--st-active); }
.badge--SUSPENDED { background: var(--st-suspended-bg); color: var(--st-suspended); }
.badge--PENDING_REVIEW { background: var(--st-pending-bg); color: var(--st-pending); }
.badge--INACTIVE { background: var(--st-inactive-bg); color: var(--st-inactive); }
.badge--ARCHIVED { background: var(--st-archived-bg); color: var(--st-archived); }
.badge--UNKNOWN { background: var(--st-inactive-bg); color: var(--st-inactive); }

/* ═══════════════ 分页 ═══════════════ */
.pager { display: flex; align-items: center; gap: 12px; margin-top: 16px; justify-content: center; }
.pager__info { color: var(--muted); font-size: 13px; }

/* ═══════════════ 卡片（总览） ═══════════════ */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px; box-shadow: var(--shadow);
}
.card--big { grid-column: span 2; background: linear-gradient(135deg, #0F766E, #134E4A); color: #fff; border: none; }
.card--big .card__label, .card--big .card__value { color: #fff; }
.card__label { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.card__value { font-size: 32px; font-weight: 800; line-height: 1; }
.card--placeholder, .card--error { grid-column: 1 / -1; color: var(--muted); text-align: center; padding: 40px; }
.card--error { color: var(--danger); }

/* ═══════════════ 入驻表单 ═══════════════ */
.onboarding { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); max-width: 720px; }
.onboarding__title { margin: 0 0 6px; font-size: 18px; }
.onboarding__hint { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.form { display: grid; gap: 14px; }
.form--grid { grid-template-columns: 1fr 1fr; }
.field--full { grid-column: 1 / -1; }
.form__actions { margin-top: 8px; }
.result-box {
  margin-top: 16px; background: #0f172a; color: #a7f3d0; padding: 14px; border-radius: var(--radius);
  font-family: 'SF Mono', Menlo, monospace; font-size: 12px; white-space: pre-wrap; word-break: break-all;
  min-height: 24px; max-height: 300px; overflow: auto;
}
.result-box:empty { display: none; }
.ops-result { margin-top: 16px; }
.ops-result:empty { display: none; }
.ops-result .audit-recap { font-size: 14px; line-height: 1.55; }

/* 开通向导：次要自助入驻入口（折叠） */
.onboarding__secondary { margin-top: 24px; border-top: 1px dashed var(--line); padding-top: 16px; }
.onboarding__secondary > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); user-select: none; }
.onboarding__secondary > summary:hover { color: var(--text); }
.onboarding__secondary[open] > summary { margin-bottom: 12px; }

/* 开通成功凭证卡（醒目 + 可复制） */
.provision-result {
  margin-top: 18px; border: 1px solid var(--st-active); border-radius: var(--radius);
  background: var(--st-active-bg); padding: 16px;
}
.provision-result__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.provision-result__badge { background: var(--st-active); color: #fff; font-weight: 700; font-size: 12px; padding: 3px 10px; border-radius: 6px; }
.provision-result__hint { color: #b45309; font-size: 12px; font-weight: 600; }
.cred-grid { display: grid; gap: 10px; }
.cred-item { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.cred-item__label { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 6px; }
.cred-item__row { display: flex; align-items: center; gap: 10px; }
.cred-item__value { flex: 1; min-width: 0; font-family: 'SF Mono', Menlo, monospace; font-size: 13px; word-break: break-all; overflow-wrap: anywhere; }
.cred-item--pw { border-color: var(--st-active); }
.cred-item__value--pw { font-size: 16px; font-weight: 700; letter-spacing: 0.5px; color: var(--danger); }
.provision-result__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }

.input--month { max-width: 160px; }

/* ═══════════════ 详情抽屉 ═══════════════ */
.drawer { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.drawer[aria-hidden="false"] { pointer-events: auto; }
.drawer__mask { position: absolute; inset: 0; background: rgba(11, 18, 32, 0.42); opacity: 0; transition: opacity 0.2s; }
.drawer[aria-hidden="false"] .drawer__mask { opacity: 1; }
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: 640px; max-width: 94vw;
  background: var(--panel); box-shadow: -8px 0 32px rgba(11, 18, 32, 0.16);
  transform: translateX(100%); transition: transform 0.25s ease; display: flex; flex-direction: column;
}
.drawer[aria-hidden="false"] .drawer__panel { transform: translateX(0); }
.drawer__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--panel);
  position: sticky; top: 0; z-index: 2; flex-shrink: 0;
}
.drawer__head-main { flex: 1; min-width: 0; }
.drawer__head h3 {
  margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.drawer__head-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.drawer__head-health {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--st-inactive-bg); color: var(--muted); font-variant-numeric: tabular-nums;
}
.drawer__head-health.health--healthy { background: var(--st-active-bg); color: var(--st-active); }
.drawer__head-health.health--atrisk { background: var(--st-pending-bg); color: var(--st-pending); }
.drawer__head-health.health--critical { background: var(--st-suspended-bg); color: var(--st-suspended); }
.drawer__close {
  border: none; background: var(--st-inactive-bg); width: 32px; height: 32px; border-radius: 8px;
  font-size: 20px; cursor: pointer; color: var(--muted); line-height: 1; flex-shrink: 0;
}
.drawer__close:hover { background: var(--line); color: var(--text); }
.drawer__ops {
  flex-shrink: 0; padding: 10px 18px; border-bottom: 1px solid var(--line);
  background: #F7F9FB; position: sticky; top: 0; z-index: 1;
}
.drawer__ops:empty { display: none; }
.drawer__body { padding: 16px 18px 28px; overflow: auto; flex: 1; }
.loading { color: var(--muted); text-align: center; padding: 40px; }

.detail-section { margin-bottom: 24px; }
.detail-section h4 { margin: 0 0 10px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.kv { display: flex; padding: 5px 0; gap: 12px; font-size: 13px; }
.kv__k { width: 110px; flex-shrink: 0; color: var(--muted); }
.kv__v { flex: 1; word-break: break-all; }
.kv__v--copy { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kv__v--copy code { min-width: 0; }
.drawer__copy-id { flex-shrink: 0; }

/* ═══════════════ 弹窗 ═══════════════ */
.modal { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; }
.modal[aria-hidden="false"] { display: flex; }
.modal__mask { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); }
.modal__panel { position: relative; background: var(--panel); border-radius: 12px; padding: 24px; width: 440px; max-width: 92vw; box-shadow: 0 20px 50px rgba(15, 23, 42, 0.3); }
.modal__panel--wide { width: 560px; }
.modal__title { margin: 0 0 8px; font-size: 17px; }
.modal__msg { color: var(--text); margin: 0 0 16px; }
.modal__msg--sub { color: var(--muted); font-size: 13px; }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ═══════════════ 租户健康分 ═══════════════ */
/* 三档色：复用状态色变量（绿=健康 / 琥珀=关注 / 红=高危），不新造色。 */
.health-badge { font-size: 11px; }
.health--healthy  { background: var(--st-active-bg);    color: var(--st-active); }
.health--atrisk   { background: var(--st-pending-bg);   color: var(--st-pending); }
.health--critical { background: var(--st-suspended-bg); color: var(--st-suspended); }

/* 详情抽屉：健康区块 */
.detail-section--health .health-hero {
  display: flex; align-items: center; gap: 16px; margin-bottom: 14px;
}
.health-score {
  display: flex; align-items: baseline; gap: 2px;
  padding: 10px 16px; border-radius: 12px; line-height: 1;
  background: var(--st-inactive-bg); color: var(--st-inactive);
  flex-shrink: 0;
}
.health-score.health--healthy  { background: var(--st-active-bg);    color: var(--st-active); }
.health-score.health--atrisk   { background: var(--st-pending-bg);   color: var(--st-pending); }
.health-score.health--critical { background: var(--st-suspended-bg); color: var(--st-suspended); }
.health-score__num { font-size: 40px; font-weight: 800; letter-spacing: -1px; }
.health-score__unit { font-size: 14px; font-weight: 600; opacity: 0.8; }
.health-hero__meta { flex: 1; min-width: 0; }
.health-hero__band { margin-bottom: 6px; }
.health-hero__verdict { font-size: 13px; color: var(--text); line-height: 1.45; }

.health-trend {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 0; font-size: 13px; border-top: 1px solid var(--line);
}
.health-trend__label { color: var(--muted); }
.health-trend__cmp { color: var(--muted); font-size: 12px; }
.trend { font-weight: 700; font-size: 14px; }
.trend--up { color: var(--st-active); }
.trend--down { color: var(--st-suspended); }
.trend--none { color: var(--muted); font-weight: 500; }

.health-activity { font-size: 12px; color: var(--muted); margin-bottom: 12px; }

/* 信号明细条 */
.health-signals { display: flex; flex-direction: column; gap: 8px; }
.sig { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.sig__label { width: 56px; flex-shrink: 0; color: var(--muted); }
.sig__track { flex: 1; height: 8px; background: var(--st-inactive-bg); border-radius: 999px; overflow: hidden; }
.sig__fill { display: block; height: 100%; border-radius: 999px; background: var(--st-inactive); transition: width 0.3s ease; }
.sig__fill.sig--ok   { background: var(--st-active); }
.sig__fill.sig--warn { background: var(--st-pending); }
.sig__fill.sig--bad  { background: var(--st-suspended); }
.sig__val { width: 40px; flex-shrink: 0; text-align: right; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

/* 总览：健康分布卡片 */
.card--wide { grid-column: span 2; }
.health-dist .hd-bar {
  display: flex; height: 14px; border-radius: 999px; overflow: hidden;
  background: var(--st-inactive-bg); margin: 4px 0 12px;
}
.hd-bar__seg { display: block; height: 100%; }
.health-seg--healthy  { background: var(--st-active); }
.health-seg--atrisk   { background: var(--st-pending); }
.health-seg--critical { background: var(--st-suspended); }
.hd-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text); }
.hd-legend__item { display: flex; align-items: center; gap: 6px; }
.hd-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex-shrink: 0; }

/* ═══════════════ 面板（总览趋势 / 运维动作） ═══════════════ */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; box-shadow: var(--shadow); margin-top: 16px;
}
.panel__head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel__head h4 { margin: 0; font-size: 14px; }
.panel__hint { color: var(--muted); font-size: 12px; }

/* ═══════════════ 纯 SVG 趋势图 ═══════════════ */
.chart-box { min-height: 60px; }
.chart-box--drawer { min-height: 40px; }
.chart { display: block; width: 100%; height: 150px; }
.chart-box--drawer .chart { height: 120px; }
.chart .bar { fill: var(--primary); opacity: 0.85; }
.chart .bar:hover { opacity: 1; }
.chart .bar--neg { fill: var(--danger); }
.chart__base { stroke: var(--line); stroke-width: 1; }
.chart__tick { fill: var(--muted); font-size: 10px; }
.chart__tick--r { text-anchor: end; }
.chart-empty { padding: 16px 0; font-size: 13px; }
.chart-meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }

/* ═══════════════ 运维动作 ═══════════════ */
.ops-grid { display: flex; flex-direction: column; gap: 14px; }
.ops-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  flex-wrap: wrap;
}
.ops-item__desc { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 260px; }
.ops-item__desc strong { font-size: 13px; }
.ops-item__desc .muted { font-size: 12px; }
.ops-item__form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.input--date { width: 140px; }

/* ═══════════════ 抽屉操作条 / 时间线 ═══════════════ */
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.drawer-ops { margin: 0; padding: 0; border: none; background: transparent; }
.drawer-ops__title {
  font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 8px;
  letter-spacing: .04em; text-transform: uppercase;
}
.drawer-ops__hint { margin: 8px 0 0; font-size: 12px; line-height: 1.5; }
.drawer-ops .btn--danger { border-color: var(--danger); }
.drawer-ops .btn:not(.btn--danger):not(.btn--ok):not(.btn--ghost) { border-color: var(--accent); color: var(--accent-dark); }

.timeline {
  list-style: none; margin: 0; padding: 0 0 0 14px;
  display: flex; flex-direction: column; gap: 0;
  border-left: 2px solid var(--line);
}
.timeline__item {
  position: relative; display: grid; grid-template-columns: 118px 1fr; gap: 8px 12px;
  font-size: 12px; padding: 8px 0 8px 14px;
}
.timeline__item::before {
  content: ''; position: absolute; left: -19px; top: 14px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--st-inactive);
  box-shadow: 0 0 0 3px var(--panel);
}
.timeline__item--AUDIT::before { background: var(--warn); }
.timeline__item--ORDER::before { background: var(--accent); }
.timeline__item--CONSUMPTION::before { background: var(--ok); }
.timeline__time { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.timeline__main { min-width: 0; }
.timeline__title { font-weight: 600; color: var(--text); }
.timeline__summary {
  display: block; color: var(--muted); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.timeline__item.is-open .timeline__summary { white-space: normal; overflow: visible; }
.timeline__toggle {
  border: 0; background: none; padding: 0; margin-top: 2px; cursor: pointer;
  font-size: 11px; color: var(--accent); font-weight: 600;
}
.timeline__reason { color: var(--text); }

.drawer-seg {
  display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 12px;
  padding: 4px; background: var(--st-inactive-bg); border-radius: 10px;
}
.drawer-seg__btn {
  border: 0; background: transparent; cursor: pointer;
  padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--muted);
}
.drawer-seg__btn:hover { color: var(--text); }
.drawer-seg__btn--active { background: var(--panel); color: var(--accent-dark); font-weight: 600; box-shadow: var(--shadow); }
.drawer-seg-panel { display: none; }
.drawer-seg-panel--active { display: block; }
.detail-section--timeline {
  margin-bottom: 18px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: #FBFCFD;
}
.detail-section--timeline h4 { border-bottom: none; padding-bottom: 0; margin-bottom: 10px; color: var(--text); text-transform: none; letter-spacing: 0; font-size: 14px; }

/* ═══════════════ 套餐预设 / 配额 ═══════════════ */
.plan-presets { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.plan-advanced { margin: 8px 0 14px; padding: 10px 12px; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; background: rgba(0,0,0,.02); }
.plan-advanced summary { cursor: pointer; font-size: 13px; color: var(--muted); }
#planPresetBtns { display: contents; }
.quota-full { color: var(--danger); font-weight: 700; }

/* ═══════════════ 机构 360：支持数据 / 订单 / 备注 ═══════════════ */
/* 订单口径角标：橙色（订单口径），区别于绿色课消 .cal。 */
.cal--order { background: var(--st-pending-bg); color: var(--st-pending); }

.support-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.support-tabs .btn--active { background: var(--primary); border-color: var(--primary); color: #fff; }
.support-body { min-height: 20px; }

/* 抽屉内紧凑小表格（支持数据 / 订单流水共用） */
.mini-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mini-table th, .mini-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.mini-table th { color: var(--muted); font-weight: 600; background: #f8fafc; white-space: nowrap; }
.mini-table tbody tr:last-child td { border-bottom: none; }
.mini-table td { word-break: break-word; }

/* 备注 */
.note-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.note-item { padding: 8px 10px; background: #f8fafc; border: 1px solid var(--line); border-radius: var(--radius); }
.note-item__text { font-size: 13px; color: var(--text); word-break: break-word; white-space: pre-wrap; }
.note-item__meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: 11px; color: var(--muted); }
.note-compose { display: flex; gap: 8px; }
.note-compose .input { flex: 1; min-width: 0; }

/* 危险操作区 */
.detail-section--danger h4 { color: var(--danger); }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--st-suspended-bg); background: #fff5f5; border-radius: var(--radius); }
.danger-row__desc { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 180px; }
.danger-row__desc strong { font-size: 13px; color: var(--danger); }
.danger-row__desc .muted { font-size: 12px; }
.danger-note { font-size: 12px; color: var(--danger); background: #fff5f5; border: 1px solid var(--st-suspended-bg);
  border-radius: var(--radius); padding: 10px 12px; margin-bottom: 14px; line-height: 1.5; }

/* 顶栏令牌输入 */
.input--token { width: 260px; }

/* ═══════════════ Toast ═══════════════ */
.toast-stack { position: fixed; top: 20px; right: 20px; z-index: 60; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 12px 18px; border-radius: var(--radius); color: #fff; font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2); max-width: 380px;
  animation: toastIn 0.2s ease; opacity: 1; transition: opacity 0.35s;
}
.toast--out { opacity: 0; }
.toast--info { background: #334155; }
.toast--success { background: var(--ok); }
.toast--error { background: var(--danger); }
.toast--warning { background: var(--warn); }
@keyframes toastIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ═══════════════ 全局搜索 / 工作台 ═══════════════ */
.topbar__search { position: relative; flex: 1; min-width: 280px; max-width: 520px; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-kbd {
  position: absolute; left: 10px; z-index: 1; pointer-events: none;
  font-size: 11px; font-weight: 700; color: #94A3B8; font-family: var(--font-num);
  background: #1E293B; border: 1px solid #334155; border-radius: 5px; padding: 1px 6px;
}
.input--search { width: 100%; padding-left: 52px; }
.search-pop {
  position: absolute; top: 110%; left: 0; right: 0; z-index: 70;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(11,18,32,.18); max-height: 420px; overflow: auto; padding: 6px;
}
.search-pop__group { font-size: 11px; color: var(--muted); font-weight: 700; padding: 6px 8px 2px; text-transform: uppercase; }
.search-pop__item { display: flex; gap: 8px; align-items: baseline; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.search-pop__item:hover,
.search-pop__item--active { background: var(--accent-soft); }
.search-pop__name { font-weight: 600; }
.search-pop__meta { color: var(--muted); font-size: 12px; }
.search-pop__empty { padding: 14px 12px; font-size: 13px; color: var(--muted); }
.search-pop__hint { padding: 6px 8px 4px; font-size: 11px; }
.inbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.inbox-grid .panel { margin-top: 0; position: relative; overflow: hidden; padding-left: 18px; }
.inbox-panel::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--st-inactive);
}
.inbox-panel--pending::before { background: var(--warn); }
.inbox-panel--expiring::before { background: #64748B; }
.inbox-panel--critical::before { background: var(--danger); }
.inbox-meta { margin-left: auto; font-size: 12px; }
.inbox-cleared {
  margin: 0 0 12px; padding: 10px 14px; border-radius: 10px;
  background: #ECFDF5; color: #047857; font-weight: 600; font-size: 13px;
  border: 1px solid #A7F3D0;
}
.panel__count {
  display: inline-block; min-width: 1.6em; margin-left: 6px; padding: 2px 9px;
  border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--st-inactive-bg); color: var(--text); font-variant-numeric: tabular-nums;
}
.inbox-panel--critical .panel__count { background: var(--st-suspended-bg); color: var(--danger); }
.inbox-panel--pending .panel__count { background: var(--st-pending-bg); color: var(--warn); }
.inbox-item { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; flex-wrap: wrap; }
.inbox-item:last-child { border-bottom: none; }
.inbox-item__name { font-weight: 600; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-item__name:hover { color: var(--accent); }
.inbox-item__meta { color: var(--muted); font-size: 12px; flex: 1; min-width: 100px; }
.inbox-item__cta { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.inbox-item__cta .btn { padding: 3px 8px; font-size: 12px; }
.inbox-empty { color: var(--muted); padding: 12px 0; font-size: 13px; }
.inbox-empty--hint {
  padding: 10px 14px; background: var(--accent-soft); color: var(--accent-dark);
  border-radius: 10px; border: 1px solid #99F6E4; margin-bottom: 12px; font-size: 13px;
}
.linkish {
  border: 0; background: none; padding: 0; font: inherit; font-weight: 600;
  color: inherit; cursor: pointer; text-align: left;
}
.linkish:hover { color: var(--accent); }
.table .linkish { font-weight:600; background:none; border:none; padding:0; cursor:pointer; color:inherit; }
.info-banner {
  margin: 0 0 12px; padding: 10px 14px; border-radius: 10px;
  background: #eff6ff; color: #1e3a8a; font-size: 13px; line-height: 1.55;
  border: 1px solid #bfdbfe;
}
.info-banner--muted { background: #f8fafc; color: var(--text); border-color: var(--line); }
.info-banner code { font-size: 12px; }
.status-guide { padding: 14px 16px; }
.status-guide__list { margin: 8px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }
.count-badge { background: var(--st-suspended-bg); color: var(--st-suspended); border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700; }

/* ═══════════════ 总览北极星区 / Top榜（完善批） ═══════════════ */
.card__sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.card--big .card__sub { color: rgba(255,255,255,.85); }
.top-orgs { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.top-org { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.top-org:last-child { border-bottom: none; }
.top-org__rank { width: 20px; height: 20px; flex-shrink: 0; border-radius: 50%; background: var(--st-inactive-bg); color: var(--muted); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.top-org:nth-child(1) .top-org__rank { background: #fef3c7; color: #b45309; }
.top-org:nth-child(2) .top-org__rank { background: #e5e7eb; color: #4b5563; }
.top-org:nth-child(3) .top-org__rank { background: #fed7aa; color: #9a3412; }
.top-org__name { flex: 1; font-weight: 600; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-org__name:hover { color: var(--primary); }
.top-org__amt { font-variant-numeric: tabular-nums; font-weight: 600; }

/* 风控 tab */
.risk-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.risk-layout .panel { margin-top: 0; }
.risk-add { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.risk-add .input { flex: 1; min-width: 120px; }
.bl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bl-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.bl-item:last-child { border-bottom: none; }
.bl-item__phone { font-weight: 600; font-variant-numeric: tabular-nums; }
.bl-item__reason { flex: 1; color: var(--muted); font-size: 12px; }
.rule-list { margin: 4px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }
.rule-list li { margin-bottom: 4px; }

/* ═══════════════ 审批中心（R4-a） ═══════════════ */
.appr-card__action { font-weight: 700; font-size: 15px; }
.cs-card__reason { color: var(--st-suspended); font-size: 12px; }

/* ═══════════════ 风控规则卡组（R4-b） ═══════════════ */
.risk-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 20px; }
.rule-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.rule-card--off { opacity: 0.72; }
.rule-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.rule-card__name { font-weight: 700; font-size: 14px; }
.rule-card__code { font-size: 11px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.rule-card__desc { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 12px; }
.rule-card__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.rule-card__grid .field--full { grid-column: 1 / -1; }
.rule-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rule-toggle { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; }
.rule-toggle input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }

/* ═══════════════ 版本管理卡组（R4-c） ═══════════════ */
.version-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.ver-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.ver-card--off { opacity: 0.72; }
.ver-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.ver-card__app { font-weight: 700; font-size: 15px; }
.ver-card__plat { font-size: 11px; color: var(--muted); background: #f1f5f9; padding: 2px 8px; border-radius: 6px; }
.ver-card__force { font-size: 12px; color: var(--warn); margin: 2px 0 12px; font-variant-numeric: tabular-nums; }
.ver-card__force--off { color: var(--muted); }
.ver-card__hint { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0 0 12px; }
.ver-card__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.ver-card__grid .field--full { grid-column: 1 / -1; }
.ver-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* 套餐预设按钮多行 */
.btn--preset { text-align: left; line-height: 1.4; white-space: normal; height: auto; padding: 6px 10px; }
.preset-quota { font-size: 11px; color: var(--muted); font-weight: 400; }

/* 危险区提示（重置凭证弹窗，若未定义补一份） */
.danger-note { background: var(--st-suspended-bg); color: var(--st-suspended); border-radius: 8px; padding: 10px 12px; font-size: 12px; line-height: 1.5; margin-bottom: 14px; }

/* ═══════════════ 客户成功（R3） ═══════════════ */
/* summary 徽标行 */
.cs-summary { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cs-pill {
  display: flex; flex-direction: column; gap: 2px; min-width: 110px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; box-shadow: var(--shadow);
}
.cs-pill__num { font-size: 26px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.cs-pill__label { font-size: 12px; color: var(--muted); }
.cs-pill--open   .cs-pill__num { color: var(--st-pending); }
.cs-pill--prog   .cs-pill__num { color: var(--primary); }
.cs-pill--over   .cs-pill__num { color: var(--st-suspended); }
.cs-pill--won    .cs-pill__num { color: var(--st-active); }
.cs-pill--lost   .cs-pill__num { color: var(--st-suspended); }

/* 筛选 chips */
.cs-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.cs-chip {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  padding: 5px 14px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 500;
}
.cs-chip:hover { background: #f8fafc; color: var(--text); }
.cs-chip--active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* 任务卡列表 */
.cs-list { display: flex; flex-direction: column; gap: 12px; }
.cs-empty { text-align: center; padding: 40px 14px; }
.cs-empty--error { color: var(--danger); }
.cs-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; box-shadow: var(--shadow);
}
.cs-card__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.cs-card__org { font-weight: 700; font-size: 15px; cursor: pointer; }
.cs-card__org:hover { color: var(--primary); }
.cs-score { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cs-card__trigger { font-size: 12px; color: var(--muted); background: #f1f5f9; padding: 2px 8px; border-radius: 6px; }
.cs-card__status { margin-left: auto; }
.cs-card__verdict { font-size: 13px; color: var(--text); line-height: 1.5; margin-bottom: 8px; }
.cs-card__meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.cs-sla { font-variant-numeric: tabular-nums; }
.cs-sla--over { color: var(--st-suspended); font-weight: 700; }
.cs-card__resolution { font-size: 12px; color: var(--text); background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.cs-card__actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* playbook 折叠 */
.cs-playbook { margin-bottom: 8px; }
.cs-playbook > summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--primary); user-select: none; }
.cs-playbook__list { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.cs-playbook__list li { font-size: 13px; }
.cs-playbook__list strong { display: block; }
.cs-playbook__detail { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 结案弹窗：结果单选 */
.cs-outcome { display: flex; gap: 10px; flex-wrap: wrap; }
.cs-outcome__opt { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-size: 13px; }
.cs-outcome__opt:hover { background: #f8fafc; }

/* ═══════════════ 平台公告（D7/R4） ═══════════════ */
.ann-compose { margin-bottom: 16px; }
.ann-count { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.ann-textarea { resize: vertical; min-height: 64px; font-family: inherit; line-height: 1.5; }

.ann-list { display: flex; flex-direction: column; gap: 12px; }
.ann-card__title { cursor: default; }
.ann-card__title:hover { color: inherit; }
.ann-card__body {
  font-size: 13px; color: var(--text); line-height: 1.6; white-space: pre-wrap;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
}
.ann-fanout { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-variant-numeric: tabular-nums; }
.ann-fanout--pending { color: var(--primary); }
.ann-fanout--done { color: var(--st-active); }
.ann-fanout--failed { color: var(--st-suspended); font-weight: 600; }
.ann-spin {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid rgba(79, 70, 229, 0.25); border-top-color: var(--primary);
  animation: ann-spin 0.8s linear infinite;
}
@keyframes ann-spin { to { transform: rotate(360deg); } }

/* ═══════════════ QBR 报告（R3，全屏可打印） ═══════════════ */
.qbr-launch__row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.qbr-launch__row .input { max-width: 150px; }
.qbr-launch__hint { font-size: 12px; }

.qbr-overlay { position: fixed; inset: 0; z-index: 55; display: none; }
.qbr-overlay[aria-hidden="false"] { display: block; }
.qbr-overlay__mask { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.5); }
.qbr {
  position: absolute; top: 3vh; left: 50%; transform: translateX(-50%);
  width: 900px; max-width: 94vw; max-height: 94vh; overflow: auto;
  background: var(--panel); border-radius: 12px; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
}
.qbr__toolbar { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.qbr__error { padding: 40px; text-align: center; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.qbr__error-msg { color: var(--danger); }
.qbr__doc { padding: 28px 32px; }
.qbr__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; border-bottom: 2px solid var(--text); padding-bottom: 16px; }
.qbr__title { margin: 0 0 4px; font-size: 22px; }
.qbr__sub { color: var(--muted); font-size: 13px; }
.qbr__brand { font-weight: 800; letter-spacing: 2px; color: var(--primary); font-size: 18px; }
.qbr-section { margin-bottom: 24px; }
.qbr-section > h3 { margin: 0 0 12px; font-size: 15px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.qbr-section .chart { height: 180px; }
.qbr-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.qbr-metric { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #f8fafc; }
.qbr-metric__label { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.qbr-metric__value { font-size: 26px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.qbr-metric__sub { font-size: 12px; color: var(--muted); margin-top: 8px; }
.qbr-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.qbr-col { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.qbr-col > h4 { margin: 0 0 10px; font-size: 13px; }
.qbr-col ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.qbr-col li { margin-bottom: 4px; }
.qbr-col--good { border-top: 3px solid var(--st-active); }
.qbr-col--bad  { border-top: 3px solid var(--st-suspended); }
.qbr-col--rec  { border-top: 3px solid var(--primary); }
.qbr__footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.qbr-health .health-hero { margin-bottom: 12px; }

/* 打印：只留 QBR 报告，隐藏其余 UI */
@media print {
  body.qbr-open .topbar,
  body.qbr-open .tabs,
  body.qbr-open .content,
  body.qbr-open .drawer,
  body.qbr-open .modal,
  body.qbr-open .toast-stack { display: none !important; }
  body.qbr-open .qbr-overlay { position: static; display: block; }
  body.qbr-open .qbr-overlay__mask { display: none; }
  body.qbr-open .qbr__noprint { display: none !important; }
  body.qbr-open .qbr {
    position: static; transform: none; width: 100%; max-width: none; max-height: none;
    box-shadow: none; border-radius: 0; overflow: visible;
  }
  .qbr-metric, .qbr-col { break-inside: avoid; }
}

/* QBR 季度进行中提示（橙警示，随报告可打印） */
.badge--warn { background: #fff7ed; color: #c2410c; border: 1px solid #fdba74; }

/* ═══════════════ AI 副驾（R5：晨报 + 问数） ═══════════════ */
.ai-brief, .ai-ask { margin-bottom: 16px; }
.ai-facts { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 12px; }
.ai-narrative {
  background: #f8fafc; border: 1px solid var(--line); border-left: 3px solid var(--primary);
  border-radius: 8px; padding: 12px 14px; font-size: 13px; line-height: 1.7;
  white-space: pre-line; color: var(--text); margin-top: 4px;
}
.ai-suggestions { margin-top: 12px; }
.ai-suggestions__title { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.ai-suggestions ol { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.6; }
.ai-unavailable { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.ai-unavailable--info {
  padding: 8px 12px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--line);
}
.ai-badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--st-inactive-bg); color: var(--st-inactive); border: 1px dashed var(--st-inactive);
}
.ai-badge--info { background: #eff6ff; color: #1d4ed8; border-color: #93c5fd; border-style: solid; }
.ai-ask__form { display: flex; gap: 10px; }
.ai-ask__form .input { flex: 1; min-width: 0; }
.ai-examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ai-example {
  cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--primary);
  border-radius: 999px; padding: 4px 12px; font-size: 12px; font-family: inherit;
}
.ai-example:hover { border-color: var(--primary); background: var(--accent-soft); }
.ai-answer { margin-top: 14px; }
.ai-answer__text {
  background: #f8fafc; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; font-size: 14px; line-height: 1.7; white-space: pre-line;
}
.ai-answer__chart { margin-top: 12px; }
.ai-tooltrace { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.ai-tooltrace__title { font-size: 11px; color: var(--muted); font-weight: 700; }
.ai-tool { background: var(--accent-soft); color: var(--accent-dark); }
.qbr-narrative .ai-narrative--qbr { white-space: pre-line; }

/* ═══════════════ 代登排障 Impersonate（R6-a·危险操作） ═══════════════ */
.modal__title--danger { color: var(--danger); }
.danger-note--strong { border-width: 2px; font-size: 13px; }
.cred-item--imp { border-color: var(--danger); }
.imp-token {
  flex: 1; min-width: 0; font-family: 'SF Mono', Menlo, monospace; font-size: 12px;
  line-height: 1.4; resize: vertical; word-break: break-all;
}
.imp-countdown { text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.imp-countdown__num {
  font-size: 22px; font-weight: 800; color: var(--danger); font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.imp-countdown__num--over { color: var(--st-inactive); }
.imp-usage { margin-top: 12px; }
.imp-usage__warn { display: block; margin-top: 4px; font-weight: 600; }

/* ═══════════════ CS AI 话术（R5） ═══════════════ */
.cs-script__text {
  background: #f8fafc; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; font-size: 14px; line-height: 1.8; white-space: pre-line; max-height: 50vh; overflow-y: auto;
}
.cs-script__actions { margin-top: 12px; text-align: right; }

/* ═══════════════ 服务状态页（R6-b） ═══════════════ */
.status-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.status-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow);
}
.status-card--down { border-color: var(--danger); background: #fff5f5; }
.status-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.status-card__name { font-weight: 700; font-size: 14px; word-break: break-all; }
.st-dot { font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 999px; letter-spacing: 0.5px; }
.st-dot--up { background: var(--st-active-bg); color: var(--st-active); }
.st-dot--down { background: var(--st-suspended-bg); color: var(--st-suspended); }
.st-dot--unknown { background: var(--st-inactive-bg); color: var(--st-inactive); }
.status-card__metrics { display: flex; gap: 18px; }
.st-metric { display: flex; flex-direction: column; gap: 2px; }
.st-metric__label { font-size: 11px; color: var(--muted); }
.st-metric__val { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.st-metric--bad .st-metric__val { color: var(--danger); }
.st-metric--warn .st-metric__val { color: var(--warn); }

/* ═══════════════ 审批中心（换肤） ═══════════════ */
.appr-compose { margin-bottom: 16px; }
.appr-compose > summary {
  cursor: pointer; user-select: none; font-weight: 600; font-size: 14px;
  padding: 12px 16px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); color: var(--text);
}
.appr-compose[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.appr-compose__body {
  padding: 16px 18px 18px; background: var(--panel); border: 1px solid var(--line);
  border-top: 0; border-radius: 0 0 10px 10px; box-shadow: var(--shadow);
}
.appr-card__action { font-weight: 700; font-size: 16px; color: var(--ink); }
.cs-card--appr .cs-card__actions .btn--primary { min-width: 120px; }
.cs-card--appr .linkish { color: var(--accent-dark); }
.appr-recap {
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text);
}
.appr-recap__lead { font-weight: 700; margin-bottom: 6px; color: var(--ink, var(--text)); }
.appr-recap__row { display: flex; gap: 8px; }
.appr-recap__k { color: var(--muted); flex: 0 0 56px; }
.appr-recap__v { font-weight: 600; word-break: break-all; }


/* ═══════════════ 工作台 pulse / tab 徽标 / 类目 chips ═══════════════ */
.inbox-pulse {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.pulse-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  text-align: left;
}
button.pulse-card {
  font: inherit;
  color: inherit;
  width: 100%;
  cursor: pointer;
}
.pulse-card--muted {
  grid-column: 1 / -1;
  color: var(--muted);
  text-align: center;
  padding: 16px;
}
.pulse-card--critical { border-color: var(--st-suspended-bg); }
.pulse-card--critical:hover { background: var(--st-suspended-bg); }
.pulse-card--critical .pulse-card__value { color: var(--danger); }
.pulse-card__label { font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.pulse-card__value { font-size: 20px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.pulse-card__sub { font-size: 11px; color: var(--muted); margin-top: 4px; }

.tab__badge {
  display: inline-block;
  min-width: 1.4em;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--st-pending-bg);
  color: var(--warn);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}

.inbox-cleared {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.inbox-cleared[hidden] { display: none !important; }

.cat-chip-row { display: flex; gap: 8px; align-items: center; }
.cat-chip-row .input { flex: 1; min-width: 0; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 999px;
  font-size: 12px;
  font-family: var(--font-num);
}
.cat-chip__x {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
.cat-chip__x:hover { color: var(--danger); }

.cat-suggest {
  margin-top: 6px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.cat-suggest[hidden] { display: none !important; }
.cat-suggest__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}
.cat-suggest__item:hover,
.cat-suggest__item:focus {
  background: var(--accent-soft);
  outline: none;
}
.cat-suggest__name { font-size: 13px; }
.cat-suggest__meta { font-size: 11px; color: var(--muted); }
.cat-suggest__empty { padding: 8px 10px; font-size: 12px; color: var(--muted); }
.cat-chip--named { font-family: inherit; }

/* 套餐模块开关（开/关/跟目录，不手写 JSON） */
.mod-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.mod-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.mod-chip:hover { border-color: var(--primary); }
.mod-chip--on { background: var(--primary); border-color: var(--primary); color: #fff; }
.mod-chip--off { background: #f1f5f9; color: var(--muted); text-decoration: line-through; }
.mod-chip__mark { font-size: 11px; opacity: 0.85; }
.mod-chip:disabled { cursor: not-allowed; opacity: 0.7; }
