/* ============================================================
   采购管理 procure 样式 —— 现代 SaaS 后台 · 翡翠绿
   冷灰白底 + 纯白卡 + emerald 主色 + 无衬线 + 大圆角柔和阴影
   所有 class 名 / DOM 契约保持不变,仅重塑视觉。
   ============================================================ */
:root {
  /* —— 中性 —— */
  --p-bg:     #f5f6f8;   /* 内容区冷灰白 */
  --p-bg-2:   #eef0f3;   /* 斑马 / hover */
  --p-paper:  #ffffff;
  --p-ink:    #1f2a37;
  --p-ink-2:  #4b5563;
  --p-ink-3:  #9aa2af;
  --p-line:   #edeff2;
  --p-line-2: #dfe3e8;

  /* —— 品牌:翡翠绿 —— */
  --p-brand:    #0e9f6e;
  --p-brand-2:  #057a55;
  --p-brand-3:  #def7ec;
  --p-brand-ink:#03543f;

  /* —— 语义色(固定,不随主题变,确保状态可辨) —— */
  --p-ok:        #0e9f6e;
  --p-ok-bg:     #def7ec;
  --p-ok-ink:    #057a55;
  --p-ok-border: #aceaccb3;
  --p-warn:  #c27803;
  --p-bad:   #e02424;

  /* 兼容旧变量名 */
  --p-accent:   var(--p-brand);
  --p-accent-2: var(--p-brand-2);

  /* 信息蓝(KPI 用) */
  --p-info: #1c64f2;

  --p-font: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', Roboto, 'Geist', system-ui, sans-serif;
  --p-display: var(--p-font);
  --p-mono: 'Geist Mono', SFMono-Regular, Consolas, monospace;

  --p-shadow-sm: 0 1px 2px rgba(16,24,40,0.05);
  --p-shadow-md: 0 4px 16px rgba(16,24,40,0.08);
  --p-shadow-lg: 0 20px 52px rgba(16,24,40,0.18);
  --p-radius: 12px;
  --p-radius-sm: 8px;
  --p-ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* 下拉箭头(灰) */
  --p-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239aa2af' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--p-font);
  font-size: 14px;
  color: var(--p-ink);
  background: var(--p-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--p-brand); text-decoration: none; transition: color .15s var(--p-ease); }
a:hover { color: var(--p-brand-2); text-decoration: none; }
::selection { background: rgba(14,159,110,0.18); }

*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb { background: #d2d7dd; border-radius: 6px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #b9bfc7; background-clip: padding-box; border: 3px solid transparent; }
*::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--p-brand); outline-offset: 2px; border-radius: 4px; }

/* ============================================================
   顶栏
   ============================================================ */
