/* ==========================================================================
   基础样式：变量 / 重置 / 布局 / 侧栏 / 顶栏 / 表格 / 表单 / 弹窗
   设计语言（2026 企业级）：
     · 语义化 Design Tokens，全站只认 CSS 变量，换肤只改 :root
     · 极简装饰：扁平中性背景 + 1px 细边框 + 克制阴影，让数据当主角
     · 深石板色导航 + 单一品牌主色（靛蓝），状态色仅用于语义
     · 数字一律 tabular-nums 对齐，控件 8px 圆角、统一 32px 高度
   （按 base → theme 顺序引入）
   ========================================================================== */
:root {
    /* 中性色板 */
    --bg: #f3f5f8;
    --panel: #ffffff;
    --panel-2: #f8fafc;
    --border: #e2e8f0;
    --border-2: #edf1f5;
    --text: #0f172a;
    --text-2: #334155;
    --muted: #7c8aa0;

    /* 品牌色（靛蓝） */
    --brand: #186cff;
    --brand-2: #4b8bff;
    --brand-deep: #0b47c9;
    --brand-navy: #0f172a;
    --brand-soft: #eaf2ff;

    /* 语义色 */
    --ok: #16a34a;
    --ok-soft: #e9f9ef;
    --warn: #d97706;
    --warn-soft: #fdf3e3;
    --danger: #dc2626;
    --danger-soft: #fdeeee;
    --info: #0284c7;
    --info-soft: #e6f5fc;

    /* 圆角 / 阴影 / 焦点环 */
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .03);
    --shadow-lg: 0 8px 16px -6px rgba(15, 23, 42, .12), 0 24px 48px -12px rgba(15, 23, 42, .18);
    --glow: 0 0 0 3px rgba(24, 108, 255, .16);

    --sidebar-w: 236px;
    --topbar-h: 58px;

    /* 侧栏（深石板） */
    --sb-bg-1: #10192e;
    --sb-bg-2: #0b1222;
    --sb-text: #9fb0ca;
    --sb-text-hi: #eef3fb;
    --sb-line: rgba(148, 170, 210, .14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 14px; outline: none; }
::selection { background: rgba(24, 108, 255, .18); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 登录页 ---------------- */
.login-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(900px 480px at 10% -10%, rgba(24, 108, 255, .12) 0%, rgba(24, 108, 255, 0) 60%),
        radial-gradient(800px 460px at 105% 110%, rgba(124, 58, 237, .07) 0%, rgba(124, 58, 237, 0) 55%),
        var(--bg);
    padding: 24px;
}
.login-card {
    width: 100%; max-width: 940px; min-height: 500px;
    display: grid; grid-template-columns: 1.05fr .95fr;
    background: var(--panel); border-radius: 18px; overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, .6);
}
.login-left {
    padding: 52px 44px; color: #fff; position: relative; overflow: hidden;
    background: linear-gradient(160deg, #16233f 0%, #101a30 55%, #0a1120 100%);
}
.login-left::after {
    content: ""; position: absolute; right: -90px; bottom: -90px;
    width: 320px; height: 320px; border-radius: 50%;
    background: radial-gradient(circle, rgba(24, 108, 255, .22) 0%, rgba(24, 108, 255, 0) 70%);
}
.login-left::before {
    content: ""; position: absolute; right: 40px; top: -60px;
    width: 200px; height: 200px; border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, .16) 0%, rgba(99, 102, 241, 0) 70%);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; position: relative; }
