/* ==========================================================================
   普惠易 · 贸易融资业务管理系统  —  样式表
   ========================================================================== */
:root {
  --navy: #0b2740;
  --navy-2: #10395c;
  --navy-3: #17527f;
  --gold: #c9a35c;
  --brand: #1b6fd6;
  --brand-dark: #145bb4;
  --brand-soft: #eaf2fd;
  --bg: #f3f6fa;
  --card: #ffffff;
  --line: #e3e9f2;
  --line-2: #eef2f8;
  --text: #14263a;
  --muted: #6b7d92;
  --ok: #0f9d6e;
  --ok-bg: #e8f7f1;
  --warn: #c68600;
  --warn-bg: #fdf4e0;
  --danger: #d04a4a;
  --danger-bg: #fdecec;
  --info: #2d7ff9;
  --info-bg: #ebf2fe;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(17, 38, 61, .05), 0 8px 24px -18px rgba(17, 38, 61, .35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
h1, h2, h3, h4 { margin: 0; font-weight: 650; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cfd9e6; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 238px;
  flex: 0 0 238px;
  background: linear-gradient(180deg, var(--navy) 0%, #0a2137 100%);
  color: #c9d7e6;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.brand .logo {
  display: flex; align-items: center; gap: 10px;
}
.brand .mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #2a86e8, #1a5fb4);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -.5px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}
.brand .name { color: #fff; font-size: 16px; font-weight: 650; letter-spacing: .5px; }
.brand .sub { color: #7f95ab; font-size: 11px; margin-top: 3px; letter-spacing: .2px; }

.nav { padding: 12px 10px 24px; flex: 1; }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 4px; }
.nav-group > .g-title {
  font-size: 11px; color: #6c8299; letter-spacing: 1.6px;
  padding: 6px 12px 8px; text-transform: uppercase;
  display: flex; align-items: center; cursor: pointer; user-select: none;
}
.nav-group > .g-title::after {
  content: ""; margin-left: auto; width: 6px; height: 6px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-135deg); transition: transform .18s; opacity: .75;
}
.nav-group.collapsed > .g-title { padding-bottom: 6px; }
.nav-group.collapsed > .g-title::after { transform: rotate(45deg); }
.nav-group.collapsed > .nav-item { display: none; }
.nav-group > .g-title:hover { color: #9db4ca; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: #c3d3e3; font-size: 13.5px; margin-bottom: 2px;
  transition: background .15s, color .15s;
  position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(43, 130, 224, .35), rgba(43, 130, 224, .08)); color: #fff; }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  border-radius: 3px; background: var(--gold);
}
.nav-item .ic { width: 16px; height: 16px; opacity: .85; flex: 0 0 16px; }
/* 同一分组内的分隔线（报表管理：报表 / 额度台账） */
.nav-sep { height: 1px; margin: 10px 12px 9px; background: rgba(255, 255, 255, .09); }
.nav-group.collapsed > .nav-sep { display: none; }
.nav-item .badge-mini {
  margin-left: auto; background: rgba(201, 163, 92, .18); color: var(--gold);
  font-size: 11px; padding: 1px 7px; border-radius: 99px;
}
.side-foot {
  padding: 14px 18px; border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: 11px; color: #6f8499; line-height: 1.7;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; position: sticky; top: 0; z-index: 30;
}
.crumb { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.crumb b { color: var(--text); font-weight: 600; font-size: 14.5px; }
.crumb .sep { color: #c3ccd8; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #2a86e8, #17527f); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
}
.role-chip {
  font-size: 11.5px; color: var(--brand); background: var(--brand-soft);
  padding: 3px 9px; border-radius: 99px; border: 1px solid #d5e6fb;
}

.content { padding: 22px 26px 46px; max-width: 1560px; width: 100%; }

/* ---------- 通用组件 ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 20px; letter-spacing: .3px; }
.page-desc { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.6; max-width: 820px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 16px; overflow: hidden;
}
.card-head {
  padding: 15px 20px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-head h3 { font-size: 14.5px; letter-spacing: .2px; }
.card-head .hint { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.card-body { padding: 18px 20px; }
.card-body.tight { padding: 0; overflow-x: auto; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 17px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px;
  border-radius: 50%; background: radial-gradient(circle, rgba(27, 111, 214, .08), transparent 70%);
}
.kpi .label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 25px; font-weight: 680; margin-top: 8px; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 7px; display: flex; align-items: center; gap: 6px; }
.kpi.gold .value { color: #a5762a; }
.kpi.good .value { color: var(--ok); }
.kpi.warn .value { color: var(--warn); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 1.55fr; gap: 16px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 8px; font-size: 13px;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: all .15s; background: #fff; color: var(--text); font-family: inherit;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(180deg, #2a7fe3, #1a63c4); color: #fff; box-shadow: 0 2px 6px rgba(26, 99, 196, .25); }
.btn-primary:hover { color: #fff; box-shadow: 0 4px 12px rgba(26, 99, 196, .32); }
.btn-ghost { border-color: var(--line); color: #35506b; background: #fff; }
.btn-ghost:hover { border-color: #c9d8e9; color: var(--brand); }
.btn-danger { background: #fff; border-color: #f0cccc; color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-gold { background: linear-gradient(180deg, #d8b571, #c19a4e); color: #fff; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.link-btn { background: none; border: 0; color: var(--brand); cursor: pointer; font-size: 13px; padding: 0; font-family: inherit; }
.link-btn.danger { color: var(--danger); }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; }
table.table th {
  background: #f7f9fc; color: #5d7085; font-size: 12.5px; font-weight: 600;
  text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0;
}
table.table td {
  padding: 12px 14px; border-bottom: 1px solid var(--line-2);
  font-size: 13.2px; vertical-align: middle; color: #23384e;
}
table.table tbody tr:hover td { background: #fafcff; }
table.table tbody tr:last-child td { border-bottom: 0; }
table.table td.num, table.table th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.table td.actions { white-space: nowrap; }
table.table th, table.table td { white-space: nowrap; }
table.table { width: max-content; min-width: 100%; }
.table-wrap { -webkit-overflow-scrolling: touch; }
table.table td.actions a, table.table td.actions button { margin-right: 8px; font-size: 12.5px; }
table.table tr.row-warn td { background: #fff9f1; }
table.table tr.row-danger td { background: #fff5f5; }
.t-main { font-weight: 600; color: #12283e; }
.t-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12.5px; letter-spacing: .2px; }
.nowrap { white-space: nowrap; }
.empty { padding: 42px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.empty .big { font-size: 26px; opacity: .25; margin-bottom: 8px; }

/* 徽标 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 99px; font-size: 11.8px; line-height: 1.7;
  border: 1px solid transparent; white-space: nowrap;
}
.badge.ok { color: #0b7d58; background: var(--ok-bg); border-color: #cbeadd; }
.badge.warn { color: #a06a00; background: var(--warn-bg); border-color: #f3e3bf; }
.badge.danger { color: #b13b3b; background: var(--danger-bg); border-color: #f2d2d2; }
.badge.info { color: #1f66c9; background: var(--info-bg); border-color: #d4e4fc; }
.badge.muted { color: #61748a; background: #f0f3f7; border-color: #e2e8f0; }
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tag-soft { display: inline-block; padding: 1px 7px; border-radius: 5px; background: #f1f5fa; color: #4d647c; font-size: 11.5px; margin-right: 4px; }

/* 发票列表融资标签：单元格内单行省略，点击整格弹出全部 */
table.table td.tag-cell { max-width: 320px; white-space: normal; }
.tag-cell .tag-soft {
  max-width: 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  vertical-align: middle; max-height: 22px; line-height: 20px;
}
.tag-cell.has-tags { cursor: pointer; }
.tag-cell .tag-more {
  display: inline-block; padding: 1px 7px; border-radius: 5px; background: #e9f0fb;
  color: var(--brand); font-size: 11.5px; cursor: pointer;
}
.tag-cell:hover .tag-more { background: #d9e6fa; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list .tag-soft { margin-right: 0; padding: 4px 11px; font-size: 12.5px; max-width: none; height: auto; max-height: none; }

/* 提示条 */
.flash { padding: 11px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; display: flex; gap: 9px; align-items: flex-start; }
.flash.ok { background: var(--ok-bg); border: 1px solid #cbeadd; color: #0b6b4c; }
.flash.err { background: var(--danger-bg); border: 1px solid #f2d2d2; color: #a83535; }
.alert { padding: 12px 15px; border-radius: 10px; font-size: 12.8px; line-height: 1.7; margin-bottom: 14px; }
.alert.warn { background: var(--warn-bg); border: 1px solid #f3e3bf; color: #8a5c00; }
.alert.info { background: var(--info-bg); border: 1px solid #d4e4fc; color: #1f5aa8; }
.alert.danger { background: var(--danger-bg); border: 1px solid #f2d2d2; color: #a83535; }
.alert.ok { background: var(--ok-bg); border: 1px solid #cbeadd; color: #0b6b4c; }
.alert b { font-weight: 650; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 20px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; color: #5d7085; margin-bottom: 6px; font-weight: 500; }
.field label .req { color: var(--danger); margin-left: 2px; }
.field .help { font-size: 11.5px; color: #8b9aac; margin-top: 5px; line-height: 1.6; }
input[type=text], input[type=number], input[type=date], input[type=password], input[type=month],
input[type=email], input[type=tel], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #d7e0ea; border-radius: 8px;
  font-size: 13.2px; color: var(--text); background: #fff; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: #8cb6ec; box-shadow: 0 0 0 3px rgba(43, 127, 224, .12);
}
textarea { min-height: 86px; resize: vertical; line-height: 1.7; }
.switch-row { display: flex; gap: 18px; flex-wrap: wrap; padding-top: 4px; }
.switch-row label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #35506b; }
input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--brand); }
.form-actions { display: flex; gap: 10px; padding-top: 8px; }
/* 复选框行 + 独立说明文字 */
label.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: #33475e; cursor: pointer; line-height: 1.6; }
label.check input { margin-top: 3px; flex: none; }
.help-block { font-size: 11.5px; color: #8b9aac; margin-top: 6px; line-height: 1.7; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { min-width: 150px; }
.filters .field label { margin-bottom: 5px; }

/* 识别确认表：单元格内直接编辑 */
table.rec-table td { vertical-align: top; padding: 6px 8px; }
.cell-input { width: 100%; padding: 5px 7px !important; font-size: 12.5px !important; border-radius: 6px !important; }
.cell-input.w-220 { width: 220px; }
.cell-input.w-180 { width: 180px; }
.cell-input.w-130 { width: 130px; }
.cell-input.w-120 { width: 120px; }
.cell-input.num { text-align: right; }
.file-cell { max-width: 240px; }
.fs-sm { font-size: 11.5px !important; }
.row-err td { background: #fff7f7; }
.warn-line { font-size: 11px; color: #b06a00; line-height: 1.5; margin-top: 3px; }
table.rec-table details summary { cursor: pointer; font-size: 12px; color: var(--brand); white-space: nowrap; }
table.rec-table details table { margin-top: 6px; background: #fff; box-shadow: 0 2px 10px rgba(20, 40, 70, .12); }
table.rec-table details table th, table.rec-table details table td { padding: 4px 8px; font-size: 11.5px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.inline-form input, .inline-form select { width: auto; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 20px; background: #fbfcfe; }
.tab {
  padding: 12px 16px; font-size: 13.2px; color: var(--muted);
  border-bottom: 2px solid transparent; cursor: pointer; background: none; border-top: 0; border-left: 0; border-right: 0;
  font-family: inherit; display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--brand); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; background: #fff; }
.tab .count { background: #eef3f9; color: #5d7085; border-radius: 99px; padding: 0 6px; font-size: 11px; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* 描述列表 */
.dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.dl.two { grid-template-columns: 1fr 1fr; }
.dl .item { padding: 13px 18px; border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); }
.dl .item .k { font-size: 11.8px; color: var(--muted); margin-bottom: 5px; }
.dl .item .v { font-size: 13.4px; color: #1b3145; }
.dl .item.wide { grid-column: span 2; }

/* 额度条 */
.bar { height: 6px; background: #edf2f8; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #4b9bf0, #1b6fd6); }
.bar.warn > i { background: linear-gradient(90deg, #f2b544, #d99a1a); }
.bar.danger > i { background: linear-gradient(90deg, #ef7b7b, #d04a4a); }
.quota-cell { min-width: 150px; }
.quota-cell .nums { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }

/* 链路流程图 */
.flow { display: flex; align-items: stretch; flex-wrap: wrap; gap: 0; padding: 6px 0; }
.flow-node {
  flex: 1 1 150px; min-width: 150px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 13px; position: relative;
}
.flow-node .pos {
  position: absolute; top: -8px; left: 12px; background: var(--navy); color: #fff;
  font-size: 10.5px; padding: 1px 7px; border-radius: 99px;
}
.flow-node .nm { font-size: 13px; font-weight: 600; margin-top: 4px; }
.flow-node .ctl { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.flow-node.end { background: #f7fbff; border-color: #d5e6fb; }
.flow-arrow {
  display: grid; place-items: center; width: 34px; color: #b7c6d8; font-size: 15px; flex: 0 0 34px;
}

/* 时间轴 */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 1px; background: #dde6f0; }
.tl-item { position: relative; padding: 0 0 20px 0; }
.tl-item::before {
  content: ""; position: absolute; left: -23px; top: 4px; width: 9px; height: 9px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand);
}
.tl-item.done::before { background: var(--brand); }
.tl-item .tl-title { font-size: 13.3px; font-weight: 600; }
.tl-item .tl-meta { font-size: 11.8px; color: var(--muted); margin-top: 4px; }
.tl-item .tl-body { margin-top: 8px; font-size: 12.8px; color: #3c556d; }

/* 图表（纯 CSS/SVG） */
.bars { display: flex; flex-direction: column; gap: 13px; }
.bar-row { display: grid; grid-template-columns: 118px 1fr 92px; gap: 12px; align-items: center; font-size: 12.7px; }
.bar-row .nm { color: #35506b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: #f1f5fa; border-radius: 6px; height: 10px; overflow: hidden; }
.bar-track > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #4b9bf0, #1b6fd6); }
.bar-row .val { text-align: right; color: #47617a; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 12px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }

.spark { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 10px; }
.spark .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; height: 100%; }
.spark .pairs { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.spark .b1, .spark .b2 { width: 13px; border-radius: 3px 3px 0 0; min-height: 2px; }
.spark .b1 { background: #a9cdf5; }
.spark .b2 { background: #1b6fd6; }
.spark .lbl { font-size: 11px; color: var(--muted); }

/* 进度环（额度使用率） */
.donut-row { display: flex; align-items: center; gap: 18px; }
.donut { position: relative; width: 108px; height: 108px; flex: 0 0 108px; }
.donut svg { transform: rotate(-90deg); }
.donut .center { position: absolute; inset: 0; display: grid; place-items: center; font-size: 17px; font-weight: 680; }

/* 搜索 / 过滤器 */
.searchbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.searchbar input[type=text] { width: 240px; }
.pill-group { display: inline-flex; background: #f1f5fa; border-radius: 8px; padding: 3px; gap: 2px; }
.pill-group a { padding: 5px 12px; border-radius: 6px; font-size: 12.5px; color: #5d7085; }
.pill-group a.active { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(20, 40, 60, .1); font-weight: 600; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(11, 30, 48, .45); backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 14px; width: 640px; max-width: 100%; max-height: 90vh;
  overflow: auto; box-shadow: 0 24px 60px -12px rgba(9, 26, 43, .4);
  animation: pop .16s ease-out;
}
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: .6; } to { transform: none; opacity: 1; } }
.modal.wide { width: 860px; }
.modal-head { padding: 17px 22px; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 15px; }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; background: #fbfcfe; }
.x { background: none; border: 0; font-size: 20px; color: #9aabbd; cursor: pointer; line-height: 1; }

/* 登录页 */
.login-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: #fff;
}
.login-left {
  background: linear-gradient(150deg, #0b2740 0%, #123a5b 45%, #1a4f78 100%);
  color: #fff; padding: 54px 58px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.login-left::before {
  content: ""; position: absolute; right: -120px; top: -80px; width: 420px; height: 420px;
  border-radius: 50%; background: radial-gradient(circle, rgba(201, 163, 92, .22), transparent 65%);
}
.login-left::after {
  content: ""; position: absolute; left: -90px; bottom: -140px; width: 380px; height: 380px;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, .08);
}
.login-brand { display: flex; align-items: center; gap: 12px; position: relative; }
.login-brand .mark { width: 42px; height: 42px; border-radius: 11px; background: linear-gradient(135deg, #3a97f0, #1a5fb4); display: grid; place-items: center; font-weight: 700; font-size: 17px; }
.login-hero { position: relative; }
.login-hero h2 { font-size: 32px; line-height: 1.35; letter-spacing: 1px; font-weight: 650; }
.login-hero p { color: #a9c0d6; font-size: 13.5px; line-height: 2; margin-top: 18px; max-width: 460px; }
.login-points { display: flex; gap: 22px; margin-top: 30px; flex-wrap: wrap; }
.login-points div { font-size: 12px; color: #b6cadc; border-left: 2px solid rgba(201, 163, 92, .6); padding-left: 10px; line-height: 1.7; }
.login-points b { display: block; color: #fff; font-size: 19px; font-weight: 650; }
.login-right { display: grid; place-items: center; padding: 40px; }
.login-box { width: 348px; }
.login-box h1 { font-size: 23px; margin-bottom: 8px; }
.login-box .sub { color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.login-box .field { margin-bottom: 16px; }
.login-box .btn { height: 42px; font-size: 14px; }
.demo-accounts { margin-top: 26px; border-top: 1px dashed var(--line); padding-top: 16px; font-size: 12px; color: var(--muted); line-height: 1.9; }
.demo-accounts code { background: #f4f7fb; padding: 1px 6px; border-radius: 4px; color: #33506c; }

/* 详情页 */
.detail-hero {
  background: linear-gradient(120deg, #10395c, #17527f);
  color: #fff; border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
}
.detail-hero h2 { font-size: 19px; }
.detail-hero .meta { font-size: 12.5px; color: #b7cde0; margin-top: 7px; display: flex; gap: 18px; flex-wrap: wrap; }
.detail-hero .big { font-size: 24px; font-weight: 680; text-align: right; }
.detail-hero .big small { display: block; font-size: 11.5px; color: #a9c2d7; font-weight: 400; margin-top: 4px; }

.stat-line { display: flex; gap: 26px; flex-wrap: wrap; }
.stat-line .it .k { font-size: 11.8px; color: var(--muted); }
.stat-line .it .v { font-size: 17px; font-weight: 650; margin-top: 4px; }

.split-note { font-size: 12px; color: var(--muted); padding: 10px 0; }

/* 打印 */
@media print {
  .sidebar, .topbar, .page-actions, .no-print, .reg-bar, .reg-spacer { display: none !important; }
  .content { padding: 0; }
  body { background: #fff; }
}

/* 响应式 */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-2-1, .grid-1-2, .grid-3 { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 880px) {
  .sidebar { display: none; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; }
  .content { padding: 16px; }
}

/* ====== 搜索栏增强 + 分页条 ====== */
.filters .field.grow { flex: 1 1 320px; min-width: 320px; max-width: 480px; }
.filters .field.grow input { width: 100%; height: 38px; font-size: 14px; padding: 0 12px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 14px 4px 2px; flex-wrap: wrap; }
.pager .pager-info { margin-right: auto; color: #7d92a8; font-size: 12px; }
.pager a, .pager span.pg {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 32px; height: 32px; padding: 0 8px;
    border: 1px solid var(--line); border-radius: 6px; background: #fff;
    color: #35506b; font-size: 13px; text-decoration: none;
}
.pager a:hover { border-color: #c9d8e9; color: var(--brand); }
.pager span.pg.cur { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager span.pg.dis { color: #b6c4d3; cursor: default; }

/* 类型切换标签（基础数据额度页等） */
.nav-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.nav-tabs .tab {
  padding: 7px 16px; border: 1px solid var(--line); border-radius: 99px;
  font-size: 13px; color: var(--muted); background: #fff; text-decoration: none;
}
.nav-tabs .tab:hover { color: var(--brand); border-color: var(--brand); }
.nav-tabs .tab.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* 列表批量操作悬浮栏（右下角） */
.sel-float {
  position: fixed; right: 26px; bottom: 26px; z-index: 95;
  display: none; align-items: center; gap: 16px;
  padding: 12px 16px; border-radius: 12px;
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 10px 32px rgba(18, 44, 74, .18);
}
.sel-float.show { display: flex; animation: selFloatIn .18s ease-out; }
.sel-float-info { font-size: 13px; color: #35506b; }
.sel-float-info b { color: var(--brand); }
@keyframes selFloatIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ 报表：额度矩阵（公司 × 银行） ============ */
table.table.mx th, table.table.mx td { padding: 7px 10px; font-size: 12.5px; }
table.table.mx thead tr:first-child th { background: #f7fafd; }
table.table.mx th.mx-bank {
  text-align: center; font-weight: 600; color: #2b4a6b;
  border-left: 2px solid #e6eef7;
}
table.table.mx td.mx-cell { border-left: 1px solid #eef4fa; }
table.table.mx td.mx-cell.start { border-left: 2px solid #e6eef7; }
table.table.mx td.mx-cell.zero { color: #b6c4d3; }
table.table.mx td.mx-cell.over { color: #d9534f; font-weight: 600; background: #fff7f7; }
table.table.mx td.mx-cell.used { color: #1b6fd6; }
table.table.mx th.mx-fix, table.table.mx td.mx-fix {
  position: sticky; left: 0; z-index: 3; background: #fff;
  box-shadow: 1px 0 0 #eef4fa;
}
table.table.mx th.mx-fix2, table.table.mx td.mx-fix2 {
  position: sticky; left: 210px; z-index: 3; background: #fff;
  box-shadow: 1px 0 0 #eef4fa;
}
table.table.mx thead th.mx-fix, table.table.mx thead th.mx-fix2 { background: #f7fafd; z-index: 4; }
/* 冻结列固定宽度：公司名过长时换行，避免第二列 left 偏移错位 */
table.table.mx th.mx-fix, table.table.mx td.mx-fix {
  width: 210px; min-width: 210px; max-width: 210px; white-space: normal; line-height: 1.45;
}
table.table.mx th.mx-fix2, table.table.mx td.mx-fix2 {
  width: 96px; min-width: 96px; max-width: 96px; white-space: nowrap;
}
table.table.mx tbody tr:hover td.mx-fix, table.table.mx tbody tr:hover td.mx-fix2 { background: #fafcff; }
table.table.mx tr.mx-total td { background: #f6f9fd; font-weight: 600; }
table.table.mx tr.mx-total td.mx-fix, table.table.mx tr.mx-total td.mx-fix2 { background: #f6f9fd; }
.mx-sum { display: flex; gap: 26px; flex-wrap: wrap; font-size: 13px; color: #35506b; }
.mx-sum b { font-size: 15px; }

/* 报表：小号辅助说明 / 图例 */
.rpt-note { font-size: 12px; color: var(--muted); line-height: 1.75; }
.rpt-note b { color: #35506b; }
table.table tr.sum-row td { background: #f6f9fd; font-weight: 600; }

/* ============ 可搜索下拉（select 增强，见 app.js） ============ */
.ss { position: relative; display: block; }
.ss > select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.ss-input {
  width: 100%; padding: 9px 28px 9px 11px; border: 1px solid #d7e0ea; border-radius: 8px;
  font-size: 13.2px; color: var(--text); background: #fff; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.ss-input:focus { outline: none; border-color: #8cb6ec; box-shadow: 0 0 0 3px rgba(43, 127, 224, .12); }
.ss-input::placeholder { color: #9aa9ba; }
.ss-caret {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  padding: 0 2px; cursor: pointer; color: #8b9aac; font-size: 10px; line-height: 1;
}
.ss-caret:hover { color: #2b7fe0; }
.ss.invalid .ss-input { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(208, 74, 74, .12); }
.inline-form .ss { display: inline-block; min-width: 110px; }

/* 面板挂 body，避免被 .card{overflow:hidden} 裁切 */
.ss-panel {
  position: fixed; z-index: 900; display: none; box-sizing: border-box;
  background: #fff; border: 1px solid #dde5ef; border-radius: 10px;
  box-shadow: 0 12px 30px rgba(16, 42, 70, .16); padding: 4px;
  max-height: 288px; overflow-y: auto;
}
.ss-panel.show { display: block; }
.ss-opt {
  padding: 8px 10px; border-radius: 7px; font-size: 13px; color: #22364c; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ss-opt:hover { background: #f4f8fe; }
.ss-opt.active { background: var(--brand-soft); color: var(--brand-dark); }
.ss-opt.selected { font-weight: 600; }
.ss-opt mark { background: #fff3bf; color: inherit; padding: 0; }
.ss-empty { padding: 12px 10px; font-size: 12.5px; color: var(--muted); text-align: center; }
.ss-hint { padding: 5px 10px 6px; font-size: 11px; color: #9aa9ba; border-top: 1px dashed var(--line-2); margin-top: 3px; }

/* ====== 业务办理（迁移自旧系统「业务管理」） ====== */
.chk-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12.8px; color: #5d7085; white-space: nowrap; }
.chk-inline input { width: auto; }
.t-warn { color: var(--warn, #c47a09); }
.empty-hint { padding: 40px 10px; text-align: center; color: var(--muted); font-size: 13px; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; line-height: 1.7; }
.tag-ok { background: #e8f5ec; color: #1e7a3c; }
.tag-off { background: #f2f4f7; color: #7c8794; }
.tag-none { background: #eef4ff; color: #2b62b8; }

tr.row-void td { color: #a3adb9; background: #fafbfc; }
tr.row-void td b { color: #a3adb9; }

/* 发票勾选后的悬浮登记条：勾选后从底部浮出，滚动时始终可见 */
.reg-bar {
  position: fixed; left: 262px; right: 24px; bottom: 16px; z-index: 60;
  display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end;
  padding: 14px 22px;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--line, #e6ecf3);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 35, 60, .18);
  transition: transform .25s ease, opacity .25s ease, box-shadow .25s ease;
}
.reg-bar.hide {
  transform: translateY(130%); opacity: 0; pointer-events: none;
}
.reg-bar.on { box-shadow: 0 12px 32px rgba(15, 35, 60, .22), 0 0 0 2px rgba(201, 163, 92, .25); }
.reg-cell { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: #5d7085; }
.reg-cell label { font-size: 12px; color: #5d7085; }
.reg-cell b { font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; }
.reg-cell.sel b { color: var(--brand-dark, #a5813a); font-size: 18px; }
.reg-cell input { width: 170px; }
.reg-act { margin-left: auto; }
.reg-spacer { height: 96px; }
@media (max-width: 900px) {
  .reg-bar { left: 12px; right: 12px; gap: 14px; }
  .reg-cell input { width: 130px; }
}

/* 分段表单 */
.form-sect + .form-sect { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line, #e6ecf3); }
.sect-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 14px; }
.form-sect .form-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) { .form-sect .form-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .form-sect .form-grid { grid-template-columns: 1fr; } }
.form-foot { display: flex; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line, #e6ecf3); }

/* 详情键值表 */
table.kv { width: 100%; border-collapse: collapse; font-size: 13px; }
table.kv th { width: 150px; text-align: left; font-weight: 500; color: #6b7d90; background: #fafbfd; padding: 9px 12px; border: 1px solid var(--line, #e9eef5); }
table.kv td { padding: 9px 12px; border: 1px solid var(--line, #e9eef5); color: var(--text); font-variant-numeric: tabular-nums; }

/* 额度查询：指定关注公司整行标红加粗（照旧系统 red-row） */
tr.red-row td { color: #c0392b !important; font-weight: 700; }
tr.red-row td b, tr.red-row td .tag { color: #c0392b !important; }
tr.red-row td .tag-none { background: #fdecea; }
tr.red-row:hover td { background: #fdf3f2; }

/* 紧凑表格：选择发票页等宽表场景，减少内边距让最右金额一屏可见 */
table.table-fit th { padding: 7px 9px; font-size: 12px; }
table.table-fit td { padding: 6px 9px; font-size: 12.3px; }
table.table-fit td.clamp {
  max-width: 168px; overflow: hidden; text-overflow: ellipsis;
}

/* 结转单列表勾选列 */
table.table .chk-col { text-align: center; width: 40px; }
table.table .chk-col input { vertical-align: middle; }

/* 只读/自动计算字段：明显区别于可编辑输入框 */
input[disabled], input[readonly], select[disabled], textarea[disabled], textarea[readonly] {
  background: #f2f5f8;
  color: #7c8da0;
  cursor: not-allowed;
  border-color: #e2e9f1;
  border-style: dashed;
}
input[disabled]:focus, input[readonly]:focus, select[disabled]:focus, textarea[disabled]:focus, textarea[readonly]:focus {
  border-color: #e2e9f1; box-shadow: none;
}
.field label:has(+ input[disabled]), .field label:has(+ select[disabled]) { color: #8b9aac; }

/* 公司管理：在贷金额（未到期）按业务类型明细 */
.th-hint { font-size: 10.5px; font-weight: 400; color: #8b9aac; background: #f1f5fa; border-radius: 4px; padding: 0 4px; margin-left: 3px; }
table.table td.loan-cell { min-width: 210px; vertical-align: top; }
.loan-cell .loan-total { font-size: 13.5px; color: #1b6fd6; }
.loan-cell .loan-mix { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; margin: 4px 0 2px; }
.loan-cell .loan-mix .tag-soft { margin-right: 0; font-size: 11px; padding: 1px 6px; white-space: nowrap; }
.loan-cell .t-sub { font-size: 11px; }

/* 状态标签：已到期 */
.tag-mature { background: #fff4e5; color: #a86412; }

/* 公司管理列表：在贷金额标签格（点击弹窗看全部业务类型） */
table.table td.loan-cell { min-width: 190px; vertical-align: middle; }
table.table td.loan-cell.has-tags { cursor: pointer; }
table.table td.loan-cell.has-tags:hover .loan-mix .tag-soft { background: #e4eefb; }
.loan-cell .loan-mix { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; margin-top: 4px; }
.loan-cell .tag-soft { margin-right: 0; font-size: 10.8px; padding: 0 5px; line-height: 18px; white-space: nowrap; max-width: 128px; overflow: hidden; text-overflow: ellipsis; }
.loan-cell .tag-more { display: inline-block; padding: 0 5px; line-height: 18px; border-radius: 5px; background: #e9eef6; color: #5d7085; font-size: 10.8px; }
.loan-list { display: flex; flex-wrap: wrap; gap: 8px; }
.loan-list .tag-soft { font-size: 12.5px; padding: 5px 11px; margin-right: 0; }

/* 公司详情：授信额度合计行与未登记额度提示 */
table.table tfoot td {
  background: #f7fafd; font-weight: 600; color: #22384d;
  border-top: 1px solid #e2e9f1; white-space: nowrap;
}
table.table tfoot td:first-child { color: #5d7085; font-weight: 500; }
.quota-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px 10px; border-top: 1px dashed #e6edf5; }
.quota-note .tag-soft { font-size: 11.5px; }

/* 公司详情融资记录：发票张数可点击（弹窗看明细） */
a.inv-link { display: inline-block; padding: 0 7px; line-height: 19px; border-radius: 5px; background: #eef4fb; color: #1b6fd6; font-size: 12px; text-decoration: none; }
a.inv-link:hover { background: #dfeafb; color: #1259b3; }
#m-invs .modal-body { padding: 14px 18px 18px; }
#m-invs table.table td .t-sub { display: inline; }
#m-invs table.table th, #m-invs table.table td { white-space: nowrap; }
#m-invs table.table td.t-sub { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }

/* 额度台账：在贷业务 chips（点击弹窗看明细） */
td.biz-cell { min-width: 200px; vertical-align: middle; }
td.biz-cell .biz-mix { display: flex; flex-wrap: wrap; gap: 4px; cursor: pointer; }
td.biz-cell .biz-mix:hover .tag-soft { background: #e4eefb; }
td.biz-cell .tag-soft { margin-right: 0; font-size: 10.8px; padding: 0 5px; line-height: 18px; white-space: nowrap; }
.tag-more { display: inline-block; padding: 0 5px; line-height: 18px; border-radius: 5px; background: #e9eef6; color: #5d7085; font-size: 10.8px; }

/* ===== 贸易链路（需求 3.1-3.4）===== */
.flash.warn { background: #fff8e6; border: 1px solid #f3e0b5; color: #8a6116; }
.flow-axis {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11.5px; color: var(--muted); margin-bottom: 10px; gap: 12px;
}
.flow-axis .dir { display: inline-flex; align-items: center; gap: 5px; }
.flow-axis .dir.inv { color: var(--brand); }
.flow-axis .dir.pay { color: #2e9e6b; }
.flow-node .facts { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.flow-node .amt { font-size: 12px; color: var(--brand); margin-top: 6px; font-weight: 600; }
.flow-node.done { border-color: #cbeadd; background: #f7fdfa; }
.flow-node .pay-btn { margin-top: 9px; width: 100%; }
.node-paid {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px;
  color: #0b6b4c; background: var(--ok-bg); border: 1px solid #cbeadd;
  padding: 2px 8px; border-radius: 99px; margin-top: 8px;
}
.flow-arrow.back { color: #2e9e6b; }
.dup-list { margin: 8px 0 0; padding-left: 0; list-style: none; }
.dup-list li { font-size: 12.5px; padding: 5px 0; border-top: 1px dashed var(--line-2); display: flex; gap: 8px; align-items: center; }
.dup-list li:first-child { border-top: 0; }
.dup-tag { font-size: 11px; padding: 1px 7px; border-radius: 5px; background: #fff3d6; color: #8a6116; white-space: nowrap; }
.dup-tag.block { background: #fdecec; color: #a83535; }

/* ===== 菜单设置（侧边栏显示与隐藏） ===== */
.menu-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 1180px) { .menu-cards { grid-template-columns: 1fr; } }
.menu-card .card-head h3 { display: flex; align-items: center; gap: 8px; }
.switch-wrap { display: inline-flex; align-items: center; gap: 8px; }
.switch { position: relative; display: inline-block; width: 38px; height: 21px; vertical-align: middle; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; background: #cfd8e3; border-radius: 99px; transition: background .18s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(17, 38, 61, .22); transition: transform .18s; }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(17px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px var(--brand-soft); }
tr.menu-off td { color: #98a6b5; }
tr.menu-off td:first-child { text-decoration: line-through; }
.save-bar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding: 12px 18px;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ===== 多标签页导航（内容用 iframe 承载，切换不刷新） ===== */
body.is-shell { overflow: hidden; }
body.is-shell .app,
body.is-shell .main { height: 100vh; min-height: 0; }

.tabbar {
  flex: 0 0 auto;
  display: flex; align-items: flex-end; gap: 8px;
  padding: 9px 18px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 25;
}
.tab-scroll {
  display: flex; align-items: flex-end; gap: 4px;
  flex: 1; min-width: 0;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin;
}
.tab-scroll::-webkit-scrollbar { height: 4px; }
.tab {
  position: relative; flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 8px 0 13px;
  max-width: 210px;
  border: 1px solid transparent; border-bottom: 0;
  border-radius: 9px 9px 0 0;
  background: transparent; color: var(--muted);
  font-size: 13px; cursor: pointer; user-select: none;
  white-space: nowrap;
  transition: background .14s, color .14s;
}
.tab:hover { background: rgba(255, 255, 255, .72); color: var(--text); }
.tab.active {
  background: #fff; color: var(--brand); font-weight: 600;
  border-color: var(--line);
}
.tab.active::before {
  content: ""; position: absolute; left: 13px; right: 13px; top: -1px;
  height: 2px; border-radius: 0 0 2px 2px; background: var(--brand);
}
.tab.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 1px; background: #fff;
}
.tab .t-title { overflow: hidden; text-overflow: ellipsis; max-width: 166px; }
.tab .t-close {
  flex: 0 0 17px; width: 17px; height: 17px; padding: 0;
  border: 0; border-radius: 4px; background: transparent;
  color: #9aabbd; display: grid; place-items: center;
  cursor: pointer; opacity: 0; transition: opacity .12s, background .12s, color .12s;
}
.tab .t-close svg { width: 11px; height: 11px; }
.tab:hover .t-close, .tab.active .t-close { opacity: 1; }
.tab .t-close:hover { background: #eef3f9; color: var(--danger); }
.tab.locked .t-close { display: none; }

.tab-tools { flex: 0 0 auto; display: flex; gap: 2px; padding-bottom: 5px; }
.tab-tool {
  width: 26px; height: 26px; padding: 0;
  border: 0; border-radius: 6px; background: transparent;
  color: #8698ab; display: grid; place-items: center; cursor: pointer;
  transition: background .12s, color .12s;
}
.tab-tool:hover { background: #fff; color: var(--brand); }
.tab-tool svg { width: 14px; height: 14px; }

.tab-body { position: relative; flex: 1 1 auto; min-height: 0; background: var(--bg); }
.boot-pane { display: none; }
.tab-frame {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0; background: var(--bg);
  display: none;
}
.tab-frame.active { display: block; }
.tab-empty { padding: 90px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.tab-empty .big { font-size: 30px; opacity: .22; margin-bottom: 10px; }

/* 帧内页面：不再有顶栏，内容区自己滚动 */
body.in-frame { overflow-y: auto; }
body.in-frame .content { padding: 20px 24px 40px; }

/* ===== 用户与权限管理 ===== */
.role-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 18px; border-bottom: 1px solid var(--line-2); color: inherit;
}
.role-row:hover { background: #f8fbff; }
.role-row.on { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.role-row-main { min-width: 0; }
.role-row-name { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: #2b4055; }
.role-row.on .role-row-name { color: var(--brand); }
.role-row-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.role-row-arrow { color: #b7c6d6; font-size: 18px; line-height: 1; }

.perm-group { border: 1px solid var(--line-2); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.perm-group:last-child { margin-bottom: 0; }
.perm-group-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.perm-group-head h4 { margin: 0; font-size: 13px; color: #2b4055; letter-spacing: .2px; }
.perm-group-head .hint { font-size: 11.5px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.perm-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
@media (max-width: 1100px) { .perm-list { grid-template-columns: 1fr; } }
.perm-item {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 8px;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.perm-item:hover { border-color: #d3e2f5; background: #fafcff; }
.perm-item.checked { border-color: #bcd6f7; background: var(--brand-soft); }
.perm-item input { margin: 2px 0 0; accent-color: var(--brand); flex: 0 0 auto; cursor: pointer; }
.perm-item .p-name { display: block; font-size: 13px; color: #2b4055; font-weight: 500; }
.perm-item .p-desc { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.55; }
.perm-item input:disabled { cursor: not-allowed; }

/* ===== 公司资质材料（营业执照 / 公司章程 / 法定代表人 / 客户许可证 / 备案印章 / 股东身份证明 / 财务报表） ===== */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
@media (max-width: 780px) { .att-grid { grid-template-columns: 1fr; } }

.att-item {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; background: #fff; transition: border-color .15s, box-shadow .15s;
}
.att-item:hover { border-color: #d3e2f5; box-shadow: var(--shadow); }
.att-item.ready { border-color: #cfe6dc; }

.att-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.att-head b { font-size: 13px; color: #2b4055; font-weight: 600; }
.att-head .badge { margin-left: auto; }

.att-files { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; min-height: 4px; }
.att-file { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 12.5px; }
.att-file .file-ext {
  flex: 0 0 auto; font-size: 9.5px; font-weight: 700; letter-spacing: .4px;
  color: #fff; background: #8494a8; border-radius: 4px; padding: 2px 5px; line-height: 1.2;
}
.att-name { flex: 1 1 auto; min-width: 0; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-name:hover { color: var(--brand); }
.att-size { flex: 0 0 auto; font-size: 11px; color: var(--muted); }
.att-dl { flex: 0 0 auto; font-size: 12px; color: var(--brand); }
.att-del { flex: 0 0 auto; margin: 0; }
.att-del .link-btn { font-size: 12px; }
.att-empty { font-size: 12px; color: #a7b5c6; padding: 2px 0; }

.att-up { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; padding-top: 9px; border-top: 1px dashed var(--line); }
.att-input { display: none; }
.att-picked { font-size: 11.5px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-picked.on { color: var(--brand); }

.att-cell { min-width: 96px; }
.att-dots { display: flex; gap: 4px; margin-bottom: 4px; }
.att-dot { width: 9px; height: 9px; border-radius: 3px; background: #e3e9f2; display: inline-block; }
.att-dot.on { background: var(--ok); }

/* ============ 智能方案推荐（/biz/plan） ============ */
.plan-warn {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 9px 12px; margin-bottom: 6px; border-radius: 9px;
  background: var(--warn-bg); color: #8a5c00; font-size: 12.5px; line-height: 1.7;
}
.plan-warn:last-child { margin-bottom: 0; }
.plan-warn .warn-dot {
  flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%;
  background: var(--warn); margin-top: 7px;
}

.plan-group {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 14px 12px; margin-bottom: 10px; background: #fcfdff;
}
.plan-group:last-of-type { margin-bottom: 4px; }
.plan-group-head {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  padding-bottom: 9px; border-bottom: 1px dashed var(--line); margin-bottom: 10px;
}
.plan-group-head .pg-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.plan-group-head .pg-num { font-size: 12.5px; color: var(--muted); margin-left: auto; }
.plan-group-head .pg-num b { font-size: 15px; color: var(--brand); font-family: var(--mono, inherit); }
.plan-group-head .pg-sub { margin-left: 8px; font-size: 11.5px; color: #94a3b5; }
.plan-group-head .pg-tag { font-size: 11.5px; }

/* 背书路径：横向节点 + 箭头 */
.chain-flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 4px 0; }
.chain-node {
  display: inline-flex; flex-direction: column; justify-content: center;
  padding: 5px 10px; border-radius: 8px; background: #f1f5fa;
  border: 1px solid var(--line); max-width: 210px;
}
.chain-node b {
  font-size: 12.2px; font-weight: 600; color: #2c435c; line-height: 1.45;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chain-node i { font-style: normal; font-size: 10.5px; color: #8b9bb0; margin-top: 1px; }
.chain-node.origin { background: #eaf2fd; border-color: #cfe0f8; }
.chain-node.origin b { color: var(--brand-dark); }
.chain-node.payee { background: #f3f0ff; border-color: #ddd6fb; }
.chain-node.payee b { color: #5b46b8; }
.chain-node::after {
  content: '→'; align-self: flex-end; margin: 0 7px 0 0;
  color: #b3c0d1; font-size: 12px; line-height: 1;
}
.chain-node:last-of-type::after { content: '→'; }
.chain-tail {
  display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 8px;
  background: var(--ok-bg); color: #0b6b4c; font-size: 11.5px; border: 1px dashed #a9dcc6;
}

.plan-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.plan-actions .pa-info { font-size: 12.5px; color: var(--muted); line-height: 1.75; flex: 1 1 380px; }
.plan-actions .pa-info b { color: #35506b; }
.plan-actions .pa-btns { display: flex; gap: 8px; }

/* 发票勾选页：方案带入提示 */
.plan-banner {
  display: flex; flex-direction: column; gap: 3px;
  margin: 0 0 2px; padding: 10px 16px;
  background: var(--info-bg); border-bottom: 1px solid #d6e5fd;
  font-size: 12.5px; color: #24527f;
}
.plan-banner b { color: var(--brand-dark); font-size: 13px; }
.plan-banner span { color: #5b7290; font-size: 12px; }

@media (max-width: 760px) {
  .plan-group-head .pg-num { margin-left: 0; }
  .chain-node { max-width: 100%; }
}