.p-topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: stretch; gap: 8px;
  padding: 8px 10px; min-height: 82px;
  background: var(--p-paper);
  border-bottom: 1px solid var(--p-line-2);
  box-shadow: 0 12px 34px rgba(16,24,40,0.08);
}
/* logo + 品牌名(替代旧 h1) */
.p-topbar h1 {
  margin: 0; font-size: 18px; font-weight: 760; color: var(--p-ink);
  letter-spacing: 0; display: flex; align-items: center; gap: 10px; white-space: nowrap;
  min-width: 158px; padding: 7px 2px 7px 0;
}
.p-logo {
  width: 36px; height: 36px; border-radius: 9px; flex: none;
  background: linear-gradient(180deg, #19c7b5 0%, var(--p-brand-2) 100%);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 22px rgba(14,159,110,0.24);
}
.p-logo svg { width: 21px; height: 21px; }
.p-title-main { line-height: 1; }
.p-topbar h1 small { color: var(--p-ink-3); font-weight: 400; font-size: 12px; }

.p-nav {
  display: flex; gap: 8px; margin-left: 0; flex: 1; min-width: 0;
  flex-wrap: nowrap; align-items: stretch; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin;
  padding: 0 2px 4px;
}
.p-nav-group {
  flex: 0 0 auto;
  display: flex;
  min-width: 154px;
}
.p-nav-group:nth-child(1) { min-width: 308px; }
.p-nav-group:nth-child(2) { min-width: 122px; }
.p-nav-group:nth-child(3) { min-width: 470px; }
.p-nav-group:nth-child(4) { min-width: 222px; }
.p-nav-group:nth-child(5) { min-width: 206px; }
.p-nav-group-card {
  position: relative;
  width: 100%;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px 7px;
  border: 1px solid var(--p-line-2);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #fbfcfd 100%);
  box-shadow: var(--p-shadow-sm);
  transition: border-color .16s var(--p-ease), background .16s var(--p-ease), box-shadow .16s var(--p-ease), transform .16s var(--p-ease);
}
.p-nav-group-card:hover {
  transform: translateY(-1px);
  border-color: #cfd8e3;
  box-shadow: var(--p-shadow-md);
}
.p-nav-group.active .p-nav-group-card {
  border-color: rgba(14,159,110,0.2);
  background: linear-gradient(180deg, rgba(222,247,236,0.6) 0%, rgba(255,255,255,0.94) 100%);
  box-shadow: var(--p-shadow-md);
}
.p-nav-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.p-nav-group-icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--p-brand);
  background: var(--p-brand-3);
  box-shadow: inset 0 0 0 1px rgba(14,159,110,0.12);
}
.p-nav-group:nth-child(1) .p-nav-group-icon { color: #1c64f2; background: #e1effe; }
.p-nav-group:nth-child(2) .p-nav-group-icon { color: #3f83f8; background: #e1effe; }
.p-nav-group:nth-child(3) .p-nav-group-icon { color: #7e3af2; background: #ede9fe; }
.p-nav-group:nth-child(4) .p-nav-group-icon { color: var(--p-brand); background: var(--p-brand-3); }
.p-nav-group:nth-child(5) .p-nav-group-icon { color: #64748b; background: #f1f5f9; }
.p-nav-group-icon svg {
  width: 14px;
  height: 14px;
}
.p-nav-group-title {
  color: var(--p-ink);
  font-size: 14px;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
}
.p-nav-group-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.p-nav-group.active .p-nav-group-label {
  color: var(--p-brand-2);
}
.p-nav-group-links {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  min-width: 0;
}
.p-nav a {
  position: relative; padding: 0 0 4px; border-radius: 0;
  color: var(--p-ink-2); font-size: 11.5px; line-height: 1;
  transition: all .15s var(--p-ease); white-space: nowrap;
}
.p-nav a:hover { background: transparent; color: var(--p-ink); }
.p-nav a.active { color: var(--p-brand-2); font-weight: 700; background: transparent; }
.p-nav a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: var(--p-brand); border-radius: 3px 3px 0 0;
}

/* 右侧操作区 */
.p-top-actions { display: flex; align-items: center; gap: 5px; margin-left: auto; padding: 7px 0; }
.p-icon-btn {
  width: 36px; height: 36px; border-radius: 9px; border: none; background: transparent;
  color: var(--p-ink-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  position: relative; transition: background .15s var(--p-ease), color .15s var(--p-ease);
}
.p-icon-btn:hover { background: var(--p-bg); color: var(--p-ink); }
.p-icon-btn svg { width: 19px; height: 19px; }
.p-bell-badge {
  position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--p-bad); color: #fff; border-radius: 9px; font-size: 10px; font-weight: 600;
  line-height: 16px; text-align: center; border: 2px solid var(--p-paper); box-sizing: content-box;
}

/* 用户区 + 下拉 */
.p-userbox { position: relative; }
.p-userbox-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 9px 5px 5px; border-radius: 22px;
  border: 1px solid var(--p-line-2); background: var(--p-paper); cursor: pointer;
  color: var(--p-ink); font: inherit; font-size: 13px; transition: all .15s var(--p-ease);
}
.p-userbox-btn:hover { background: var(--p-bg); border-color: #cfd5dc; }
.p-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #34d399, var(--p-brand-2));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.p-userbox-btn .p-uchev { width: 14px; height: 14px; color: var(--p-ink-3); transition: transform .2s var(--p-ease); }
.p-userbox.open .p-uchev { transform: rotate(180deg); }
.p-user-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 196px;
  background: var(--p-paper); border: 1px solid var(--p-line-2); border-radius: 12px;
  box-shadow: var(--p-shadow-lg); padding: 6px; z-index: 60;
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all .16s var(--p-ease);
}
.p-userbox.open .p-user-menu { opacity: 1; visibility: visible; transform: none; }
.p-user-menu .p-um-head { padding: 9px 11px 10px; border-bottom: 1px solid var(--p-line); margin-bottom: 5px; }
.p-user-menu .p-um-name { font-weight: 600; font-size: 13.5px; color: var(--p-ink); }
.p-user-menu .p-um-role { font-size: 11.5px; color: var(--p-ink-3); margin-top: 2px; }
.p-user-menu a, .p-user-menu button {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 8px 11px; border-radius: 8px; border: none; background: transparent;
  color: var(--p-ink-2); font: inherit; font-size: 13px; cursor: pointer; transition: background .12s var(--p-ease);
}
.p-user-menu a:hover, .p-user-menu button:hover { background: var(--p-bg); color: var(--p-ink); }
.p-user-menu .danger { color: var(--p-bad); }
.p-user-menu .danger:hover { background: #fef2f2; }
.p-user-menu svg { width: 16px; height: 16px; flex: none; }
.p-user { display: none; } /* 旧节点隐藏 */

/* ============================================================
   容器 / 标题
   ============================================================ */
.p-container { padding: 24px 26px 64px; max-width: 1720px; margin: 0 auto; animation: p-rise .35s var(--p-ease) both; }
.p-container > h2 {
  margin: 0 0 18px; font-size: 21px; font-weight: 700; color: var(--p-ink);
  letter-spacing: -0.015em; display: flex; align-items: baseline; gap: 10px;
}
.p-container > h2 small { font-size: 13px; font-weight: 400; }
.p-muted { color: var(--p-ink-3); }
.p-center { text-align: center; }
.hidden { display: none !important; }
@keyframes p-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================================================
   KPI 图标卡
   ============================================================ */
.p-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); gap: 16px; margin-bottom: 22px; }
.p-kpi-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--p-paper); border: 1px solid var(--p-line); border-radius: var(--p-radius);
  padding: 18px 20px; box-shadow: var(--p-shadow-sm);
  transition: transform .2s var(--p-ease), box-shadow .2s var(--p-ease);
}
.p-kpi-card:hover { transform: translateY(-2px); box-shadow: var(--p-shadow-md); }
.p-kpi-clickable { cursor: pointer; }
.p-kpi-icon {
  width: 50px; height: 50px; border-radius: 14px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.p-kpi-icon svg { width: 24px; height: 24px; }
.p-kpi-icon.info   { background: #e1effe; color: var(--p-info); }
.p-kpi-icon.ok     { background: var(--p-ok-bg); color: var(--p-ok-ink); }
.p-kpi-icon.warn   { background: #fdf6b2; color: var(--p-warn); }
.p-kpi-icon.danger { background: #fde8e8; color: var(--p-bad); }
.p-kpi-icon.muted  { background: #f0f2f5; color: var(--p-ink-3); }
.p-kpi-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.p-kpi-label { font-size: 13px; color: var(--p-ink-3); }
.p-kpi-value { font-size: 28px; font-weight: 700; line-height: 1; color: var(--p-ink); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.p-kpi-value .p-kpi-unit { font-size: 13px; font-weight: 400; color: var(--p-ink-3); margin-left: 4px; }
.p-ticket-status-kpi { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.p-ticket-status-kpi .p-kpi-card { min-width: 0; gap: 10px; padding: 12px 14px; }
.p-ticket-status-kpi .p-kpi-icon { width: 38px; height: 38px; border-radius: 12px; }
.p-ticket-status-kpi .p-kpi-icon svg { width: 19px; height: 19px; }
.p-ticket-status-kpi .p-kpi-body { gap: 3px; }
.p-ticket-status-kpi .p-kpi-label { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-ticket-status-kpi .p-kpi-value { font-size: 23px; }
@media (max-width: 1180px) {
  .p-ticket-status-kpi { grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); }
}

/* ============================================================
   工具栏 / 筛选
   ============================================================ */
.p-filter-bar {
  display: flex; flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 14px 18px; margin-bottom: 16px;
  padding: 18px 20px; background: var(--p-paper); border: 1px solid var(--p-line);
  border-radius: var(--p-radius); box-shadow: var(--p-shadow-sm);
}
.p-filter-fields { display: flex; flex: 1 1 auto; flex-wrap: wrap; gap: 14px 18px; align-items: flex-end; min-width: 0; }
/* 收起态:限制高度只显示一行筛选 */
.p-filter-fields.collapsed { max-height: 66px; overflow: hidden; }
.p-filter-bar label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--p-ink-2); font-weight: 500; }
.p-filter-bar input, .p-filter-bar select {
  padding: 9px 11px; border: 1px solid var(--p-line-2); border-radius: var(--p-radius-sm);
  font: inherit; font-size: 13px; min-width: 150px; background: var(--p-paper); color: var(--p-ink);
  transition: border-color .15s var(--p-ease), box-shadow .15s var(--p-ease);
}
.p-filter-bar input::placeholder { color: #b6bcc4; }
.p-filter-bar input:focus, .p-filter-bar select:focus {
  border-color: var(--p-brand); outline: none; box-shadow: 0 0 0 3px rgba(14,159,110,0.13);
}
/* 下拉(select + datalist input)统一加 chevron */
.p-filter-bar select, .p-form select, .p-status-panel select,
.p-filter-bar input[list], .p-form input[list], .p-status-panel input[list], .p-test-panel input[list], .p-grid-2 input[list] {
  -webkit-appearance: none; appearance: none;
  background-image: var(--p-chevron); background-repeat: no-repeat;
  background-position: right 10px center; background-size: 15px; padding-right: 32px;
}
.p-flex-row { display: flex; gap: 8px; align-items: center; }
.p-flex-spacer { flex: 1; }

/* 筛选底部操作行(收起切换 · 重置 · 查询)*/
.p-filter-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; align-self: flex-end; }
.p-filter-toggle {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  color: var(--p-brand); font-size: 13px; font-weight: 500; background: none; border: none; padding: 6px 2px;
}
.p-filter-toggle svg { width: 14px; height: 14px; transition: transform .2s var(--p-ease); }
.p-filter-toggle.expanded svg { transform: rotate(180deg); }

/* 分组等多选筛选：原生 datalist 输入下拉(可输入/模糊匹配) + 选中收割成 chip(多选)。
   类名 .taginput / .tag-chip 与 v2Common.setupTagInput 渲染硬编码一致，按 procure 主题改色 */
.td-wrap { position: relative; display: inline-block; }
.p-filter-bar .taginput {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 5px 28px 5px 8px; min-width: 180px; max-width: 320px; max-height: 64px; overflow-y: auto;
  border: 1px solid var(--p-line-2); border-radius: var(--p-radius-sm);
  background: var(--p-paper); transition: border-color .15s var(--p-ease), box-shadow .15s var(--p-ease);
}
.p-filter-bar .taginput:focus-within { border-color: var(--p-brand); box-shadow: 0 0 0 3px rgba(14,159,110,0.13); }
.p-filter-bar .taginput input {
  border: 0; outline: 0; box-shadow: none; padding: 3px 4px; margin: 0;
  flex: 1; min-width: 80px; font-size: 13px; background: transparent; color: var(--p-ink);
}
/* 下拉指示箭头(纯视觉，点击/输入走原生 datalist) */
.td-wrap::after {
  content: ""; position: absolute; right: 9px; top: 14px;
  width: 15px; height: 15px; pointer-events: none;
  background: var(--p-chevron) no-repeat center / 15px;
}
.p-filter-bar .td-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 80;
  width: min(420px, calc(100vw - 48px));
  max-height: 320px;
  overflow: auto;
  padding: 6px 0;
  background: var(--p-paper);
  border: 1px solid var(--p-line-2);
  border-radius: 10px;
  box-shadow: var(--p-shadow-lg);
}
.p-filter-bar .td-dropdown.hidden { display: none; }
.p-filter-bar .td-mod {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 9px;
  padding: 7px 12px;
  color: var(--p-ink-2);
  font-size: 12.5px;
  line-height: 1.35;
  cursor: pointer;
  border-bottom: 1px solid var(--p-line);
}
.p-filter-bar .td-mod:last-of-type { border-bottom: 0; }
.p-filter-bar .td-mod:hover { background: var(--p-bg); color: var(--p-ink); }
.p-filter-bar .td-mod .td-cb {
  width: 14px;
  height: 14px;
  min-width: 14px;
  padding: 0;
  margin: 0;
  border-radius: 3px;
  box-shadow: none;
  background-image: none;
  pointer-events: none;
  cursor: pointer;
  justify-self: start;
}
.p-filter-bar .td-mod > span:not(.td-id) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.p-filter-bar .td-mod .td-id {
  color: var(--p-ink-3);
  font-family: var(--p-mono);
  font-size: 11px;
  white-space: nowrap;
}
.p-filter-bar .td-empty {
  padding: 10px 12px;
  color: var(--p-ink-3);
  font-size: 12.5px;
}
.p-filter-bar .td-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: #fbfcfd;
  border-top: 1px solid var(--p-line);
  color: var(--p-ink-3);
  font-size: 12px;
}
.p-filter-bar .td-foot a {
  color: var(--p-brand-2);
  cursor: pointer;
  white-space: nowrap;
}
.p-filter-bar .td-foot a:hover { color: var(--p-brand); }
.taginput .tag-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 8px;
  background: var(--p-brand-3); color: var(--p-brand-ink); border-radius: 6px;
  font-family: var(--p-mono); font-size: 11px;
}
.taginput .tag-chip button {
  border: 0; background: transparent; cursor: pointer; color: var(--p-brand-2);
  font-size: 14px; line-height: 1; padding: 0 2px; border-radius: 4px;
}
.taginput .tag-chip button:hover { background: rgba(14,159,110,0.18); color: var(--p-ink); }

/* ============================================================
   按钮
   ============================================================ */
.btn-ghost, .btn-primary, .btn-danger {
  font: inherit; font-size: 13px; cursor: pointer; border-radius: var(--p-radius-sm);
  transition: all .15s var(--p-ease); line-height: 1.4; white-space: nowrap;
}
.btn-ghost {
  border: 1px solid var(--p-line-2); background: var(--p-paper); color: var(--p-ink-2); padding: 8px 14px;
}
.btn-ghost:hover { border-color: #c4cbd3; color: var(--p-ink); background: var(--p-bg); }
.btn-ghost:active { transform: translateY(1px); }
.btn-ghost:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  background: var(--p-brand); color: #fff; border: 1px solid var(--p-brand);
  padding: 8px 18px; font-weight: 500; box-shadow: 0 1px 2px rgba(14,159,110,0.25);
}
.btn-primary:hover { background: var(--p-brand-2); border-color: var(--p-brand-2); box-shadow: 0 3px 10px rgba(14,159,110,0.3); }
.btn-primary:active { transform: translateY(1px); }
.btn-danger { background: var(--p-bad); color: #fff; border: 1px solid var(--p-bad); padding: 8px 14px; }
.btn-danger:hover { filter: brightness(1.06); }
.btn-danger:active { transform: translateY(1px); }

/* ============================================================
   表格
   ============================================================ */
.p-table {
  width: 100%; border-collapse: separate; border-spacing: 0; background: var(--p-paper);
  border: 1px solid var(--p-line); border-radius: var(--p-radius); overflow: hidden; box-shadow: var(--p-shadow-sm);
}
.p-table th, .p-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--p-line); text-align: left; font-size: 13px; vertical-align: middle;
}
.p-table th {
  background: #fafbfc; font-weight: 600; color: var(--p-ink-2);
  font-size: 12px; letter-spacing: .01em; border-bottom: 1px solid var(--p-line-2);
  position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
.p-table tbody tr { transition: background .12s var(--p-ease); }
.p-table tbody tr:hover td { background: #f7fbf9; }
.p-table tr:last-child td { border-bottom: none; }
.p-table td.right, .p-table th.right { text-align: right; font-family: var(--p-mono); font-variant-numeric: tabular-nums; }
.p-table td.center, .p-table th.center { text-align: center; }
.p-table .row-action { white-space: nowrap; }
.p-table .row-action button { padding: 5px 11px; margin-right: 4px; font-size: 12px; }
.p-table tr.total td, .p-table tfoot td {
  background: var(--p-brand-3) !important; font-weight: 600; color: var(--p-brand-ink);
  border-top: 1px solid var(--p-line-2);
}
.p-channel-remarks {
  min-width: 220px;
  max-width: 360px;
  white-space: normal;
  line-height: 1.5;
}
.p-channel-remark-line + .p-channel-remark-line { margin-top: 4px; }

/* ============================================================
   状态徽标
   ============================================================ */
.pbadge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px 3px 9px; border-radius: 20px; font-size: 12px; line-height: 1.5; font-weight: 500;
  background: #f3f4f6; color: var(--p-ink-2); border: 1px solid var(--p-line-2);
  white-space: nowrap;
}
.pbadge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pbadge.pbadge-sm { padding: 1px 8px 1px 7px; font-size: 11px; line-height: 1.35; gap: 4px; }
.pbadge.pbadge-sm::before { width: 5px; height: 5px; }
.p-ticket-no { display: flex; align-items: center; gap: 6px; max-width: 100%; white-space: nowrap; }
.p-ticket-no code { display: inline-block; min-width: 0; max-width: calc(100% - 52px); overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.p-ticket-time-stack {
  display: grid;
  gap: 1px;
  min-width: 132px;
  font-size: 11px;
  line-height: 1.22;
  color: var(--p-ink-2);
  white-space: nowrap;
}
.p-ticket-time-stack span {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.p-ticket-time-stack b {
  flex: 0 0 auto;
  min-width: 24px;
  color: var(--p-ink-3);
  font-weight: 500;
}
.p-ticket-model-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 4px;
  max-width: 180px;
  line-height: 1.15;
}
.p-ticket-model-tag {
  margin: 0;
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 10px;
  line-height: 1.35;
  font-weight: 500;
}
.p-ticket-result-stack {
  display: grid;
  gap: 2px;
  min-width: 210px;
  max-width: 280px;
  font-size: 11px;
  line-height: 1.22;
  color: var(--p-ink);
}
.p-ticket-result-stack > div {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}
.p-ticket-result-stack b {
  flex: 0 0 auto;
  min-width: 24px;
  color: var(--p-ink-3);
  font-weight: 500;
}
.p-ticket-result-stack .pbadge {
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1.25;
}
.p-ticket-remark-wrap {
  max-width: 18em;
  align-items: flex-start;
}
.p-ticket-remark {
  display: -webkit-box;
  max-width: 20em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--p-ink);
  font-size: 11px;
  line-height: 1.22;
  vertical-align: top;
}
.pbadge.success { background: var(--p-ok-bg); color: var(--p-ok-ink); border-color: var(--p-ok-border); }
.pbadge.info    { background: #e1effe; color: #1d4ed8; border-color: #bfdbfe; }
.pbadge.warn    { background: #fdf6b2; color: #8e5410; border-color: #fce96a99; }
.pbadge.brand   { background: var(--p-brand-3); color: var(--p-brand-ink); border-color: #bcf0da; }
.pbadge.indigo  { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.pbadge.danger  { background: #fde8e8; color: #c81e1e; border-color: #fbd5d5; }
.pbadge.slate   { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.pbadge.amber   { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.pbadge.sky     { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.pbadge.orange  { background: #ffedd5; color: #c2410c; border-color: #fed7aa; }
.pbadge.teal    { background: #ccfbf1; color: #0f766e; border-color: #99f6e4; }
.pbadge.lime    { background: #ecfccb; color: #4d7c0f; border-color: #d9f99d; }
.pbadge.cyan    { background: #cffafe; color: #0e7490; border-color: #a5f3fc; }
.pbadge.rose    { background: #ffe4e6; color: #be123c; border-color: #fecdd3; }
.pbadge.stone   { background: #f5f5f4; color: #57534e; border-color: #d6d3d1; }

/* CSS tooltip */
.tip-wrap { position: relative; display: inline-block; white-space: nowrap; vertical-align: middle; }
.tip-wrap .tip-content {
  visibility: hidden; opacity: 0; position: absolute; bottom: 130%; left: 50%;
  transform: translateX(-50%); background: #1e293b; color: #f1f5f9;
  padding: 4px 8px; border-radius: 4px; font-size: 12px; white-space: nowrap;
  transition: opacity .15s; pointer-events: none; z-index: 30;
}
.tip-wrap .tip-content::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #1e293b;
}
.tip-wrap:hover .tip-content { visibility: visible; opacity: 1; }

/* 置顶标记 */
.pinned-mark {
  font-size: 14px; line-height: 1; cursor: default;
}

/* 置顶行渐变背景（跟随主题色） */
.pinned-row {
  background: linear-gradient(90deg, color-mix(in srgb, var(--p-brand) 12%, transparent), color-mix(in srgb, var(--p-brand) 3%, transparent)) !important;
}
.pbadge.muted   { background: #f3f4f6; color: var(--p-ink-3); border-color: var(--p-line-2); }

/* ============================================================
   弹窗 / 抽屉
   ============================================================ */
#p-drawer-overlay {
  display: none; position: fixed; inset: 0; background: rgba(17,24,39,0.45); z-index: 100;
  align-items: center; justify-content: center; padding: 28px;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: p-fade .2s var(--p-ease);
}
@keyframes p-fade { from { opacity: 0; } to { opacity: 1; } }
.p-drawer {
  width: 54vw; min-width: 720px; max-width: 100%; max-height: 90vh; border-radius: 16px;
  background: var(--p-paper); box-shadow: var(--p-shadow-lg);
  display: flex; flex-direction: column; overflow: hidden; animation: p-pop .26s var(--p-ease);
}
.p-drawer.p-drawer-resizable {
  width: min(1280px, 92vw);
  height: min(880px, 88vh);
  min-width: 720px;
  min-height: 520px;
  max-width: 96vw;
  max-height: 92vh;
  resize: both;
  overflow: auto;
  border: 1px solid var(--p-line-2);
}
.p-drawer.p-drawer-resizable .p-drawer-body {
  min-height: 0;
}
@keyframes p-pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.p-drawer-head {
  display: flex; align-items: center; padding: 16px 22px; gap: 10px;
  border-bottom: 1px solid var(--p-line); background: var(--p-paper);
}
.p-drawer-head h3 { margin: 0; font-size: 16px; font-weight: 700; flex: 1; letter-spacing: -0.01em; }
.p-drawer-body { padding: 22px; overflow: auto; flex: 1; }
.p-drawer-body dl { display: grid; grid-template-columns: 132px 1fr; gap: 10px 16px; margin: 0 0 16px; }
.p-drawer-body dt { color: var(--p-ink-3); font-size: 12px; }
.p-drawer-body dd { margin: 0; font-size: 13px; word-break: break-all; }
.p-drawer-body .p-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--p-line); }
.p-drawer-body .p-section h4 { margin: 0 0 12px; font-size: 13.5px; font-weight: 700; color: var(--p-ink); }
.p-drawer-body .p-section .p-table { font-size: 12px; }

.p-drawer.p-routing-drawer {
  width: min(1560px, calc(100vw - 40px));
  min-width: min(1020px, calc(100vw - 40px));
  max-width: calc(100vw - 40px);
  height: min(880px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
  border: 1px solid var(--p-line);
  border-radius: 12px;
  box-shadow: 0 22px 70px rgba(15, 23, 42, .18);
}
.p-routing-drawer .p-drawer-head {
  min-height: 72px;
  padding: 16px 24px;
  background: var(--p-paper);
}
.p-routing-drawer .p-drawer-head h3 {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 28px;
  padding-left: 36px;
  color: var(--p-ink);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
}
.p-routing-drawer .p-drawer-head h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translateY(-50%);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 16%, var(--p-ink) 0 2.4px, transparent 2.6px),
    radial-gradient(circle at 20% 76%, var(--p-ink) 0 2.4px, transparent 2.6px),
    radial-gradient(circle at 80% 76%, var(--p-ink) 0 2.4px, transparent 2.6px);
  background-size: 24px 24px;
  background-repeat: no-repeat;
  opacity: .9;
}
.p-routing-drawer .p-drawer-head h3::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 50%;
  width: 18px;
  height: 16px;
  transform: translateY(-36%);
  background:
    linear-gradient(30deg, transparent 47%, var(--p-ink) 48% 54%, transparent 55%),
    linear-gradient(-30deg, transparent 47%, var(--p-ink) 48% 54%, transparent 55%);
  opacity: .9;
}
.p-routing-drawer .p-drawer-body {
  padding: 16px;
  background: #fbfcfd;
}

.p-ticket-detail-shell {
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(420px, 1.55fr);
  gap: 24px;
  align-items: start;
}
.p-ticket-left,
.p-ticket-comments {
  border: 1px solid var(--p-line-2);
  background: var(--p-paper);
  border-radius: var(--p-radius-sm);
  padding: 14px;
}
.p-ticket-comments {
  max-height: min(640px, calc(88vh - 150px));
  overflow: auto;
}
.p-comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--p-line);
}
.p-comment-head h4 { margin: 0; font-size: 13.5px; }
.p-comment-list { display: grid; gap: 10px; margin-top: 12px; }
.p-comment-empty { padding: 20px 10px; }
.p-comment-item {
  padding: 10px;
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius-sm);
  background: var(--p-bg);
}
.p-comment-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--p-ink-3);
  font-size: 11px;
  margin-bottom: 6px;
}
.p-comment-body {
  color: var(--p-ink);
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}
.p-comment-body p { margin: 0 0 6px; }
.p-comment-body p:last-child { margin-bottom: 0; }
.p-comment-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.p-comment-thumb {
  width: 92px;
  height: 68px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--p-line-2);
  border-radius: var(--p-radius-sm);
  background: var(--p-paper);
  cursor: zoom-in;
}
.p-comment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.p-comment-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
}
.p-comment-editor-wrap {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--p-line);
}
.p-comment-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.p-comment-file-btn { position: relative; overflow: hidden; }
.p-comment-file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.p-comment-editor {
  min-height: 96px;
  max-height: 220px;
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid var(--p-line-2);
  border-radius: var(--p-radius-sm);
  background: #fff;
  outline: none;
  font-size: 13px;
  line-height: 1.6;
}
.p-comment-editor:focus {
  border-color: var(--p-brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--p-brand) 14%, transparent);
}
.p-comment-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--p-ink-3);
}
.p-comment-pending { min-height: 18px; margin-top: 6px; font-size: 11px; }
.p-comment-pending-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.p-comment-draft-thumb,
.p-comment-draft-file {
  position: relative;
  border: 1px solid var(--p-line-2);
  border-radius: var(--p-radius-sm);
  background: var(--p-bg);
  overflow: hidden;
}
.p-comment-draft-thumb {
  width: 104px;
  height: 78px;
}
.p-comment-draft-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.p-comment-draft-thumb button,
.p-comment-draft-file button {
  position: absolute;
  right: 4px;
  top: 4px;
  border: 1px solid rgba(15, 23, 42, .16);
  border-radius: 4px;
  background: rgba(255,255,255,.9);
  color: var(--p-ink-2);
  font-size: 11px;
  padding: 1px 5px;
  cursor: pointer;
}
.p-comment-draft-file {
  min-height: 34px;
  max-width: 220px;
  padding: 8px 48px 8px 10px;
  font-size: 12px;
  color: var(--p-ink-2);
}
.p-comment-draft-file span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.p-comment-actions { margin-top: 6px; justify-content: flex-end; }
.p-comment-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px;
  background: rgba(15, 23, 42, .74);
}
.p-comment-preview-overlay img {
  max-width: min(1120px, 92vw);
  max-height: 88vh;
  object-fit: contain;
  background: #fff;
  border-radius: var(--p-radius-sm);
  box-shadow: var(--p-shadow-lg);
}
.p-comment-preview-close {
  position: fixed;
  top: 18px;
  right: 22px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: var(--p-radius-sm);
  background: rgba(15, 23, 42, .72);
  color: #fff;
  padding: 8px 13px;
  cursor: pointer;
}