.login-logo {
    width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.10);
    display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700;
    border: 1px solid rgba(255,255,255,.18);
}
.login-brand-txt b { display: block; font-size: 16px; letter-spacing: .5px; }
.login-brand-txt span { font-size: 12px; opacity: .6; letter-spacing: 2px; }
.login-left h1 { font-size: 29px; line-height: 1.35; font-weight: 700; margin-bottom: 16px; position: relative; letter-spacing: .5px; }
.login-left p.sub { font-size: 13.5px; line-height: 1.9; opacity: .72; position: relative; max-width: 340px; }
.login-chain { margin-top: 40px; position: relative; }
.login-chain .t { font-size: 12px; opacity: .5; letter-spacing: 2px; margin-bottom: 14px; }
.chain { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chain i {
    font-style: normal; font-size: 12px; padding: 5px 11px; border-radius: 8px;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
}
.chain .arrow { opacity: .4; font-size: 11px; }
.login-right { padding: 58px 46px; display: flex; flex-direction: column; justify-content: center; }
.login-right h2 { font-size: 21px; margin-bottom: 6px; color: var(--text); }
.login-right .tip { color: var(--muted); font-size: 13px; margin-bottom: 30px; }
.login-field { margin-bottom: 18px; }
.login-field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 7px; font-weight: 500; }
.login-field input {
    width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--panel-2); transition: .18s;
}
.login-field input:focus { border-color: var(--brand-2); background: #fff; box-shadow: var(--glow); }
.btn-login {
    width: 100%; height: 44px; border: none; border-radius: var(--radius-sm); cursor: pointer;
    background: var(--brand); color: #fff;
    font-size: 15px; font-weight: 600; letter-spacing: 4px; margin-top: 8px; transition: .18s;
}
.btn-login:hover { background: #0b5ae0; box-shadow: 0 8px 20px rgba(24, 108, 255, .30); }
.btn-login:disabled { opacity: .55; cursor: not-allowed; }
.login-err {
    margin-top: 14px; padding: 10px 13px; border-radius: var(--radius-sm);
    background: var(--danger-soft); color: var(--danger); font-size: 13px; display: none;
}
.login-err.show { display: block; }
.login-demo {
    margin-top: 26px; padding-top: 18px; border-top: 1px dashed var(--border);
    font-size: 12px; color: var(--muted); line-height: 1.6;
}
.login-demo strong { color: var(--text); font-weight: 700; }

/* ---------------- 主框架 ---------------- */
.layout { display: flex; height: 100vh; overflow: hidden; }

/* 侧边栏：深石板色导航 */
.sidebar {
    width: var(--sidebar-w); flex-shrink: 0; position: relative;
    background: linear-gradient(180deg, var(--sb-bg-1) 0%, var(--sb-bg-2) 100%);
    display: flex; flex-direction: column;
}
.sidebar::before {
    content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 1px;
    background: rgba(148, 170, 210, .18);
    z-index: 1;
}
.sb-brand {
    height: var(--topbar-h); display: flex; align-items: center; gap: 10px;
    padding: 0 16px; border-bottom: 1px solid var(--sb-line); flex-shrink: 0;
}
.sb-logo {
    width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
    background: linear-gradient(135deg, #4b8bff, #186cff); color: #fff;
    box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 4px 12px rgba(24, 108, 255, .4);
    display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.sb-brand-txt { overflow: hidden; }
.sb-brand-txt b { display: block; font-size: 13.5px; white-space: nowrap; color: #f2f6fd; }
.sb-brand-txt span { font-size: 10.5px; color: #7288ab; letter-spacing: .6px; white-space: nowrap; }
.sb-menu { flex: 1; overflow-y: auto; padding: 10px 10px 24px; position: relative; z-index: 1; }
.sb-group { margin-top: 14px; }
.sb-group-t {
    font-size: 11px; color: #5c7398; letter-spacing: 1.4px;
    padding: 6px 10px 7px; font-weight: 600;
}
/* 通用菜单项（白色卡片内，如用户菜单弹层） */
.sb-item {
    display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: var(--radius-sm);
    color: var(--text-2); cursor: pointer; margin-bottom: 2px; transition: .15s;
    font-size: 13.5px; white-space: nowrap; overflow: hidden;
}
.sb-item:hover { background: #f1f5f9; color: var(--brand); }
/* 侧边栏深色导航下的菜单项 */
.sidebar .sb-item { color: var(--sb-text); }
.sidebar .sb-item:hover { background: rgba(148, 170, 210, .10); color: var(--sb-text-hi); }
.sidebar .sb-item.active {
    background: linear-gradient(90deg, rgba(24, 108, 255, .95) 0%, rgba(24, 108, 255, .75) 100%);
    color: #fff; font-weight: 600;
    box-shadow: 0 4px 14px rgba(24, 108, 255, .35);
}
.sb-item .ico { width: 16px; text-align: center; flex-shrink: 0; font-size: 14px; opacity: .9; }
.sb-item .badge {
    margin-left: auto; background: var(--danger); color: #fff; font-size: 11px;
    padding: 1px 7px; border-radius: 10px; font-weight: 600;
}
.sidebar .sb-item .badge.badge-count { background: rgba(148, 170, 210, .16); color: #a9bcda; }
.sidebar .sb-item.active .badge.badge-count { background: rgba(255, 255, 255, .22); color: #fff; }
.sb-item .sb-kid {
    font-size: 11px; color: var(--muted); background: #eef2f7; border-radius: 8px;
    padding: 0 6px; margin-left: 2px; font-weight: 400;
}
.sidebar .sb-item .sb-kid { color: #8298bb; background: rgba(148, 170, 210, .13); }
.sidebar .sb-item.active .sb-kid { background: rgba(255, 255, 255, .2); color: #fff; }
.sb-foot { padding: 10px 14px; border-top: 1px solid var(--sb-line); font-size: 11px; color: #5c7398; position: relative; z-index: 1; }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
    height: var(--topbar-h); flex-shrink: 0; position: relative;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; padding: 0 20px; gap: 14px;
}
.crumb { font-size: 15px; font-weight: 600; color: var(--text); }
.crumb small { font-weight: 400; color: var(--muted); font-size: 12.5px; margin-left: 10px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.top-icon {
    position: relative; width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; color: var(--text-2);
    border: 1px solid transparent; transition: .15s; font-size: 16px;
}
.top-icon:hover { background: #f1f5f9; border-color: var(--border); }
.top-icon .dot {
    position: absolute; top: 5px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px;
    background: var(--danger); color: #fff; border-radius: 9px; font-size: 10px; line-height: 16px;
    text-align: center; font-weight: 600;
}
.user-box { display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 4px 9px 4px 4px; border-radius: 20px; transition: .15s; }
.user-box:hover { background: #f1f5f9; }
.avatar {
    width: 30px; height: 30px; border-radius: 50%; color: #fff; font-size: 12.5px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #4b8bff, #186cff);
    box-shadow: 0 0 0 2px #e8eefc;
}
.user-box .nm { font-size: 13px; line-height: 1.25; }
.user-box .nm span { display: block; font-size: 11px; color: var(--muted); }

.content { flex: 1; overflow-y: auto; padding: 18px 20px 40px; }

/* ---------------- 通用组件 ---------------- */
.card {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-h {
    display: flex; align-items: center; gap: 10px; padding: 13px 16px;
    border-bottom: 1px solid var(--border-2);
}
.card-h h3 { font-size: 14.5px; font-weight: 600; }
.card-h .sub { font-size: 12px; color: var(--muted); }
.card-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-b { padding: 16px; }

.btn {
    height: 32px; padding: 0 13px; border-radius: var(--radius-sm); cursor: pointer;
    border: 1px solid var(--border); background: #fff; color: var(--text-2); font-size: 13px;
    display: inline-flex; align-items: center; gap: 5px; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #cbd5e1; color: var(--brand); background: #f8fafc; }
.btn:active { transform: translateY(.5px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
.btn-primary:hover { background: #0b5ae0; border-color: #0b5ae0; color: #fff; box-shadow: 0 4px 12px rgba(24, 108, 255, .28); }
.btn-danger { color: var(--danger); border-color: #f3c6c6; }
.btn-danger:hover { background: var(--danger-soft); border-color: #ecabab; color: var(--danger); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { color: #fff; filter: brightness(1.06); }
.btn-sm { height: 27px; padding: 0 9px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-link { border: none; background: none; color: var(--brand); padding: 0 4px; height: auto; cursor: pointer; font-size: 13px; }
.btn-link:hover { text-decoration: underline; background: none; }
.btn-link.danger { color: var(--danger); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 15px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand-2); }
.kpi.g::before { background: var(--ok); }
.kpi.o::before { background: var(--warn); }
.kpi.r::before { background: var(--danger); }
.kpi.i::before { background: var(--info); }
.kpi .lb { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 5px; }
.kpi .vl { font-size: 23px; font-weight: 700; color: var(--text); letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.kpi .vl small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.kpi .ft { font-size: 11.5px; color: var(--muted); margin-top: 7px; }
.kpi .ft b { color: var(--brand); font-weight: 600; }
/* KPI 右上角补充指标（如「今年合同额」）：不与左侧主数字重叠 */
.kpi .corner {
    position: absolute; right: 14px; top: 14px; z-index: 2;
    display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
    padding: 4px 9px; border-radius: 8px;
    background: linear-gradient(135deg, rgba(59,110,246,.09), rgba(6,182,212,.07));
    border: 1px solid rgba(59,110,246,.16);
    line-height: 1.25; pointer-events: none;
}
.kpi .corner .ck-t { font-size: 10.5px; color: var(--muted); }
.kpi .corner .ck-v { font-size: 13px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .corner .ck-s { font-size: 10px; color: var(--muted); }

.warn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); gap: 12px; }
.warn-card {
    background: #fff; border: 1px solid var(--border); border-left: 3px solid var(--muted);
    border-radius: var(--radius); padding: 14px 15px; cursor: pointer; transition: .16s;
    box-shadow: var(--shadow);
}
.warn-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15, 23, 42, .10); }
.warn-card.lv-紧急 { border-left-color: var(--danger); }
.warn-card.lv-警告 { border-left-color: var(--warn); }
.warn-card.lv-提醒 { border-left-color: var(--info); }
.warn-card.lv-正常 { border-left-color: var(--ok); }
.warn-card .wt { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); margin-bottom: 9px; }
.warn-card .lv {
    font-size: 10.5px; padding: 1.5px 6px; border-radius: 4px; font-weight: 600;
}
.lv-紧急 .lv { background: var(--danger-soft); color: var(--danger); }
.lv-警告 .lv { background: var(--warn-soft); color: var(--warn); }
.lv-提醒 .lv { background: var(--info-soft); color: var(--info); }
.lv-正常 .lv { background: var(--ok-soft); color: var(--ok); }
.warn-card .wv { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.warn-card .wv small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.warn-card .wd { font-size: 11.5px; color: var(--muted); margin-top: 7px; line-height: 1.6; }

.chart-row { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; margin-top: 14px; }
.chart-row.eq { grid-template-columns: 1fr 1fr; }
@media (max-width: 1080px) { .chart-row, .chart-row.eq { grid-template-columns: 1fr; } }

.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.legend span { font-size: 12px; color: var(--text-2); }

/* ---------------- 表格页 ---------------- */
.toolbar {
    display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
    padding: 12px 14px; border-bottom: 1px solid var(--border-2);
}
.toolbar .sp { margin-left: auto; }

/* 数据范围徽标 */
.scope-strip {
    display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
    padding: 8px 14px; background: var(--panel-2); border-bottom: 1px solid var(--border-2);
    font-size: 12.5px;
}
.scope-strip .tag { font-size: 12px; }

/* 嵌入型子台账提示条（如：合同已并入项目管理下） */
.embed-tip {
    padding: 9px 16px; background: var(--brand-soft); border-bottom: 1px solid var(--border-2);
    font-size: 12.5px; color: var(--text-2);
}
.embed-tip b { color: var(--brand); }
table.gt.sm th, table.gt.sm td { padding: 6px 9px; font-size: 12.5px; }

/* 选项字典（合同类型等业务字典维护） */
.dict-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 4px 0 2px; }
.dict-chips .chip {
    display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px;
    background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 10px; font-size: 12.5px;
}
.dict-chips .chip b { cursor: pointer; color: var(--danger); font-weight: 700; padding: 0 2px; }
.dict-chips .chip b:hover { background: rgba(220, 38, 38, .12); border-radius: 50%; }
.search-box { position: relative; }
.search-box input {
    height: 32px; padding: 0 11px 0 31px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: #fff; width: 210px; transition: .16s;
}
.search-box input:focus { border-color: var(--brand-2); width: 250px; box-shadow: var(--glow); }
.search-box .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
select.ipt, input.ipt, textarea.ipt {
    height: 32px; padding: 0 9px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: #fff; color: var(--text); transition: .16s; max-width: 190px;
}
select.ipt:focus, input.ipt:focus, textarea.ipt:focus { border-color: var(--brand-2); box-shadow: var(--glow); }

.table-wrap { overflow: auto; max-height: calc(100vh - 300px); }
table.gt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.gt thead th {
    position: sticky; top: 0; z-index: 2; background: var(--panel-2); color: var(--muted);
    font-weight: 600; font-size: 12px; text-align: left; padding: 10px 11px;
    border-bottom: 1px solid var(--border); white-space: nowrap;
    letter-spacing: .3px;
}
table.gt thead th.sortable { cursor: pointer; user-select: none; }
table.gt thead th.sortable:hover { color: var(--brand); }
table.gt tbody td {
    padding: 9px 11px; border-bottom: 1px solid var(--border-2); vertical-align: middle;
    white-space: nowrap; max-width: 300px; overflow: hidden; text-overflow: ellipsis;
}
table.gt tbody tr:hover { background: #f6f9fd; }
table.gt tbody tr.sel { background: var(--brand-soft); }
table.gt .num { text-align: right; font-variant-numeric: tabular-nums; }
/* 显式居中：与 .num 同用时覆盖右对齐（结算明细/合同清单的金额、工程量列） */
table.gt td.tc, table.gt th.tc { text-align: center; }
input.ipt.tc { text-align: center; }
table.gt .mono { font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace; font-size: 12.5px; color: var(--brand); font-weight: 600; }
table.gt .acts { white-space: nowrap; }
/* 名称类长文本（合同名称 / 项目名称 / 关联显示标签）：完整换行显示，不再用省略号截断 */
table.gt tbody td.cell-name,
table.gt tbody td .cell-name { white-space: normal; word-break: break-word; overflow: visible; text-overflow: clip; line-height: 1.55; }
table.gt tbody td.cell-name { max-width: 420px; vertical-align: top; padding-top: 8px; }
table.gt tbody td .tag.cell-name { display: inline-block; max-width: 100%; text-align: left; }
table.gt tfoot td {
    position: sticky; bottom: 0; background: var(--panel-2); font-weight: 600;
    padding: 9px 11px; border-top: 1px solid var(--border); font-size: 12.5px;
}
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty .e-ico { font-size: 40px; opacity: .32; margin-bottom: 10px; }

.tag {
    display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px;
    background: #eef2f7; color: var(--text-2); white-space: nowrap;
}
.tag.b { background: var(--brand-soft); color: var(--brand); }
.tag.g { background: var(--ok-soft); color: var(--ok); }
.tag.o { background: var(--warn-soft); color: var(--warn); }
.tag.r { background: var(--danger-soft); color: var(--danger); }
.tag.i { background: var(--info-soft); color: var(--info); }
.tag.p { background: #f3efff; color: #7c3aed; }

.pager { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.pager .sp { margin-left: auto; }
.pager .pg {
    min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--border); background: #fff;
    border-radius: var(--radius-sm); cursor: pointer; color: var(--text-2); transition: .15s;
}
.pager .pg:hover { border-color: var(--brand-2); color: var(--brand); }
.pager .pg.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager .pg:disabled { opacity: .4; cursor: not-allowed; }

/* ---------------- 弹窗 ---------------- */
.mask {
    position: fixed; inset: 0; background: rgba(10, 18, 32, .46); z-index: 900;
    backdrop-filter: blur(3px);
    display: flex; align-items: flex-start; justify-content: center; padding: 34px 20px;
    overflow-y: auto; animation: fadeIn .16s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes popIn { from { opacity: 0; transform: translateY(-10px) scale(.99) } to { opacity: 1; transform: none } }
.modal {
    background: #fff; border-radius: 14px; width: 100%; max-width: 880px;
    box-shadow: var(--shadow-lg); animation: popIn .2s ease; overflow: hidden;
    display: flex; flex-direction: column; max-height: calc(100vh - 68px);
    border: 1px solid rgba(15, 23, 42, .06);
}
.modal.sm { max-width: 480px; }
.modal.md { max-width: 640px; }
.modal.lg { max-width: 1080px; }
.modal-h {
    display: flex; align-items: center; gap: 10px; padding: 15px 20px;
    border-bottom: 1px solid var(--border-2); flex-shrink: 0;
}
.modal-h h3 { font-size: 15.5px; font-weight: 600; }
.modal-h .sub { font-size: 12px; color: var(--muted); }
.modal-h .x {
    margin-left: auto; width: 30px; height: 30px; border-radius: 7px; border: none; background: none;
    cursor: pointer; color: var(--muted); font-size: 19px; line-height: 1;
}
.modal-h .x:hover { background: #f1f5f9; color: var(--text); }
.modal-b { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-f {
    display: flex; align-items: center; gap: 9px; padding: 13px 20px;
    border-top: 1px solid var(--border-2); background: var(--panel-2); flex-shrink: 0;
}
.modal-f .sp { margin-left: auto; }

/* ---------------- 表单 ---------------- */
.form-group { margin-bottom: 20px; }
.form-group-t {
    font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 13px;
    padding-left: 9px; border-left: 3px solid var(--brand-2); line-height: 1.2;
    display: flex; align-items: center; gap: 8px;
}
.form-group-t small { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
@media (max-width: 760px) { .form-grid { grid-template-columns: 1fr; } }
.ff { display: flex; flex-direction: column; }
.ff.full { grid-column: 1 / -1; }
.ff label { font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; display: flex; align-items: center; gap: 5px; }
.ff label .req { color: var(--danger); font-weight: 700; }
.ff label .unit { font-size: 11.5px; color: var(--muted); font-weight: 400; margin-left: auto; }
.ff input, .ff select, .ff textarea {
    width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: #fff; color: var(--text); transition: .16s;
}
.ff textarea { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; line-height: 1.7; }
.ff input:focus, .ff select:focus, .ff textarea:focus { border-color: var(--brand-2); box-shadow: var(--glow); }
.ff input:disabled, .ff select:disabled, .ff textarea:disabled,
.ff input[readonly], .ff textarea[readonly] {
    background: var(--panel-2); color: var(--text-2); cursor: not-allowed;
}
.ff .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.55; }
.ff .err { font-size: 11.5px; color: var(--danger); margin-top: 5px; }
.ff.has-err input, .ff.has-err select, .ff.has-err textarea { border-color: #eba3a3; background: #fffbfb; }
.ff .computed-tip { font-size: 11.5px; color: var(--info); margin-top: 5px; }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-row .rd {
    padding: 6px 13px; border: 1px solid var(--border); border-radius: 16px; cursor: pointer;
    font-size: 13px; color: var(--text-2); transition: .15s; background: #fff;
}
.radio-row .rd:hover { border-color: #cbd5e1; }
.radio-row .rd.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }

.form-note {
    margin-top: 22px; padding: 14px 16px; border-radius: var(--radius);
    background: var(--panel-2); border: 1px solid var(--border-2); border-left: 3px solid var(--brand-2);
}
.form-note .nt { font-size: 13px; font-weight: 600; margin-bottom: 9px; display: flex; align-items: center; gap: 6px; }
.form-note ol { margin: 0; padding-left: 19px; }
.form-note li { font-size: 12.5px; color: var(--text-2); line-height: 1.95; }
.form-note li b { color: var(--brand); font-weight: 600; }
.form-note .fn-biz { padding-left: 19px; margin-bottom: 10px; }
.form-note .fn-biz li { color: var(--text); line-height: 2.05; }
.form-note .fn-gen { font-size: 12px; color: var(--muted); margin: 2px 0 4px; }
.form-note .fn-gen b { color: var(--brand); }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--border); padding: 0 16px; background: #fff; }
.tab {
    padding: 11px 15px; font-size: 13.5px; color: var(--text-2); cursor: pointer;
    border-bottom: 2px solid transparent; transition: .15s; margin-bottom: -1px;
}
.tab:hover { color: var(--brand); }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab .cnt {
    display: inline-block; margin-left: 5px; background: #eef2f7; color: var(--text-2);
    font-size: 11px; padding: 0 6px; border-radius: 9px; min-width: 17px; text-align: center;
}
.tab.on .cnt { background: var(--brand); color: #fff; }

/* ---------------- 记录详情页（上信息 / 下页签） ---------------- */
.pv-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pv-head .grow { min-width: 220px; }
.pv-head .pv-t { font-size: 17.5px; font-weight: 600; color: var(--text); line-height: 1.35; }
.pv-sec { margin-bottom: 14px; }
.pv-err {
    margin-bottom: 12px; padding: 10px 14px; border-radius: var(--radius-sm);
    background: var(--danger-soft); border: 1px solid #f3c6c6; color: var(--danger); font-size: 13px;
}
.pv-body-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(430px, 1fr)); gap: 0 22px; }
.pv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px 20px; }
.pv-stat {
    display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
    padding: 10px 16px; background: var(--panel-2); border-bottom: 1px solid var(--border-2);
    font-size: 12.5px; color: var(--text-2);
}
.pv-stat b { color: var(--brand); font-weight: 600; font-variant-numeric: tabular-nums; }
.tab-toolbar {
    display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
    padding: 10px 14px; border-bottom: 1px solid var(--border-2);
}
.tab-toolbar .sp { margin-left: auto; }
.tab-toolbar .search-box input { height: 28px; width: 190px; }
.tab-toolbar .search-box input:focus { width: 240px; }
/* 页签内的表格留足可视高度，避免与页面自身滚动嵌套 */
#tvBody .table-wrap { max-height: calc(100vh - 200px); min-height: 160px; }

/* ---------------- 时间线 ---------------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item::before {
    content: ""; position: absolute; left: -20px; top: 4px; width: 11px; height: 11px;
    border-radius: 50%; background: #fff; border: 2px solid var(--border);
}
.tl-item.done::before { border-color: var(--ok); background: var(--ok); }
.tl-item.now::before { border-color: var(--brand); background: var(--brand); box-shadow: 0 0 0 4px rgba(24, 108, 255, .18); }
.tl-item.rej::before { border-color: var(--danger); background: var(--danger); }
.tl-item .tt { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.tl-item .tm { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.tl-item .tc {
    font-size: 12.5px; color: var(--text-2); margin-top: 7px; padding: 8px 11px;
    background: var(--panel-2); border-radius: var(--radius-sm); border: 1px solid var(--border-2); line-height: 1.7;
}

/* ---------------- 描述列表 ---------------- */
.dl { display: grid; grid-template-columns: 128px 1fr; gap: 0; font-size: 13px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); overflow: hidden; }
.dl dt { background: var(--panel-2); padding: 9px 12px; color: var(--muted); border-bottom: 1px solid var(--border-2); font-weight: 500; }
.dl dd { padding: 9px 12px; border-bottom: 1px solid var(--border-2); margin: 0; word-break: break-all; }
.dl dt:last-of-type, .dl dd:last-of-type { border-bottom: none; }

/* 详情整体折叠：收起时只留约 5 行高，底部渐隐，点击展开 */
.pv-info-fold { overflow: hidden; position: relative; transition: max-height .25s ease; }
.pv-info-fold:not(.open)::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 46px;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #ffffff 88%);
    pointer-events: none;
}
.pv-info-fold-toggle {
    margin-top: 8px; padding: 6px 12px; text-align: center; cursor: pointer;
    user-select: none; font-size: 12px; color: #186cff; border: 1px dashed #c3daff;
    border-radius: 6px; background: #f7faff;
}
.pv-info-fold-toggle:hover { background: #eaf2ff; }
.pv-info-fold-toggle .fold-arrow { font-style: normal; margin-left: 2px; }

/* ---------------- Toast ---------------- */
.toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 9px; align-items: center; }
.toast {
    padding: 10px 18px; border-radius: 10px; background: #fff; color: var(--text);
    box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; align-items: center; gap: 9px;
    animation: popIn .2s ease; border: 1px solid var(--border); max-width: 560px;
}
.toast.ok { border-left: 3px solid var(--ok); }
.toast.err { border-left: 3px solid var(--danger); }
.toast.warn { border-left: 3px solid var(--warn); }
.toast.info { border-left: 3px solid var(--info); }

/* ---------------- 配置页 ---------------- */
.cfg-layout { display: grid; grid-template-columns: 232px 1fr; gap: 12px; align-items: start; }
@media (max-width: 980px) { .cfg-layout { grid-template-columns: 1fr; } }
.cfg-list { max-height: calc(100vh - 160px); overflow-y: auto; }
.cfg-item { padding: 10px 13px; cursor: pointer; border-bottom: 1px solid var(--border-2); transition: .15s; }
.cfg-item:hover { background: #f8fafc; }
.cfg-item.on { background: var(--brand-soft); }
.cfg-item.on .ci-t { color: var(--brand); font-weight: 600; }
.cfg-item .ci-t { font-size: 13px; }
.cfg-item .ci-d { font-size: 11px; color: var(--muted); margin-top: 3px; }
.perm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.perm-table th, .perm-table td { padding: 9px 11px; border-bottom: 1px solid var(--border-2); text-align: left; }
.perm-table th { background: var(--panel-2); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.perm-table td.c { text-align: center; }
.perm-table input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--brand); }

.switch { position: relative; display: inline-block; width: 38px; height: 21px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .sl {
    position: absolute; cursor: pointer; inset: 0; background: #cbd5e1;
    border-radius: 21px; transition: .2s;
}
.switch .sl::before {
    content: ""; position: absolute; height: 15px; width: 15px; left: 3px; bottom: 3px;
    background: #fff; border-radius: 50%; transition: .2s;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .25);
}
.switch input:checked + .sl { background: var(--brand); }
.switch input:checked + .sl::before { transform: translateX(17px); }

.section-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.section-title small { font-weight: 400; color: var(--muted); font-size: 12px; }
.mb12 { margin-bottom: 12px; }
.mb16 { margin-bottom: 16px; }
.mt12 { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono-n { font-variant-numeric: tabular-nums; }

/* ---------------- 个人中心 ---------------- */
.pf-head { margin-bottom: 14px; overflow: hidden; position: relative; }
.pf-head::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 72px;
    background: linear-gradient(120deg, rgba(24, 108, 255, .12), rgba(124, 58, 237, .05) 60%, transparent);
}
.pf-head-b { display: flex; align-items: center; gap: 16px; padding: 18px 20px; position: relative; }
.pf-avatar {
    width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, #4b8bff, #186cff);
    box-shadow: 0 6px 18px rgba(24, 108, 255, .28);
}
.pf-name { font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pf-acts { margin-left: auto; display: flex; gap: 8px; }
.pf-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; align-items: start; }
@media (max-width: 980px) { .pf-grid { grid-template-columns: 1fr; } }
/* 表单内只读账号信息条（人员编辑弹窗） */
.acc-readonly {
    display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
    padding: 8px 12px; background: var(--panel-2); border: 1px dashed var(--border);
    border-radius: var(--radius-sm); font-size: 12.5px;
}

/* ---------------- 项目阶段多选筛选（工具栏右上角） ---------------- */
.mselect { position: relative; display: inline-block; }
.mselect-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff;
    font-size: 12.5px; color: var(--text-2); cursor: pointer; transition: .15s; white-space: nowrap;
}
.mselect-btn:hover, .mselect.open .mselect-btn {
    border-color: var(--brand-2); color: var(--brand); box-shadow: var(--glow);
}
.mselect-btn .ms-ico { font-size: 12px; }
.mselect-btn .cnt {
    min-width: 20px; text-align: center; background: var(--brand-soft); color: var(--brand);
    font-weight: 600; border-radius: 9px; padding: 0 7px; font-size: 11.5px;
}
.mselect-btn .caret { font-size: 10px; color: var(--muted); transition: .15s; }
.mselect.open .mselect-btn .caret { transform: rotate(180deg); }
.mselect-panel {
    position: absolute; right: 0; top: calc(100% + 6px); width: 208px; max-height: 296px; overflow: auto;
    background: #fff; border: 1px solid var(--border); border-radius: 10px;
    box-shadow: var(--shadow-lg); z-index: 600; padding: 9px; display: none;
    animation: popIn .16s ease;
}
.mselect.open .mselect-panel { display: block; }
.mselect-acts {
    display: flex; gap: 12px; padding: 2px 5px 8px; margin-bottom: 5px;
    border-bottom: 1px dashed var(--border-2); font-size: 12px;
}
.mselect-acts a { color: var(--brand); cursor: pointer; }
.mselect-acts a:hover { text-decoration: underline; }
.mselect-panel label {
    display: flex; align-items: center; gap: 8px; padding: 5px 7px; border-radius: 6px;
    font-size: 12.5px; color: var(--text-2); cursor: pointer; transition: .12s;
}
.mselect-panel label:hover { background: var(--brand-soft); color: var(--brand); }
.mselect-panel input[type=checkbox] { width: 14px; height: 14px; accent-color: var(--brand); cursor: pointer; }

/* ---------------- 品牌细节点缀 ---------------- */
/* KPI 卡片：顶部一道品牌细线 */
.kpi { border-color: var(--border); }
.kpi::after {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
    background: linear-gradient(90deg, rgba(24, 108, 255, .5), rgba(24, 108, 255, .05) 60%);
}
/* 卡片 hover 轻微上浮 */
.card { transition: box-shadow .18s; }

/* ---------------- 发票识别导入 ---------------- */
.ii-bar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding-bottom: 12px; border-bottom: 1px dashed var(--border-2); margin-bottom: 12px;
}
.ii-bar label { font-size: 12.5px; color: var(--text-2); }
.ii-bar select.ipt { max-width: 230px; }
.ii-drop {
    border: 1.5px dashed #c3d0e5; border-radius: 10px; background: var(--panel-2);
    padding: 20px 14px; text-align: center; cursor: pointer; transition: .15s; color: var(--text-2);
}
.ii-drop:hover, .ii-drop.on { border-color: var(--brand-2); background: var(--brand-soft); }
.ii-drop.busy { opacity: .65; pointer-events: none; }
.ii-drop-ico { font-size: 26px; line-height: 1.2; margin-bottom: 2px; }
.ii-link { color: var(--brand); text-decoration: underline; }
.ii-paste { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0; }
.ii-paste textarea {
    flex: 1; min-height: 62px; padding: 8px 10px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); resize: vertical; line-height: 1.6; font-size: 13px;
}
.ii-paste textarea:focus { border-color: var(--brand-2); box-shadow: var(--glow); }
.ii-table { max-height: 320px; }
.ii-table .ipt.sm { height: 30px; padding: 0 6px; font-size: 12.5px; }
.ii-table td { padding: 6px 8px; vertical-align: middle; }
.ii-empty {
    padding: 22px; text-align: center; background: var(--panel-2);
    border: 1px dashed var(--border); border-radius: 8px;
}
.ii-tip { padding: 10px 2px 0; line-height: 1.7; }

/* ==========================================================================
   可搜索下拉（筛选栏 / 表单关联字段）
   ========================================================================== */
.ssel { position: relative; display: inline-block; min-width: 132px; }
.ssel-native { display: none !important; }
.ssel-input {
    width: 100%; height: 30px; padding: 0 26px 0 9px; font-size: 12.5px;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff;
    color: var(--text); cursor: text;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                      linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 13px) 13px, calc(100% - 9px) 13px;
    background-size: 4px 4px, 4px 4px;
    background-repeat: no-repeat;
}
.ssel-input:focus { outline: none; border-color: var(--brand-2); box-shadow: var(--glow); }
.ssel-panel {
    display: none; position: absolute; z-index: 80; left: 0; top: calc(100% + 4px);
    min-width: 100%; max-width: 460px; max-height: 264px; overflow: auto;
    padding: 4px; background: #fff; border: 1px solid var(--border);
    border-radius: 10px; box-shadow: var(--shadow-lg);
}
.ssel.open .ssel-panel { display: block; }
.ssel-item {
    padding: 7px 9px; font-size: 13px; line-height: 1.35; border-radius: 6px;
    cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ssel-item:hover, .ssel-item.on { background: var(--brand-soft); }
.ssel-item.cur { color: var(--brand); font-weight: 600; }
.ssel-empty { padding: 10px; text-align: center; font-size: 12.5px; color: var(--muted); }
/* 表单内：占满字段宽度 */
.ff .ssel, .ff .ssel-input { display: block; width: 100%; }
.ff .ssel { min-width: 0; }

/* 发票文件：查看 / 下载 */
.file-link { color: var(--brand); text-decoration: none; font-size: 12.5px; }
.file-link:hover { text-decoration: underline; }
.file-dl {
    display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 4px;
    color: var(--brand); text-decoration: none; font-size: 12.5px;
    background: var(--brand-soft);
}
.file-dl:hover { background: #ddeaff; }

/* ==========================================================================
   视图切换 + 按项目分组（项目 → 收入/支出 二级折叠）
   ========================================================================== */
.vswitch {
    display: inline-flex; gap: 2px; padding: 2px; margin-right: 8px;
    background: #e9eef5; border-radius: 8px;
}
.vswitch button {
    border: 0; background: transparent; color: var(--text-2); font-size: 12.5px;
    padding: 5px 11px; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.vswitch button:hover { color: var(--brand); }
.vswitch button.on {
    background: #fff; color: var(--brand); font-weight: 600;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

/* 分组折叠（项目 / 收支 / 清单分级）样式已整体迁移到 collapse-arco.css
   —— Arco Design Vue Collapse 规范：白底标题栏、IconRight 箭头 90° 旋转、#f7f8fa 内容区 */

/* 分组视图内嵌发票区：收付款项目内「收→销项 / 支→进项」发票及开票时间 */
.gtable tbody tr.g-inv td {
    background: #fbfcfe; padding: 6px 14px 8px 34px; font-weight: 400;
}
.gtable tbody tr.g-inv.inc td { border-left: 3px solid #86d3a8; }
.gtable tbody tr.g-inv.exp td { border-left: 3px solid #f0b47c; }
.g-inv-hd { font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; }
.g-inv-hd b { color: var(--text); font-weight: 600; }
.g-inv-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.g-inv-item {
    display: inline-flex; align-items: center; gap: 8px; padding: 3px 9px;
    font-size: 12px; background: #fff; border: 1px solid var(--border); border-radius: 14px;
}
.g-inv-no { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--text-2); }
.g-inv-date { color: var(--brand); }
.g-inv-amt { font-weight: 600; }
.g-inv-more { font-size: 12px; color: var(--text-2); }
.g-tip { padding: 10px 14px; font-size: 12.5px; color: var(--warn); }

/* 收付款台账：按项目合并的流水账版式（项目名通栏标题行，收支按列区分） */
/* 整表加框线：表元素画「上 / 左」，单元格画「右 / 下」，相邻单元格不叠双线 */
.ptable {
    border-collapse: separate; border-spacing: 0;
    border-top: 1px solid var(--border); border-left: 1px solid var(--border);
}
.ptable thead th, .ptable tbody td {
    border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.ptable thead th { border-bottom: 1px solid var(--border); }
.ptable tbody tr:last-child td { border-bottom: none; }
/* 收付款通栏分组标题行样式已迁移到 collapse-arco.css（.ac-item-pay） */
.ptable td.p-summ { color: var(--text-2); }
.ptable td.num b { font-weight: 700; font-variant-numeric: tabular-nums; }
.ptable tbody tr.p-row:hover td { background: #f6f9fd; }
/* 摘要：双击就地编辑（财务记账摘要） */
.ptable td.p-summ.p-edit { cursor: text; color: var(--text); }
.ptable td.p-summ.p-edit:hover { background: #fffbe8; box-shadow: inset 0 0 0 1px #f0d794; }
.p-hint { color: #98a2b3; font-size: 11.5px; }
.p-invno { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; color: #98a2b3; }
/* 摘要列定宽：文本长短不影响列宽（超出省略号），保存后整表不重排 */
.ptable th.psum, .ptable td.p-summ { width: 210px; max-width: 210px; }
.ptable td.p-summ { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
/* 摘要就地编辑：输入框绝对定位盖在单元格内容上（不参与列宽 / 行高计算，
   否则双击编辑会让整表重排、单元格跳动） */
.ptable td.p-summ { position: relative; }
.ptable td.p-summ.p-editing { overflow: visible; }
.ptable td.p-summ input.p-sum-ed {
    position: absolute; left: 0; right: 0; top: 0; bottom: 0;
    width: 100%; height: 100%; box-sizing: border-box; margin: 0;
    padding: 0 10px; border: 1px solid var(--brand-2); border-radius: 0;
    background: #fff; font-size: 12.5px; color: var(--text); z-index: 2;
}
.ptable td.p-bal b { color: #c2570c; }
/* 邮件提醒弹窗：正文多行输入占满宽度（选择器需压过 textarea.ipt） */
textarea.ipt.rm-body {
    width: 100%; max-width: 100%; height: 260px; padding: 10px 12px; line-height: 1.7;
    font-size: 12.5px; font-family: inherit; resize: vertical;
}

/* ==========================================================================
   业务附件（合同 / 产值 / 发票）：上传、查看、下载
   ========================================================================== */
.att { display: flex; flex-direction: column; gap: 6px; }
.att-list { display: flex; flex-wrap: wrap; gap: 6px; min-height: 20px; }
.att-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; font-size: 12.5px; border-radius: 16px;
    background: var(--brand-soft); border: 1px solid #d6e5ff; max-width: 100%;
}
.att-chip a { color: var(--brand); text-decoration: none; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.att-chip a:hover { text-decoration: underline; }
.att-chip .att-dl { color: var(--brand-2); font-size: 12px; }
.att-chip .att-rm {
    border: 0; background: transparent; color: var(--muted); cursor: pointer;
    font-size: 11px; padding: 0 2px; line-height: 1;
}
.att-chip .att-rm:hover { color: var(--danger); }
.att-empty { font-size: 12.5px; color: var(--muted); }
.att-add { position: relative; overflow: hidden; align-self: flex-start; cursor: pointer; }
.att-add input[type=file] { position: absolute; left: -9999px; }
.att-add.is-busy { opacity: .55; pointer-events: none; }
.att-add-t { white-space: nowrap; }
.att-tip { font-size: 12px; color: var(--muted); }

/* ==========================================================================
   弹窗内页签（发票新增：新增发票台账 / 导入识别）
   ========================================================================== */
.mtabs {
    display: flex; gap: 4px; border-bottom: 1px solid var(--border);
    margin: -2px 0 14px;
}
.mtab {
    padding: 9px 16px; font-size: 13.5px; color: var(--text-2); cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500;
    user-select: none; transition: color .15s, border-color .15s;
}
.mtab:hover { color: var(--brand); }
.mtab.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* 列表「项目名称」跳转链接 */
.cell-link { color: var(--brand); cursor: pointer; font-weight: 500; text-decoration: none; }
.cell-link:hover { text-decoration: underline; }

/* 项目详情：金额汇总条 */
.pv-money { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.pv-money .pm {
    flex: 1 1 150px; min-width: 132px; background: #fff; border: 1px solid var(--border-2);
    border-radius: 9px; padding: 9px 13px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.pv-money .pm i {
    display: block; font-style: normal; font-size: 11.5px; color: var(--muted); margin-bottom: 3px;
}
.pv-money .pm b {
    font-size: 16px; font-weight: 600; color: var(--text);
    font-variant-numeric: tabular-nums; letter-spacing: .2px;
}
.pv-money .pm.hl { background: linear-gradient(180deg, #f2f7ff, #fff); border-color: #d4e2fd; }
.pv-money .pm.hl b { color: var(--brand); }
.pv-money .pm.neg b { color: var(--danger); }

/* 导入识别：方向自动判定时的高亮提示 */
.ii-bar select.ipt.flash { border-color: var(--brand-2); box-shadow: var(--glow); }

/* ==========================================================================
   省 / 市 / 区（县）三级下拉 + 具体地址（项目地址）
   ========================================================================== */
.rg { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
.rg .ipt { flex: 1 1 118px; min-width: 104px; }
.rg .rg-x { flex: 2 1 240px; min-width: 180px; }

/* 关联合同自动判定收付方向时的字段高亮 */
.ff.flash select, .ff.flash input { border-color: var(--brand-2); box-shadow: var(--glow); }

/* 合同详情 · 收付款页签内的「直接录入」行 */
tr.inline-add td { background: #f6f9fd; border-bottom: 1px solid var(--border-2); padding: 6px 8px; }
tr.inline-add .ipt { height: 30px; font-size: 12.5px; padding: 0 7px; min-width: 74px; }
tr.inline-add .ia-act { white-space: nowrap; }
tr.inline-add .ia-tip { font-size: 12px; color: var(--muted); }

/* 项目管理 · 项目阶段多选：工具栏空间不足换行时仍靠右显示 */
.toolbar #msStageHost { margin-left: auto; }

/* ==========================================================================
   第九轮：分栏台账 / 二级目录 / 项目附件详情页 / 多行文本
   ========================================================================== */

/* 表内多行文本：自动换行，段落之间空一行 */
table.gt td .cell-txt {
    white-space: pre-wrap; word-break: break-word; line-height: 1.75;
    min-width: 170px; max-width: 340px; text-align: left;
}

/* 分栏台账：页面内上下两个区块（清欠 A/B 类、部门 / 个人指标） */
.split-sec { border-top: 1px solid var(--border); }
.split-sec:first-child { border-top: 0; }
.split-h {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 11px 16px; background: linear-gradient(90deg, #f6f9fd, #fbfcfe);
    border-bottom: 1px solid var(--border-2);
}
.split-h .sp { margin-left: auto; }
.split-sec table.gt tbody td { white-space: normal; word-break: break-word; vertical-align: top; }
.split-sec table.gt tbody td.num, .split-sec table.gt tbody td .num { white-space: nowrap; text-align: right; }
.split-sec table.gt tbody td.acts { white-space: nowrap; vertical-align: middle; }
.split-sec .table-wrap { max-height: none; }
.split-sec .split-empty {
    padding: 16px; text-align: center; font-size: 12.5px; color: var(--muted);
    background: #fbfcfe;
}

/* 二级目录（页内页签，如 经营指标台账 → 产值回款预报） */
.pg-tabs { display: flex; gap: 4px; padding: 8px 12px; }
.pg-tab {
    padding: 7px 16px; border-radius: 8px; font-size: 13px; color: var(--text-2);
    cursor: pointer; border: 1px solid transparent; transition: .15s; user-select: none;
}
.pg-tab:hover { background: var(--brand-soft); color: var(--brand); }
.pg-tab.on {
    background: var(--brand); color: #fff;
    font-weight: 600; box-shadow: 0 2px 8px rgba(24, 108, 255, .30);
}

/* 项目附件详情页 */
.at-sub { border-top: 1px dashed var(--border); padding-top: 10px; margin-top: 10px; }
.at-sub:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.at-sub-h { display: flex; align-items: center; gap: 9px; padding: 4px 2px 8px; }
.at-sub-h .sp { margin-left: auto; }
.at-sub-t { font-size: 13px; font-weight: 600; color: var(--text); }
.at-empty-line {
    padding: 10px 12px; margin-bottom: 4px; font-size: 12.5px; color: var(--muted);
    background: var(--panel-2); border: 1px dashed var(--border); border-radius: 6px;
}
.at-module {
    border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
    margin-bottom: 12px; background: #fdfdfe;
}
.at-module-h {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding-bottom: 8px; border-bottom: 1px solid var(--border-2); margin-bottom: 4px;
}
.at-module-t { font-size: 13px; font-weight: 600; color: var(--brand); }
.at-sub .table-wrap { max-height: none; }

/* ---------------- 侧栏二级菜单（并入父台账的子台账） ---------------- */
.sb-item.sb-parent .sb-caret { margin-left: 6px; font-size: 10px; opacity: .65; }
.sb-item.sb-sub {
    padding: 7px 10px 7px 34px; font-size: 12.5px; margin-bottom: 1px;
    position: relative; opacity: .95;
}
.sb-item.sb-sub::before {
    content: ''; position: absolute; left: 18px; top: 50%;
    width: 7px; height: 1px; background: currentColor; opacity: .35;
}
.sidebar .sb-item.sb-sub { color: #8298bb; }
.sidebar .sb-item.sb-sub:hover { color: var(--sb-text-hi); }
.sidebar .sb-item.sb-sub.active {
    background: rgba(24, 108, 255, .30); color: #fff; font-weight: 600;
    box-shadow: inset 2px 0 0 #7cb5ff;
}
.sb-item.sb-sub .ico { font-size: 12px; width: 14px; opacity: .85; }
.sb-item.sb-sub .badge.badge-count { font-size: 10.5px; padding: 0 6px; }

/* ---------------- 下达指标（表格批量下达） ---------------- */
.as-tbl td { vertical-align: middle; }
.as-tbl .as-name { width: 100%; }

/* ==============================================================
   供应商档案独立页面（第82轮）：详情键值格 / 经营范围 / 差异对比 / 编辑表单
   ============================================================== */
.kv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px 26px; }
.kv { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.kv-k { color: var(--muted); min-width: 92px; flex: 0 0 auto; }
.kv-v { color: var(--text); word-break: break-all; }
.kv-v.num { font-variant-numeric: tabular-nums; }
.sup-scope {
    white-space: pre-line; line-height: 1.85; font-size: 13px; color: var(--text-2);
    background: #fafbfc; border: 1px solid var(--border-2); border-radius: 8px; padding: 10px 13px;
}
.sup-diff { line-height: 1.75; }
.sup-diff .old { color: #86909c; text-decoration: line-through; }
.sup-diff .new { color: var(--brand); font-weight: 600; }
.fl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.fl-item { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.fl-item.w2 { grid-column: span 2; }
.alert { border-radius: 8px; padding: 10px 14px; font-size: 13px; line-height: 1.75; }
.alert-info { background: #eff6ff; border: 1px solid #d6e5ff; color: #1d4ed8; }
.alert-warn { background: #fff8ed; border: 1px solid #fde3bf; color: #b45309; }
@media (max-width: 1180px) {
    .kv-grid { grid-template-columns: repeat(2, 1fr); }
    .fl-grid { grid-template-columns: 1fr; }
    .fl-item.w2 { grid-column: auto; }
}

/* 合同导入查重预览（相对方 / 金额 / 项目 模糊比对） */
.imp-summary { font-size: 13px; line-height: 1.9; color: var(--text-2); }
.imp-card { border: 1px solid var(--border-2); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
.imp-card.bad { border-color: #f7c7c3; background: #fffafa; }
.imp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.imp-title { font-weight: 600; font-size: 13px; color: var(--text); }
.imp-meta { color: var(--muted); font-size: 12px; line-height: 1.8; margin-top: 2px; }
.imp-match { border-left: 3px solid var(--brand); background: #f7faff; padding: 8px 10px; border-radius: 6px; margin-top: 8px; }
.imp-diff { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 7px; }
.imp-diff th, .imp-diff td { border: 1px solid var(--border-2); padding: 4px 8px; text-align: left; vertical-align: top; }
.imp-diff thead th { background: #f5f7fa; color: var(--muted); font-weight: 600; }
.imp-diff td.chg-old { color: #86909c; text-decoration: line-through; }
.imp-diff td.chg-now { color: #b45309; font-weight: 600; }
.imp-acts { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 9px; font-size: 12px; color: var(--text-2); }
.imp-acts label { cursor: pointer; }
.imp-bulk { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