/* ============================================================
   toast
   ============================================================ */
.p-toast {
  display: none; position: fixed; top: 74px; right: 26px;
  background: #111827; color: #fff; padding: 11px 17px; border-radius: 10px;
  font-size: 13px; z-index: 200; box-shadow: var(--p-shadow-lg);
  animation: p-toast-in .28s var(--p-ease); border-left: 3px solid var(--p-brand);
}
.p-toast.err { border-left-color: var(--p-bad); }
@keyframes p-toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* attachments */
.p-att-box {
  border: 1px dashed var(--p-border);
  background: rgba(255,255,255,0.68);
  padding: 10px;
  outline: none;
}
.p-att-box:focus {
  border-color: var(--p-brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--p-brand) 16%, transparent);
}
.p-att-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.p-att-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 5px 6px;
  border: 1px solid var(--p-border);
  background: var(--p-surface);
}
.p-att-item a { font-size: 12px; font-weight: 600; max-width: 24em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-att-item .p-muted { font-size: 11px; margin-left: auto; }
.p-att-upload {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.p-att-upload input { max-width: 260px; font-size: 12px; }

#p-md-preview-overlay {
  display: none; position: fixed; inset: 0; z-index: 220;
  background: rgba(17,24,39,0.45); align-items: center; justify-content: center; padding: 24px;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.p-md-preview {
  width: min(900px, 92vw); max-height: 84vh; background: var(--p-paper);
  border: 1px solid var(--p-line-2); border-radius: 14px; box-shadow: var(--p-shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
}
.p-md-preview-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  border-bottom: 1px solid var(--p-line);
}
.p-md-preview-head h4 { margin: 0; flex: 1; font-size: 15px; font-weight: 700; }
.p-md-preview-body { padding: 18px; overflow: auto; font-size: 13px; line-height: 1.7; }
.p-md-preview-body h1, .p-md-preview-body h2, .p-md-preview-body h3,
.p-md-preview-body h4, .p-md-preview-body h5, .p-md-preview-body h6 { margin: 18px 0 8px; line-height: 1.35; }
.p-md-preview-body h1:first-child, .p-md-preview-body h2:first-child, .p-md-preview-body h3:first-child { margin-top: 0; }
.p-md-preview-body p { margin: 0 0 12px; }
.p-md-preview-body ul { margin: 0 0 12px 18px; padding: 0; }
.p-md-preview-body li { margin: 4px 0; }
.p-md-preview-body pre {
  margin: 0 0 12px; padding: 12px 14px; overflow: auto; border-radius: 10px;
  background: #111827; color: #f9fafb;
}
.p-md-preview-body code {
  font-family: var(--p-mono); font-size: 12px; background: #f3f4f6; padding: 1px 5px; border-radius: 6px;
}
.p-md-preview-body pre code { background: transparent; padding: 0; color: inherit; }

/* 状态机操作区 */
.p-action-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.p-action-row button { font-size: 12px; }

/* ============================================================
   表单
   ============================================================ */
.p-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.p-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--p-ink-2); }
.p-form label > span { font-weight: 500; color: var(--p-ink-2); }
.p-form input, .p-form select, .p-form textarea {
  padding: 9px 11px; border: 1px solid var(--p-line-2); border-radius: var(--p-radius-sm); font: inherit; font-size: 13px;
  background: var(--p-paper); color: var(--p-ink); transition: border-color .15s var(--p-ease), box-shadow .15s var(--p-ease);
}
.p-form input:focus, .p-form select:focus, .p-form textarea:focus {
  border-color: var(--p-brand); outline: none; box-shadow: 0 0 0 3px rgba(14,159,110,0.13);
}
.p-form textarea { min-height: 64px; resize: vertical; }
.p-form .full { grid-column: 1 / -1; }
.p-form .span2 { grid-column: 1 / -1; }
.ac-prov-models { display: flex; flex-direction: column; gap: 6px; }
.ac-prov-models-title {
  display: block; margin-bottom: 2px;
  font-weight: 600; color: var(--p-ink);
}
.ac-prov-model-box {
  margin-top: 6px; padding: 14px;
  border: 1px solid var(--p-line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fcfdfd 0%, #f7faf8 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.ac-prov-model-box-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 10px;
}
.ac-prov-model-box-title,
.ac-prov-model-extra-title {
  font-size: 12px; font-weight: 700; color: var(--p-ink-2);
}
.ac-prov-model-extra-title { margin-top: 12px; margin-bottom: 8px; }
.ac-prov-model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.ac-prov-model-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: 54px;
  padding: 14px 14px 12px;
  border: 1px solid var(--p-line-2);
  border-radius: 16px;
  background: var(--p-paper);
  cursor: pointer;
  transition: border-color .15s var(--p-ease), box-shadow .15s var(--p-ease), transform .15s var(--p-ease), background .15s var(--p-ease);
}
.ac-prov-model-card:hover {
  border-color: #c9d3de;
  box-shadow: 0 6px 16px rgba(15,23,42,0.06);
  transform: translateY(-1px);
}
.ac-prov-model-card:has(input:checked) {
  border-color: color-mix(in srgb, var(--p-brand) 45%, #c8f1de);
  background: linear-gradient(180deg, #f3fcf8 0%, #ecfbf5 100%);
  box-shadow: 0 0 0 3px rgba(14,159,110,0.10);
}
.ac-prov-model-card input.ac-prov-ticket-model {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 15px !important;
  min-width: 15px !important;
  height: 15px !important;
  margin: 0;
  padding: 0 !important;
  box-shadow: none !important;
}
.ac-prov-model-name {
  display: block;
  padding-right: 22px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--p-ink);
  word-break: break-word;
}
.ac-prov-model-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.ac-prov-model-btn {
  padding: 5px 10px;
  font-size: 12px;
}
.ac-prov-model-empty {
  margin: 8px 0 4px;
  padding: 12px 14px;
  border: 1px dashed var(--p-line-2);
  border-radius: 12px;
  background: rgba(255,255,255,0.72);
}
#ac-prov-model-extra {
  min-height: 92px;
  line-height: 1.6;
  background: rgba(255,255,255,0.92);
}
.p-secret-input { position: relative; display: flex; align-items: center; }
.p-secret-input input { width: 100%; padding-right: 42px; }
.p-secret-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 6px; background: transparent;
  color: var(--p-ink-3); cursor: pointer; line-height: 1;
}
.p-secret-toggle:hover, .p-secret-toggle.visible { background: var(--p-bg); color: var(--p-ink); }
.p-secret-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.p-ms { position: relative; }
.p-ms-control {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: 42px; padding: 7px 10px;
  border: 1px solid var(--p-line-2); border-radius: var(--p-radius-sm);
  background: var(--p-paper);
  transition: border-color .15s var(--p-ease), box-shadow .15s var(--p-ease);
}
.p-ms.open .p-ms-control, .p-ms:focus-within .p-ms-control {
  border-color: var(--p-brand); box-shadow: 0 0 0 3px rgba(14,159,110,0.13);
}
.p-ms-summary { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.p-ms-chip, .p-ms-count {
  display: inline-flex; align-items: center;
  height: 24px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; line-height: 24px;
}
.p-ms-chip {
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--p-brand-3); color: var(--p-brand-ink); border: 1px solid #bcf0da;
}
.p-ms-count { background: var(--p-bg); color: var(--p-ink-2); }
.p-ms-input {
  flex: 1 1 180px; min-width: 140px;
  border: 0 !important; outline: 0; box-shadow: none !important; padding: 2px 0 !important;
  background: transparent !important;
}
.p-ms-dd {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  max-height: 300px; overflow: auto;
  background: var(--p-paper); border: 1px solid var(--p-line-2); border-radius: 12px;
  box-shadow: var(--p-shadow-lg); padding: 6px;
}
.p-ms-opt {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 10px; border-radius: 8px; cursor: pointer;
  transition: background .12s var(--p-ease);
}
.p-ms-opt:hover { background: var(--p-bg); }
.p-ms-opt.checked { background: #f0fdf4; }
.p-filter-bar .p-ms-opt input,
.p-form .p-ms-opt input {
  width: 16px !important; max-width: 16px; min-width: 16px !important;
  height: 16px !important; padding: 0 !important; margin-top: 2px; flex: 0 0 16px;
  border-radius: 4px; box-shadow: none !important;
}
.p-ms-opt-text {
  flex: 1 1 auto; min-width: 0;
  font-size: 13px; color: var(--p-ink);
  line-height: 1.5; word-break: break-all;
}
.p-ms-empty {
  padding: 16px 10px; text-align: center;
  font-size: 12px; color: var(--p-ink-3);
}
.p-ms-toolbar {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 4px 8px; border-bottom: 1px solid var(--p-line);
  margin-bottom: 4px;
}
.p-ms-mini { font-size: 11px; padding: 3px 8px; }
.p-ms-filter .p-ms-chip { max-width: 120px; }
.p-check-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 6px 10px;
  border: 1px solid var(--p-line-2); border-radius: var(--p-radius-sm); padding: 9px; background: var(--p-bg);
}
.p-check-grid label { display: flex; flex-direction: row; align-items: center; gap: 7px; margin: 0; font-weight: 400; }
.p-drawer-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }

.p-tag {
  display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 500;
  background: #f0f2f5; color: var(--p-ink-2); margin-right: 4px; border: 1px solid var(--p-line-2);
}
.p-site-badge {
  display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 500;
  background: #e1effe; color: #1849a9; border: 1px solid #c3ddfd; margin-left: 6px;
}
code, .p-mono { font-family: var(--p-mono); font-size: 0.92em; color: var(--p-ink-2); }

/* 状态变更弹窗 */
.p-status-panel { display: flex; flex-direction: column; gap: 13px; }
.p-status-panel label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--p-ink-2); }
.p-status-panel select, .p-status-panel input { padding: 10px; border: 1px solid var(--p-line-2); border-radius: var(--p-radius-sm); font: inherit; }

/* 凭证字段 */
.p-cred-field { display: flex; align-items: center; gap: 6px; }
.p-cred-val { font-family: var(--p-mono); font-size: 12px; word-break: break-all; }
.p-vendor-line {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
  word-break: break-all;
}
.p-cred-inline { margin: 6px 0 0; }
.pcred-editor { display: flex; flex-direction: column; gap: 7px; }
.pcred-rows { display: flex; flex-direction: column; gap: 7px; }
.pcred-row { display: flex; align-items: center; gap: 7px; }
.pcred-row .pcred-label { flex: 0 0 32%; font-size: 12px; color: var(--p-ink-2); }
.pcred-row .pcred-k { flex: 0 0 32%; }
.pcred-row .pcred-v { flex: 1 1 auto; }
.pcred-row input, .pcred-row textarea { padding: 7px 10px; border: 1px solid var(--p-line-2); border-radius: var(--p-radius-sm); font: inherit; }
.pcred-row textarea { flex: 1 1 auto; resize: vertical; }
.pcred-row .pcred-del { flex: 0 0 auto; padding: 2px 9px; }

.p-truncate-12em { display: inline-block; max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* 列表过宽文本通用截断单元格：定宽截断 + 省略号，hover 显示完整内容(title) + 出现快捷复制按钮 */
.p-trunc-wrap { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; }
.p-trunc { display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.p-copy-btn { visibility: hidden; flex: 0 0 auto; font-size: 10px; padding: 1px 4px; line-height: 1; }
.p-trunc-wrap:hover .p-copy-btn { visibility: visible; }

/* 测试执行面板 */
.p-test-panel { display: flex; flex-direction: column; gap: 5px; }
.p-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 16px; }
.p-grid-2 label,
.p-test-panel > .p-section > label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--p-ink-2); margin-top: 6px; }
.p-grid-2 select, .p-grid-2 input,
.p-test-panel select, .p-test-panel input { padding: 9px 11px; border: 1px solid var(--p-line-2); border-radius: var(--p-radius-sm); font: inherit; }
.p-att-list { list-style: none; margin: 0; padding: 0; }
.p-att-list li { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 12px; }

/* ============================================================
   stepper
   ============================================================ */
.p-stepper { display: flex; align-items: flex-start; gap: 0; padding: 14px 4px 6px; margin-bottom: 4px; }
.p-step { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 0 0 auto; }
.p-step-dot { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--p-line-2); background: var(--p-paper); transition: all .25s var(--p-ease); }
.p-step-label { font-size: 11px; color: var(--p-ink-3); white-space: nowrap; transition: color .25s var(--p-ease); }
.p-step-line { flex: 1 1 auto; height: 2px; background: var(--p-line-2); margin: 7px 5px 0; border-radius: 2px; }
.p-step.done .p-step-dot { border-color: var(--p-brand); background: var(--p-brand); }
.p-step.done .p-step-label { color: var(--p-ink-2); }
.p-step.active .p-step-dot { border-color: var(--p-brand); background: var(--p-brand); box-shadow: 0 0 0 4px rgba(14,159,110,0.16); }
.p-step.active .p-step-label { color: var(--p-ink); font-weight: 600; }
.p-step.bad .p-step-dot { border-color: var(--p-bad); background: var(--p-bad); box-shadow: 0 0 0 4px rgba(224,36,36,0.16); }
.p-step.bad .p-step-label { color: var(--p-bad); font-weight: 600; }
.p-step-bad-note { font-size: 12px; color: var(--p-bad); margin: 2px 4px 6px; }
.p-next-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 12px; padding: 0 4px; }
.p-next-btn { font-size: 12px; padding: 5px 12px; }
.p-next-danger { color: var(--p-bad); border-color: #fbd5d5; }
.p-next-danger:hover { background: var(--p-bad); color: #fff; border-color: var(--p-bad); }

/* 时间线 */
.p-timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.p-tl-item { position: relative; padding: 0 0 16px 20px; border-left: 2px solid var(--p-line-2); }
.p-tl-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.p-tl-dot { position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--p-brand); border: 2px solid var(--p-paper); box-shadow: 0 0 0 1px var(--p-line-2); }
.p-tl-item.bad .p-tl-dot { background: var(--p-bad); }
.p-tl-head { font-size: 13px; color: var(--p-ink); }
.p-tl-meta { font-size: 11px; color: var(--p-ink-3); margin-top: 2px; }
.p-tl-src { font-size: 10px; padding: 1px 7px; border-radius: 10px; background: var(--p-bg); color: var(--p-ink-3); border: 1px solid var(--p-line-2); margin-left: 4px; }
.p-tl-src.auto { color: var(--p-brand-2); border-color: #bcf0da; background: var(--p-brand-3); }

/* ============================================================
   骨架屏 / 空态
   ============================================================ */
.p-skeleton { display: inline-block; height: 0.95em; width: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--p-bg-2) 25%, #f4f5f7 50%, var(--p-bg-2) 75%); background-size: 200% 100%; animation: p-shimmer 1.3s infinite linear; }
@keyframes p-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.p-empty { text-align: center; padding: 44px 20px; color: var(--p-ink-3); }
.p-empty-icon { font-size: 30px; opacity: .5; margin-bottom: 8px; }

/* ============================================================
   分页(页码按钮式)
   ============================================================ */
#p-pager { padding: 14px 4px 0; }
.p-pageno { display: inline-flex; align-items: center; gap: 4px; }
.p-pageno button {
  min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--p-line-2);
  background: var(--p-paper); color: var(--p-ink-2); border-radius: var(--p-radius-sm);
  font: inherit; font-size: 13px; cursor: pointer; transition: all .13s var(--p-ease);
}
.p-pageno button:hover:not(:disabled):not(.active) { border-color: var(--p-brand); color: var(--p-brand-2); }
.p-pageno button.active { background: var(--p-brand); border-color: var(--p-brand); color: #fff; font-weight: 600; cursor: default; }
.p-pageno button:disabled { opacity: .45; cursor: not-allowed; }
.p-pageno .p-pdots { min-width: 24px; text-align: center; color: var(--p-ink-3); }
#p-pager select { padding: 6px 28px 6px 10px; border: 1px solid var(--p-line-2); border-radius: var(--p-radius-sm); font: inherit; font-size: 13px; background: var(--p-paper); -webkit-appearance: none; appearance: none; background-image: var(--p-chevron); background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; }
#p-pager input.p-goto { width: 52px; padding: 6px 8px; border: 1px solid var(--p-line-2); border-radius: var(--p-radius-sm); font: inherit; font-size: 13px; text-align: center; }
#p-pager input.p-goto:focus { border-color: var(--p-brand); outline: none; box-shadow: 0 0 0 3px rgba(14,159,110,0.13); }

/* ============================================================
   总览工作台
   ============================================================ */
.p-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.p-hero h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.p-hero .p-hero-sub { color: var(--p-ink-3); font-size: 13px; margin-top: 7px; }
.p-hero-right { display: flex; align-items: center; gap: 10px; }
.p-seg { display: inline-flex; background: var(--p-bg-2); border-radius: 10px; padding: 3px; gap: 2px; }
.p-seg button { border: none; background: transparent; color: var(--p-ink-2); font: inherit; font-size: 13px; padding: 6px 16px; border-radius: 8px; cursor: pointer; transition: all .15s var(--p-ease); }
.p-seg button.active { background: var(--p-paper); color: var(--p-brand-2); font-weight: 600; box-shadow: var(--p-shadow-sm); }

.p-section-title { font-size: 15px; font-weight: 700; color: var(--p-ink); margin: 28px 0 14px; display: flex; align-items: center; gap: 9px; }
.p-section-title::after { content: ''; flex: 1; height: 1px; background: var(--p-line-2); }
.p-section-title .p-st-count { font-size: 12px; color: var(--p-ink-3); font-weight: 400; }

/* 总览 KPI(沿用旧 .p-cards 名) */
.p-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 24px; }
.p-card { position: relative; background: var(--p-paper); border: 1px solid var(--p-line); border-radius: var(--p-radius); padding: 17px 18px; box-shadow: var(--p-shadow-sm); transition: transform .2s var(--p-ease), box-shadow .2s var(--p-ease); overflow: hidden; }
.p-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--p-line-2); transition: background .2s var(--p-ease); }
.p-card-label { font-size: 12px; color: var(--p-ink-3); margin-bottom: 8px; }
.p-card-value { font-size: 28px; font-weight: 700; line-height: 1.05; letter-spacing: -0.01em; color: var(--p-ink); font-variant-numeric: tabular-nums; }
.p-card-sub { font-size: 12px; color: var(--p-ink-3); margin-top: 5px; }
a.p-card { color: inherit; } a.p-card:hover { text-decoration: none; }
.p-card:hover { transform: translateY(-3px); box-shadow: var(--p-shadow-md); }
.p-card.success::before { background: var(--p-ok); } .p-card.warn::before { background: var(--p-warn); } .p-card.danger::before { background: var(--p-bad); }
.p-card.success .p-card-value { color: var(--p-ok); } .p-card.warn .p-card-value { color: var(--p-warn); } .p-card.danger .p-card-value { color: var(--p-bad); }

.p-attn { display: grid; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr)); gap: 14px; }
.p-attn-card { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; background: var(--p-paper); border: 1px solid var(--p-line); border-radius: var(--p-radius); padding: 16px 18px; box-shadow: var(--p-shadow-sm); transition: transform .2s var(--p-ease), box-shadow .2s var(--p-ease), border-color .2s var(--p-ease); }
.p-attn-card:hover { transform: translateY(-3px); box-shadow: var(--p-shadow-md); text-decoration: none; }
.p-attn-num { font-size: 30px; font-weight: 700; line-height: 1; min-width: 1.4em; font-variant-numeric: tabular-nums; }
.p-attn-body { display: flex; flex-direction: column; gap: 2px; }
.p-attn-label { font-size: 13.5px; font-weight: 600; color: var(--p-ink); }
.p-attn-hint { font-size: 11.5px; color: var(--p-ink-3); }
.p-attn-card .p-arrow { margin-left: auto; color: var(--p-ink-3); font-size: 18px; transition: transform .2s var(--p-ease); }
.p-attn-card:hover .p-arrow { transform: translateX(3px); color: var(--p-brand); }
.p-attn-card.warn { border-color: #fce96a99; } .p-attn-card.warn .p-attn-num { color: var(--p-warn); }
.p-attn-card.danger { border-color: #fbd5d5; } .p-attn-card.danger .p-attn-num { color: var(--p-bad); }
.p-attn-card.calm .p-attn-num { color: var(--p-ok); }
.p-attn-empty { grid-column: 1 / -1; text-align: center; padding: 28px; color: var(--p-ink-3); background: var(--p-paper); border: 1px dashed var(--p-line-2); border-radius: var(--p-radius); }

.p-nav-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(236px, 1fr)); gap: 14px; }
.p-nav-card { display: block; text-decoration: none; color: inherit; position: relative; background: var(--p-paper); border: 1px solid var(--p-line); border-radius: var(--p-radius); padding: 18px; box-shadow: var(--p-shadow-sm); transition: transform .2s var(--p-ease), box-shadow .2s var(--p-ease), border-color .2s var(--p-ease); overflow: hidden; }
.p-nav-card:hover { transform: translateY(-3px); box-shadow: var(--p-shadow-md); border-color: #bcf0da; text-decoration: none; }
.p-nav-card .p-nav-ttl { font-size: 16px; font-weight: 700; color: var(--p-ink); display: flex; align-items: center; gap: 8px; }
.p-nav-card .p-nav-ttl .p-arrow { margin-left: auto; color: var(--p-ink-3); transition: transform .2s var(--p-ease); }
.p-nav-card:hover .p-nav-ttl .p-arrow { transform: translateX(3px); color: var(--p-brand); }
.p-nav-card .p-nav-desc { font-size: 12px; color: var(--p-ink-3); margin-top: 7px; line-height: 1.5; }

/* 载入 stagger */
.p-stagger > * { animation: p-rise .42s var(--p-ease) both; }
.p-stagger > *:nth-child(1) { animation-delay: .02s; } .p-stagger > *:nth-child(2) { animation-delay: .06s; }
.p-stagger > *:nth-child(3) { animation-delay: .10s; } .p-stagger > *:nth-child(4) { animation-delay: .14s; }
.p-stagger > *:nth-child(5) { animation-delay: .18s; } .p-stagger > *:nth-child(6) { animation-delay: .22s; }
.p-stagger > *:nth-child(7) { animation-delay: .26s; } .p-stagger > *:nth-child(8) { animation-delay: .30s; }
.p-stagger > *:nth-child(n+9) { animation-delay: .34s; }

/* ============================================================
   报表 / 分析页
   ============================================================ */
.p-report-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.p-report-tab {
  border: 1px solid var(--p-line-2); background: var(--p-paper); color: var(--p-ink-2);
  border-radius: var(--p-radius-sm); padding: 8px 12px; font: inherit; font-size: 13px;
  cursor: pointer; transition: all .15s var(--p-ease);
}
.p-report-tab:hover { border-color: var(--p-brand); color: var(--p-brand-2); background: var(--p-brand-3); }
.p-report-tab.active { background: var(--p-brand); color: #fff; border-color: var(--p-brand); }
.p-report-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px; margin: 0 0 16px;
}
.p-report-summary .p-kpi-card { padding: 14px 16px; min-height: 78px; }
.p-report-summary .p-kpi-value { font-size: 24px; }
.p-report-type { font-size: 20px; font-weight: 700; color: var(--p-ink); line-height: 1.1; }
.p-report-table-wrap {
  background: var(--p-paper); border: 1px solid var(--p-line); border-radius: var(--p-radius);
  box-shadow: var(--p-shadow-sm); padding: 12px; margin-bottom: 16px; overflow: auto;
}
#report-helper {
  overflow: visible;
  position: relative;
  z-index: 6;
}
.p-report-table th, .p-report-table td { white-space: nowrap; font-size: 12px; }
.p-report-tags { display: flex; flex-wrap: wrap; gap: 4px; min-width: 180px; max-width: 420px; }
.p-report-tags span {
  display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--p-line-2);
  background: var(--p-bg); border-radius: 999px; padding: 2px 7px; color: var(--p-ink-2);
}
.p-report-tags b { color: var(--p-ink); font-weight: 650; }

/* ============================================================
   采购运营大屏
   ============================================================ */
.p-container.p-ops {
  max-width: 1560px;
  padding-top: 18px;
}
.p-ops {
  color: #172236;
}
.p-ops::before {
  content: "";
  position: fixed;
  inset: 58px 0 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, #f8fbff 0%, #f4f7fb 42%, #f2f5f9 100%);
}
.p-ops .p-hero {
  margin-bottom: 14px;
  padding: 0;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.p-ops-hero > div:first-child {
  position: relative;
  padding-left: 58px;
}
.p-ops-hero > div:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #e6f0ff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 6h15l-1.7 8.2a2 2 0 0 1-2 1.6H8.1a2 2 0 0 1-2-1.7L4.8 4H3'/%3E%3Ccircle cx='9' cy='20' r='1.4'/%3E%3Ccircle cx='17' cy='20' r='1.4'/%3E%3C/svg%3E") center / 25px no-repeat;
  box-shadow: 0 8px 22px rgba(37,99,235,0.16);
}
.p-ops .p-hero h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  color: #172236;
  letter-spacing: 0;
}
.p-ops .p-hero-sub {
  margin-top: 3px;
  color: #64748b;
  font-size: 13px;
}
.p-ops .p-hero-right {
  display: flex;
  gap: 10px;
  align-items: center;
}
.p-ops .p-hero-right button {
  min-height: 38px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.p-ops-action-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.p-ops-action-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.p-ops .p-hero-right .btn-ghost {
  background: rgba(255,255,255,0.82);
  border-color: #e6ebf2;
  color: #223044;
}
.p-ops .p-hero-right .btn-primary {
  background: #2563eb;
  border-color: #2563eb;
  box-shadow: 0 10px 24px rgba(37,99,235,0.24);
}
.p-ops-filter {
  padding: 14px 18px;
  margin-bottom: 12px;
  border-color: #e8edf4;
  border-radius: 10px;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 8px 28px rgba(15,23,42,0.05);
}
.p-ops-filter .p-filter-fields {
  align-items: flex-end;
  gap: 12px 18px;
}
.p-ops-filter label {
  color: #526071;
  font-size: 12px;
  font-weight: 650;
  gap: 5px;
}
.p-ops-filter input,
.p-ops-filter select,
.p-ops-filter .p-ms-control {
  height: 38px;
  min-height: 38px;
  border-radius: 8px;
  border-color: #dbe3ed;
  background-color: #fff;
}
.p-ops-filter input,
.p-ops-filter select {
  padding-top: 7px;
  padding-bottom: 7px;
}
.p-ops-filter .p-ms-control {
  flex-wrap: nowrap;
  align-content: center;
  padding: 6px 10px;
  overflow: hidden;
}
.p-ops-filter .p-ms-summary {
  flex: none;
  flex-wrap: nowrap;
  max-width: 126px;
  overflow: hidden;
}
.p-ops-filter .p-ms-chip,
.p-ops-filter .p-ms-count {
  height: 22px;
  line-height: 22px;
  padding: 0 7px;
}
.p-ops-filter .p-ms-input {
  flex: 1 1 auto;
  min-width: 80px;
  height: 24px;
  min-height: 0;
  line-height: 24px;
}
.p-ops-series-ms { width: min(260px, 100%); }
.p-ops-filter #od-supplier { min-width: 230px; }
.p-ops-kpis {
  grid-template-columns: repeat(8, minmax(118px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.p-ops-kpis .p-kpi-card {
  text-align: left;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 82px;
  padding: 14px 12px;
  border: 1px solid #edf1f6;
  border-radius: 10px;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 7px 22px rgba(15,23,42,0.045);
  cursor: pointer;
  transform: none;
}
.p-ops-kpi:hover {
  border-color: #b9c9e8;
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(15,23,42,0.075);
}
.p-ops-kpi-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.p-ops-kpi-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.p-ops-kpi-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.p-ops-kpi .p-kpi-label {
  font-size: 12px;
  color: #66758a;
  white-space: normal;
  line-height: 1.25;
}
.p-ops-kpi .p-kpi-value {
  font-size: 23px;
  color: #172236;
  font-family: var(--p-mono);
}
.p-ops-kpi.blue .p-ops-kpi-icon { background: #e8f0ff; color: #2563eb; }
.p-ops-kpi.cyan .p-ops-kpi-icon { background: #e5f6ff; color: #0284c7; }
.p-ops-kpi.green .p-ops-kpi-icon { background: #e5f8ed; color: #0f9f6e; }
.p-ops-kpi.teal .p-ops-kpi-icon { background: #e1f7fb; color: #0891b2; }
.p-ops-kpi.indigo .p-ops-kpi-icon { background: #e8edff; color: #4f46e5; }
.p-ops-kpi.sky .p-ops-kpi-icon { background: #e7f4ff; color: #0ea5e9; }
.p-ops-kpi.orange .p-ops-kpi-icon { background: #fff1df; color: #f97316; }
.p-ops-kpi.pink .p-ops-kpi-icon { background: #fce7f3; color: #c026d3; }
.p-ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}
.p-ops-panel {
  min-width: 0;
  border-color: #e8edf4;
  border-radius: 10px;
  padding: 16px 18px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 8px 28px rgba(15,23,42,0.05);
}
.p-ops-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 12px;
}
.p-ops-panel-head h3 {
  margin: 0;
  font-size: 16px;
  color: #172236;
  letter-spacing: 0;
}
.p-ops-panel-head .p-muted {
  font-size: 12px;
}
.p-ops-chart { height: 316px; min-width: 0; }
.p-ops-tree {
  height: 330px;
  border: 1px solid #e8edf4;
  border-radius: 10px;
  background: #fff;
}
.p-ops-relation-filter {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid #edf1f6;
  border-radius: 8px;
  background: #f8fbff;
}
.p-ops-relation-filter .p-filter-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: flex-end;
  flex: 1;
}
.p-ops-relation-filter label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 180px;
  color: #526071;
  font-size: 12px;
  font-weight: 650;
}
.p-ops-relation-filter .p-ms-control {
  height: 36px;
  min-height: 36px;
  flex-wrap: nowrap;
  overflow: hidden;
  background: #fff;
}
.p-ops-relation-filter .p-ms-input {
  min-width: 76px;
}
.p-ops-relation-tree {
  height: 420px;
  min-width: 980px;
  border: 1px solid #e8edf4;
  border-radius: 10px;
  background: #fff;
}
.p-ops-mini-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.p-ops-mini-kpis button {
  border: 1px solid #edf1f6;
  border-radius: 8px;
  background: #f8fbff;
  padding: 9px 11px;
  text-align: left;
  cursor: pointer;
}
.p-ops-mini-kpis button:hover { border-color: #bfd0ed; background: #fff; }
.p-ops-mini-kpis b {
  display: block;
  font-family: var(--p-mono);
  font-size: 19px;
  color: #172236;
}
.p-ops-mini-kpis span {
  display: block;
  font-size: 12px;
  color: #66758a;
}
.p-ops-supplier-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 245px;
  gap: 14px;
}
.p-ops-side {
  border-left: 1px solid #e7edf4;
  padding-left: 14px;
  min-width: 0;
}
.p-ops-side h4 { margin: 12px 0 8px; font-size: 13px; }
.p-ops-side-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #edf1f6;
  border-radius: 8px;
  background: #f8fbff;
}
.p-ops-side-card b {
  font-family: var(--p-mono);
  font-size: 24px;
  line-height: 1;
}
.p-ops-side-card small { color: var(--p-ink-3); }
.p-ops-linknum {
  border: 0;
  background: transparent;
  color: #2563eb;
  font: inherit;
  font-family: var(--p-mono);
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 6px;
  cursor: pointer;
}
.p-ops-linknum:hover {
  background: #e8f0ff;
}
.p-ops-channel-tags {
  max-width: none;
  gap: 6px;
  min-width: 360px;
}
.p-ops-channel-tags .p-ops-channel-tag {
  gap: 6px;
  max-width: 340px;
  padding: 3px 9px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.p-ops-channel-tag b {
  font-weight: 650;
  flex: none;
}
.p-ops-channel-tag.enabled {
  background: #dcfce7;
  color: #047857;
  border-color: #b7ebcb;
}
.p-ops-channel-tag.disabled {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}
.p-ops-channel-tag.stopped {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}
.p-ops-channel-tag.warn {
  background: #fff7d6;
  color: #b77900;
  border-color: #fde68a;
}
.p-ops-channel-tag.muted {
  background: #f1f5f9;
  color: #64748b;
  border-color: #dbe3ed;
}
.p-ops-status-tags span.danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}
.p-ops-status-tags span.danger b {
  color: #991b1b;
}
.p-ops-series-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.p-ops-series-badge span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  font-size: 10px;
  font-family: var(--p-mono);
  color: #172236;
  background: linear-gradient(135deg, #ffd4a8, #c98b67);
  border: 1px solid rgba(111,78,55,0.16);
}
.p-ops-series-badge b {
  font-weight: 700;
  color: #172236;
}
#od-summary-table {
  max-width: 100%;
  overflow: auto;
}
#od-summary-table .p-table {
  width: max-content;
  min-width: 100%;
  border-color: #e8edf4;
  border-radius: 9px;
  box-shadow: none;
}
#od-summary-table .p-table th,
#od-summary-table .p-table td {
  padding: 10px 12px;
  font-size: 12.5px;
}
#od-summary-table .p-table th {
  background: #f8fafc;
  color: #526071;
}
#od-summary-table .p-table tbody tr:hover td {
  background: #f8fbff;
}

@media (max-width: 980px) {
  .p-ops-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .p-ops-grid,
  .p-ops-supplier-grid {
    grid-template-columns: 1fr;
  }
  .p-ops-side {
    border-left: 0;
    border-top: 1px solid var(--p-line);
    padding: 12px 0 0;
  }
  .p-ops-mini-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .p-ops-hero > div:first-child {
    padding-left: 0;
  }
  .p-ops-hero > div:first-child::before {
    display: none;
  }
}

@media (max-width: 640px) {
  .p-topbar {
    padding: 0 10px;
    gap: 8px;
    min-height: 60px;
    align-items: center;
  }
  .p-topbar h1 small,
  .p-nav {
    display: none;
  }
  .p-top-actions {
    flex: none;
    gap: 2px;
  }
  .p-userbox-btn {
    width: 36px;
    height: 36px;
    padding: 5px;
  }
  #p-user-name,
  .p-userbox-btn .p-uchev {
    display: none;
  }
}
.rm-channel-tree {
  min-width: 260px;
  max-width: 520px;
  display: grid;
  gap: 6px;
  padding: 2px 0;
}
.rm-channel-priority {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.rm-channel-priority-axis {
  display: grid;
  justify-items: center;
  gap: 4px;
}
.rm-channel-priority-label {
  position: relative;
  min-width: 34px;
  height: 24px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border-radius: 999px;
  background: var(--p-brand-3);
  color: var(--p-brand-ink);
  border: 1px solid rgba(14,159,110,0.22);
  font: 650 11px/1 var(--p-mono);
  white-space: nowrap;
}
.rm-priority-arrow {
  height: 20px;
  color: var(--p-danger);
  font: 700 15px/20px var(--p-mono);
  text-align: center;
}
.rm-channel-branch {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 12px;
}
.rm-channel-branch::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  bottom: 11px;
  width: 1px;
  background: var(--p-line-2);
}
.rm-channel-node {
  position: relative;
  display: grid;
  grid-template-rows: 16px 16px 14px 14px 13px;
  gap: 1px;
  width: 148px;
  height: 88px;
  padding: 5px 8px;
  border: 1px solid var(--p-line-2);
  border-radius: 9px;
  background: linear-gradient(180deg, #fff 0%, var(--p-bg) 100%);
  box-shadow: 0 1px 2px rgba(16,24,40,0.04);
  overflow: hidden;
}
.rm-channel-node.rm-channel-warning {
  border-color: #facc15;
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
}
.rm-channel-node.rm-channel-danger {
  border-color: #fca5a5;
  background: linear-gradient(180deg, #fff1f2 0%, #fee2e2 100%);
}
.rm-channel-node.rm-channel-disabled {
  border-color: #d1d5db;
  background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
  opacity: 0.7;
}
.rm-channel-status-badge {
  font-size: 9px;
  line-height: 1;
  padding: 1px 4px;
  border-radius: 3px;
  flex: none;
}
.rm-hide-disabled .rm-channel-disabled {
  display: none;
}
.procure-routing-topology.rm-hide-disabled .rm-channel-disabled {
  display: none;
}
.rm-toggle-disabled {
  display: inline-block;
  margin-bottom: 4px;
  padding: 1px 6px;
  border: 1px dashed var(--p-line-2);
  border-radius: 3px;
  background: transparent;
  color: var(--p-ink-3);
  font-size: 10px;
  cursor: pointer;
  white-space: nowrap;
}
.rm-toggle-disabled:hover {
  color: var(--p-brand-2);
  border-color: var(--p-brand-2);
}
.rm-th-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 400;
  color: var(--p-ink-3);
  cursor: pointer;
  vertical-align: middle;
}
.rm-th-checkbox input[type="checkbox"] {
  width: 13px;
  height: 13px;
  margin: 0;
  cursor: pointer;
}
.rm-channel-node::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  width: 12px;
  height: 1px;
  background: var(--p-line-2);
}
.rm-channel-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.rm-channel-link {
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--p-ink-2);
  font: 600 11px/1.2 var(--p-mono);
  cursor: pointer;
  text-align: left;
}
.rm-channel-link:hover { color: var(--p-brand-2); text-decoration: underline; text-underline-offset: 2px; }
.rm-channel-weight {
  flex: none;
  color: var(--p-ink-3);
  font: 500 10px/1.2 var(--p-mono);
}
.rm-channel-cost {
  color: var(--p-ink);
  font: 700 11px/1.2 var(--p-mono);
  text-align: right;
  flex: none;
}
.rm-channel-availability {
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  padding: 1px 5px;
  border-radius: 999px;
  font: 650 9.5px/1.1 var(--p-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rm-availability-success {
  color: #047857;
  background: #d1fae5;
}
.rm-availability-warning {
  color: #92400e;
  background: #fde68a;
}
.rm-availability-danger {
  color: #b91c1c;
  background: #fecaca;
}
.rm-channel-availability-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
}
.rm-channel-cost-notice {
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  padding: 1px 5px;
  border-radius: 4px;
  font: 650 9.5px/1.1 var(--p-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rm-channel-supplier,
.rm-channel-resource,
.rm-channel-attrs {
  min-width: 0;
  color: var(--p-ink-3);
  font-size: 10.5px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rm-channel-supplier { color: var(--p-ink-2); }
.rm-channel-resource { font: 500 10px/1.25 var(--p-mono); }
.rm-channel-resource a { color: inherit; text-decoration: none; }
.rm-channel-resource a:hover { color: var(--p-brand-2); text-decoration: underline; text-underline-offset: 2px; }
.procure-routing-tree {
  max-width: none;
}
.resource-monitor-page .rm-channel-tree {
  max-width: 100%;
  min-width: 560px;
}
.resource-monitor-page .rm-channel-branch {
  gap: 8px;
}
.resource-monitor-page #rm-table .p-report-table th:last-child,
.resource-monitor-page #rm-table .p-report-table td:last-child {
  min-width: 580px;
  width: 580px;
  vertical-align: top;
}
.resource-monitor-page .rm-channel-node {
  grid-template-rows: minmax(17px, auto) minmax(18px, auto) minmax(16px, auto) minmax(15px, auto) minmax(15px, auto);
  gap: 3px;
  width: 178px;
  min-height: 112px;
  height: auto;
  padding: 7px 10px 10px;
}
.resource-monitor-page .rm-channel-node.rm-channel-active {
  border-color: rgba(34, 197, 94, .38);
  box-shadow:
    0 0 0 1px rgba(34, 197, 94, .55),
    0 0 14px rgba(34, 197, 94, .22),
    0 0 28px rgba(34, 197, 94, .12),
    0 1px 2px rgba(16,24,40,0.04);
}
.resource-monitor-page .rm-channel-node.rm-channel-disabled {
  border-color: rgba(239, 68, 68, .34);
  background: linear-gradient(180deg, #fff7f7 0%, #fff1f2 100%);
  box-shadow:
    0 0 0 1px rgba(239, 68, 68, .5),
    0 0 14px rgba(239, 68, 68, .18),
    0 0 28px rgba(239, 68, 68, .1),
    0 1px 2px rgba(16,24,40,0.04);
}
.resource-monitor-page .rm-channel-link {
  font-size: 12px;
}
.resource-monitor-page .rm-channel-weight {
  font-size: 10px;
}
.resource-monitor-page .rm-channel-supplier,
.resource-monitor-page .rm-channel-cost {
  font-size: 11px;
}
.resource-monitor-page .rm-channel-resource,
.resource-monitor-page .rm-channel-attrs {
  line-height: 1.3;
}
.resource-monitor-page .rm-channel-resource {
  font-size: 11px;
}
.resource-monitor-page .rm-channel-attrs {
  min-height: 15px;
}
.resource-monitor-page .rm-channel-attrs .pbadge {
  padding: 1px 5px;
  font-size: 9px;
  line-height: 1.1;
}
.resource-monitor-page .rm-channel-availability {
  min-height: 16px;
  padding-bottom: 1px;
}
.rm-resource-line {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}
.rm-resource-link {
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rm-resource-link:hover {
  color: var(--p-brand-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rm-tag {
  position: relative;
  z-index: 2;
  display: inline-block;
  padding: 1px 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.96);
  font-size: 10px; line-height: 1;
  color: var(--p-brand-2); white-space: nowrap;
}
.rm-tag::before { content: '#'; margin-right: 1px; opacity: .6; }
.rm-channel-attrs { font-size: 10px; }
.rm-status-action {
  border: 1px solid currentColor;
  cursor: pointer;
  font: inherit;
}
.rm-alert-hot {
  background: #fde2e2;
  color: #b91c1c;
  border-color: #f9a8a8;
  font-weight: 750;
}
.rm-alert-level {
  margin-left: 4px;
  font-size: 11px;
}

.p-report-routing-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid var(--p-line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f8fafc);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .04);
}
.p-routing-drawer .p-report-routing-toolbar {
  margin-bottom: 18px;
  padding: 18px 20px;
}
.p-report-routing-toolbar label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--p-ink-2);
}
.p-report-routing-toolbar select {
  min-width: 220px;
  height: 40px;
  border-radius: 6px;
  border: 1px solid var(--p-line-2);
  background: var(--p-paper);
  color: var(--p-ink);
  font: 650 14px/1.2 var(--p-font);
}
.p-report-routing-meta {
  margin-left: auto;
  color: var(--p-ink-2);
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}
.p-report-routing-group-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--p-brand);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.p-report-routing-group-btn:hover {
  color: var(--p-brand-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rm-level-minor {
  background: #fff7d6;
  color: #8a5a00;
  border-color: #fde68a;
}
.rm-level-major {
  background: #ffedd5;
  color: #b45309;
  border-color: #fdba74;
}
.rm-level-critical {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
  font-weight: 750;
}
.procure-routing-topology {
  width: 100%;
  box-sizing: border-box;
  min-width: 980px;
  max-width: none;
  min-height: 620px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  border: 1px solid var(--p-line);
  border-radius: 12px;
  background: var(--p-paper);
  overflow: auto;
}
.prt-rail {
  position: sticky;
  left: 0;
  z-index: 2;
  padding: 20px 12px 24px;
  border-right: 1px solid var(--p-line);
  background: rgba(255, 255, 255, .95);
}
.prt-rail-head {
  margin-bottom: 16px;
  color: var(--p-ink-2);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}
.prt-rail-line {
  position: absolute;
  top: 68px;
  bottom: 88px;
  left: 50%;
  width: 1px;
  background: #d9e1ea;
}
.prt-rail-level {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 8px;
  align-content: start;
  min-height: 182px;
}
.prt-rail-level span {
  display: inline-flex;
  min-width: 48px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ccfbf1;
  color: #0f766e;
  font-size: 14px;
  font-weight: 800;
}
.prt-rail-level em {
  color: var(--p-ink-3);
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
}
.prt-rail-level::before,
.prt-rail-level::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: var(--p-paper);
}
.prt-rail-level::before { top: 46px; }
.prt-rail-level::after { bottom: 26px; }
.prt-map {
  min-width: 0;
  padding: 12px 28px 34px 26px;
}
.prt-map-tools {
  min-height: 28px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 4px;
}
.prt-toggle {
  border-radius: 999px;
  background: #fff7ed;
  color: #b45309;
}
.prt-layer {
  position: relative;
  min-height: 182px;
}
.prt-layer + .prt-layer { margin-top: 0; }
.prt-layer-label {
  display: none;
}
.prt-layer-branch {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 0 22px 34px;
}
.prt-layer-branch::before {
  content: '';
  position: absolute;
  top: 32px;
  left: 0;
  right: 40px;
  height: 1px;
  background: #cbd5e1;
  z-index: 0;
}
.prt-layer-single .prt-layer-branch::before {
  right: auto;
  width: 34px;
}
.prt-layer-branch .rm-channel-node {
  position: relative;
  z-index: 1;
}
.prt-layer-branch .rm-channel-node::before {
  content: '';
  position: absolute;
  top: -16px;
  left: 50%;
  width: 1px;
  height: 16px;
  background: #cbd5e1;
  z-index: 0;
}
.procure-routing-topology .rm-channel-node {
  width: 220px;
  height: 138px;
  min-height: 138px;
  display: grid;
  grid-template-rows: 20px 22px 22px 28px 20px;
  gap: 3px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #d8e0ea;
  background: var(--p-paper);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
  overflow: hidden;
}
.procure-routing-topology .rm-channel-active {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, .12), 0 10px 24px rgba(34, 197, 94, .08);
}
.procure-routing-topology .rm-channel-primary {
  width: 254px;
  height: 144px;
  min-height: 144px;
  border-color: #14b8a6;
  box-shadow: 0 0 0 1px rgba(20, 184, 166, .35), 0 18px 34px rgba(20, 184, 166, .16);
}
.procure-routing-topology .rm-channel-disabled {
  border-color: #ef4444;
  background: linear-gradient(180deg, #fff7f7 0%, #fff1f2 100%);
  opacity: .58;
  border-style: solid;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, .12), 0 10px 24px rgba(239, 68, 68, .05);
}
.procure-routing-topology .rm-channel-top {
  align-items: start;
}
.procure-routing-topology .rm-channel-link {
  color: var(--p-ink);
  font-size: 15px;
  font-weight: 850;
  text-decoration: none;
}
.procure-routing-topology .rm-channel-weight {
  margin-left: auto;
  color: #94a3b8;
  font: 750 10px/1.1 var(--p-mono);
  letter-spacing: .02em;
}
.procure-routing-topology .rm-channel-supplier {
  min-width: 0;
  overflow: hidden;
  color: var(--p-ink);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.procure-routing-topology .rm-channel-cost {
  color: var(--p-ink);
  font-size: 15px;
  font-weight: 850;
}
.procure-routing-topology .rm-channel-resource {
  position: relative;
  z-index: 2;
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.procure-routing-topology .rm-channel-attrs {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  color: var(--p-ink-3);
}
.procure-routing-topology .rm-channel-availability {
  position: relative;
  z-index: 2;
  align-self: start;
  justify-self: start;
}
.procure-routing-topology .pbadge,
.procure-routing-topology .rm-channel-availability,
.procure-routing-topology .rm-channel-status-badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rm-status-action:hover {
  filter: brightness(.98);
  transform: translateY(-1px);
}
.rm-cost-stats {
  min-width: 118px;
  max-width: 160px;
  display: grid;
  gap: 4px;
  color: var(--p-ink-2);
}
.rm-cost-row {
  display: grid;
  grid-template-columns: max-content max-content max-content;
  column-gap: 1ch;
  align-items: center;
}
.rm-cost-gap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rm-cost-stats span,
.rm-cost-gap span {
  color: var(--p-ink-3);
  font-size: 11px;
}
.rm-cost-stats b,
.rm-cost-gap b {
  color: var(--p-ink);
  font: 700 11px/1.15 var(--p-mono);
}
.rm-cost-stats em {
  color: var(--p-ink-3);
  font: 500 9.5px/1.1 var(--p-mono);
  font-style: normal;
}
.rm-cost-gap {
  min-width: 86px;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.rm-cost-gap.rm-gap-hot b {
  color: #b91c1c;
  font-weight: 800;
}
.rm-cost-gap.rm-gap-hot span {
  color: #dc2626;
  font-weight: 650;
}
.rm-alert-snapshot {
  min-width: 180px;
  display: grid;
  gap: 4px;
  color: var(--p-ink-2);
  font-size: 11.5px;
}
.rm-alert-snapshot > div:nth-child(2) {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.rm-alert-snapshot-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--p-ink-2);
  font: 600 10px/1.4 var(--p-mono);
  white-space: nowrap;
}
.rm-alert-snapshot small {
  color: var(--p-ink-3);
  font-size: 10.5px;
}
.rm-trend-warning {
  color: #b91c1c;
  font-weight: 800;
}
.rm-resource-info {
  min-width: 150px;
  display: grid;
  gap: 4px;
  color: var(--p-ink);
  font-weight: 650;
}
.rm-resource-info div {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.p-report-subtitle { margin: 2px 0 12px; font-size: 15px; }
.p-report-breakdowns { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; }
.p-report-breakdown {
  border: 1px solid var(--p-line-2); border-radius: var(--p-radius-sm);
  background: var(--p-bg); padding: 10px; min-width: 0; overflow-x: auto;
}
.p-report-breakdown h4 { margin: 0 0 8px; font-size: 13px; color: var(--p-ink); white-space: nowrap; }
.p-report-breakdown .p-table { background: var(--p-paper); font-size: 11px; min-width: 420px; }
.p-report-breakdown .p-table th,
.p-report-breakdown .p-table td { white-space: nowrap; padding: 4px 6px; }
.p-report-helper {
  padding: 12px 14px;
  border: 1px solid rgba(28,100,242,0.12);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(225,239,254,0.72));
  color: var(--p-ink-2);
}
.p-report-helper-filters {
  display: grid;
  gap: 10px;
}
.p-report-helper-copy {
  display: grid;
  gap: 4px;
}
.p-report-helper-copy strong {
  color: var(--p-ink);
  font-size: 13px;
}
.p-report-inline-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px 14px;
}
.p-report-inline-filters label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--p-ink-2);
}
.p-report-inline-filters select,
.p-report-ms {
  min-width: 180px;
}
.p-report-inline-filters .p-report-search {
  min-width: 240px;
  width: min(280px, 100%);
}
.p-report-inline-filters .p-report-search .p-ms-control,
.p-report-date-range {
  min-height: 36px;
  border-radius: 8px;
  background: #fff;
}
.p-report-inline-filters .p-report-search .p-ms-control {
  padding: 6px 8px;
}
.p-report-inline-filters .p-report-search .p-ms-input {
  min-width: 150px;
  font-size: 12px;
}
.p-report-inline-filters .p-report-search .p-ms-dd {
  z-index: 12;
  max-height: 260px;
}
.p-report-search-option {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}
.p-report-search-clear {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: var(--p-bg);
  color: var(--p-ink-3);
  cursor: pointer;
  line-height: 18px;
}
.p-report-search-clear:hover {
  background: #fee2e2;
  color: #b91c1c;
}
.p-report-date-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--p-line);
}
.p-report-date-range:focus-within {
  border-color: rgba(28,100,242,0.25);
  box-shadow: 0 0 0 3px rgba(28,100,242,0.08);
}
.p-report-date-range input {
  width: 126px;
  border: 0;
  outline: none;
  color: var(--p-ink);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.2;
  background: transparent;
}
.p-report-date-range span {
  color: var(--p-ink-3);
  font-size: 12px;
}
.p-report-ms {
  position: relative;
}
.p-report-ms summary {
  list-style: none;
  cursor: pointer;
  padding: 7px 10px;
  border: 1px solid var(--p-line);
  border-radius: 8px;
  background: #fff;
  color: var(--p-ink);
  font-size: 12px;
}
.p-report-ms summary::-webkit-details-marker {
  display: none;
}
.p-report-ms[open] summary {
  border-color: rgba(28,100,242,0.25);
  box-shadow: 0 0 0 3px rgba(28,100,242,0.08);
}
.p-report-ms-menu {
  position: absolute;
  z-index: 8;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  max-height: 240px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--p-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--p-shadow-md);
}
.p-report-ms-option {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  font-size: 12px !important;
  color: var(--p-ink) !important;
}
.p-report-ms-option input {
  margin: 0;
}
.p-report-filter-count {
  margin-left: auto;
  color: var(--p-ink-3);
  font: 600 11px/1.4 var(--p-mono);
}
.p-report-kpi {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  align-items: stretch;
  padding-bottom: 16px;
}
.p-report-kpi::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, rgba(14,159,110,0.95), rgba(28,100,242,0.95));
}
.p-report-kpi.is-neutral::before { background: linear-gradient(90deg, #d7dce3, #c4ccd7); }
.p-report-kpi.is-ok::before { background: linear-gradient(90deg, #0e9f6e, #34d399); }
.p-report-kpi.is-warn::before { background: linear-gradient(90deg, #d97706, #f59e0b); }
.p-report-kpi.is-danger::before { background: linear-gradient(90deg, #dc2626, #f87171); }
.p-report-kpi.is-info::before { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.p-report-kpi.is-muted::before { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }
.p-report-kpi .p-kpi-body { gap: 8px; width: 100%; }
.p-report-kpi-meta {
  font-size: 12px;
  color: var(--p-ink-2);
  line-height: 1.5;
}
.p-report-kpi-track {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  height: 8px;
  border-radius: 999px;
  background: #edf1f5;
  overflow: hidden;
}
.p-report-kpi-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(14,159,110,0.85), rgba(28,100,242,0.78));
}
.p-report-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: -2px 0 10px;
}
.p-report-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--p-ink-2);
  font-size: 12px;
}
.p-report-legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  background: #cbd5e1;
}
.p-report-legend-item.is-ok i { background: #10b981; }
.p-report-legend-item.is-warn i { background: #f59e0b; }
.p-report-legend-item.is-danger i { background: #ef4444; }
.p-report-legend-item.is-info i { background: #3b82f6; }
.p-report-legend-item.is-muted i { background: #94a3b8; }
.p-report-matrix-wrap {
  overflow: auto;
  border-radius: var(--p-radius);
  border: 1px solid var(--p-line);
  box-shadow: var(--p-shadow-sm);
}
.p-report-matrix {
  min-width: 760px;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}
.p-report-matrix th {
  padding: 10px 12px;
  font-size: 12px;
}
.p-report-matrix td {
  padding: 8px 10px;
}
.p-report-matrix th:first-child,
.p-report-matrix td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: inherit;
}
.p-report-matrix.has-two-dims th:nth-child(2),
.p-report-matrix.has-two-dims td:nth-child(2) {
  position: sticky;
  left: 140px;
  z-index: 2;
  background: inherit;
}
.p-report-matrix th:first-child,
.p-report-matrix.has-two-dims th:nth-child(2) { background: #fafbfc; }
.p-report-matrix td:first-child,
.p-report-matrix.has-two-dims td:nth-child(2) { background: #fff; }
.p-report-matrix-dim {
  min-width: 128px;
  font-weight: 600;
  font-size: 11.5px;
}
.p-report-matrix-total {
  font: 700 12px/1.2 var(--p-mono);
  color: var(--p-ink);
}
.p-report-matrix-cell {
  padding: 6px 8px !important;
  text-align: center;
}
.p-report-matrix-btn {
  width: 100%;
  min-width: 78px;
  display: grid;
  gap: 2px;
  padding: 8px 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  transition: transform .14s var(--p-ease), box-shadow .14s var(--p-ease), border-color .14s var(--p-ease);
}
.p-report-matrix-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--p-shadow-sm);
}
.p-report-matrix-btn:disabled {
  cursor: default;
  opacity: 0.55;
}
.p-report-matrix-cell.is-ok .p-report-matrix-btn { background: linear-gradient(180deg, #ffffff, #f1fcf7); border-color: rgba(14,159,110,0.18); }
.p-report-matrix-cell.is-warn .p-report-matrix-btn { background: linear-gradient(180deg, #ffffff, #fffbeb); border-color: rgba(217,119,6,0.2); }
.p-report-matrix-cell.is-danger .p-report-matrix-btn { background: linear-gradient(180deg, #ffffff, #fef2f2); border-color: rgba(220,38,38,0.2); }
.p-report-matrix-cell.is-info .p-report-matrix-btn { background: linear-gradient(180deg, #ffffff, #eff6ff); border-color: rgba(37,99,235,0.2); }
.p-report-matrix-cell.is-muted .p-report-matrix-btn { background: linear-gradient(180deg, #ffffff, #f8fafc); border-color: rgba(148,163,184,0.18); }
.p-report-matrix-value {
  font: 700 18px/1 var(--p-display);
  color: var(--p-ink);
}
.p-report-matrix-label {
  font-size: 10px;
  color: var(--p-ink-2);
}
.p-report-drawer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--p-line);
  border-radius: 10px;
  background: var(--p-bg);
  color: var(--p-ink-2);
  font-size: 12px;
}
.p-report-drawer-meta b {
  font: 700 12px/1.4 var(--p-mono);
  color: var(--p-ink);
}
.p-report-drawer-table { overflow: auto; }
.p-report-merge-cell {
  vertical-align: middle;
  background: #fcfdfd;
}
.p-report-resource-link {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--p-brand);
  cursor: pointer;
}
.p-report-resource-link:hover code,
.p-report-resource-link:focus-visible code {
  color: var(--p-brand-2);
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
@media (max-width: 860px) {
  .p-nav { display: none; }
  .p-drawer { min-width: 0; width: 94vw; }
  .p-drawer.p-drawer-resizable {
    width: 94vw !important;
    min-width: 0 !important;
    min-height: min(520px, 78vh) !important;
    height: min(88vh, 820px) !important;
    max-width: 94vw !important;
    max-height: 90vh !important;
    resize: vertical;
  }
  .p-ticket-detail-shell {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .p-ticket-comments {
    max-height: none;
  }
  .p-form, .p-grid-2 { grid-template-columns: 1fr; }
  .p-report-matrix { min-width: 620px; }
  .p-report-matrix th:first-child,
  .p-report-matrix td:first-child,
  .p-report-matrix.has-two-dims th:nth-child(2),
  .p-report-matrix.has-two-dims td:nth-child(2) {
    position: static;
  }
  .p-report-bar-top,
  .p-report-bar-foot,
  .p-report-drawer-meta {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* 绑定详情模型清单表格 */
.p-model-list-table { margin-top: 4px; }
.p-model-list-table th { font-weight: 500; color: var(--p-ink-2); white-space: nowrap; }
.p-model-list-table td code { font-size: 11px; }

/* ============================================================
   通道备注
   ============================================================ */
.rm-remarks-list { display: flex; flex-direction: column; gap: 8px; }
.rm-remark-item {
  padding: 10px 12px; border: 1px solid var(--p-line-2); border-radius: 8px;
  background: var(--p-paper); transition: background .12s var(--p-ease);
}
.rm-remark-item:hover { background: var(--p-bg); }
.rm-remark-item.archived { background: #fafbfc; border-style: dashed; }
.rm-remark-head {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 11px; color: var(--p-ink-3); margin-bottom: 5px;
}
.rm-remark-head .p-tag { font-size: 10px; padding: 1px 5px; }
.rm-remark-content { font-size: 12.5px; color: var(--p-ink); line-height: 1.6; white-space: pre-wrap; }
.rm-remark-actions { display: flex; gap: 4px; margin-left: auto; }
.rm-remark-actions button { font-size: 11px; padding: 2px 7px; }
.rm-remarks-empty { font-size: 12px; color: var(--p-ink-3); padding: 8px 0; }
.rm-remarks-add {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--p-line-2);
}
.rm-remarks-add-row {
  display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap;
}
.rm-remarks-add-row select {
  min-width: 180px; font-size: 12px; padding: 6px 10px;
  border: 1px solid var(--p-line-2); border-radius: 6px;
}
.rm-remarks-add-row textarea {
  flex: 1; min-width: 260px; font-size: 12.5px; padding: 6px 10px;
  border: 1px solid var(--p-line-2); border-radius: 6px; resize: vertical;
}
.rm-remarks-add-row button { font-size: 12px; padding: 6px 12px; }
.rm-remark-edit-wrap textarea {
  width: 100%; font-size: 12.5px; padding: 6px 10px;
  border: 1px solid var(--p-line-2); border-radius: 6px; resize: vertical; margin-bottom: 6px;
}
.rm-remark-edit-actions { display: flex; gap: 6px; justify-content: flex-end; }
.rm-remark-edit-actions button { font-size: 11px; padding: 3px 10px; }

/* ============================================================
   通道模型配额
   ============================================================ */
.rm-model-cap-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.rm-model-cap-table th { text-align: left; padding: 6px 10px; font-size: 11px; font-weight: 600; color: var(--p-ink-3); border-bottom: 1px solid var(--p-line-2); white-space: nowrap; }
.rm-model-cap-table td { padding: 7px 10px; border-bottom: 1px solid var(--p-line); vertical-align: middle; }
.rm-model-cap-table tr:last-child td { border-bottom: none; }
.rm-model-cap-table td.right { text-align: right; font-family: var(--p-mono); }
.rm-model-cap-value { font-family: var(--p-mono); font-size: 12px; color: var(--p-ink); }
.rm-model-cap-value.empty { color: var(--p-ink-3); }
.rm-model-cap-edit-row td { background: var(--p-bg-2); }
.rm-model-cap-edit-row input {
  width: 80px; padding: 4px 7px; font-size: 12px; font-family: var(--p-mono);
  border: 1px solid var(--p-line-2); border-radius: 5px;
}
.rm-model-cap-edit-row input:focus { border-color: var(--p-brand); outline: none; box-shadow: 0 0 0 2px rgba(14,159,110,0.12); }
.rm-model-cap-actions { display: flex; gap: 4px; justify-content: flex-end; }
.rm-model-cap-actions button { font-size: 11px; padding: 2px 8px; }

/* ============================================================
   通道详情弹窗 — 分组卡片网格
   ============================================================ */
.rm-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.rm-detail-section {
  background: var(--p-bg);
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rm-detail-section.full {
  grid-column: 1 / -1;
}
.rm-detail-section-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--p-ink);
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--p-line-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.rm-detail-section-title::before {
  content: '';
  width: 3px;
  height: 13px;
  background: var(--p-brand);
  border-radius: 2px;
  flex: none;
}
.rm-detail-section-title.warn::before { background: var(--p-warn); }
.rm-detail-section-title.danger::before { background: var(--p-bad); }
.rm-detail-row {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 8px 10px;
  align-items: baseline;
  padding: 5px 0;
  font-size: 12.5px;
}
.rm-detail-row + .rm-detail-row {
  border-top: 1px solid var(--p-line-2);
}
.rm-detail-label {
  color: var(--p-ink-3);
  font-size: 11.5px;
  line-height: 1.4;
}
.rm-detail-value {
  color: var(--p-ink);
  word-break: break-all;
  font-family: var(--p-mono);
  font-size: 12px;
  line-height: 1.5;
}
.rm-detail-value code {
  font-size: 11.5px;
  background: transparent;
  padding: 0;
}
.rm-detail-value .pbadge {
  font-size: 11px;
  padding: 1px 7px;
}
.rm-detail-value .p-tag {
  font-size: 10.5px;
  margin-right: 3px;
}
.rm-detail-value.rm-detail-wrap {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--p-font);
  font-size: 12px;
}
.rm-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--p-line-2);
}
.rm-detail-header-id {
  font: 700 18px/1 var(--p-mono);
  color: var(--p-ink);
}
.rm-detail-header-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--p-ink-2);
}
.rm-detail-header-tag {
  margin-left: auto;
}
