/* 合同审批与付款管理 · 主样式 */
:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff4ff;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --line: #e6eaf2;
  --bg: #f5f7fb;
  --card: #ffffff;
  --side-1: #111a2e;
  --side-2: #1b2743;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
}
* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ============ 登录页 ============ */
.login-wrap { display: flex; height: 100vh; }
.login-hero {
  flex: 1.15;
  background: radial-gradient(1200px 600px at 10% 10%, #2f6bff 0%, #1b3fb8 45%, #0e1c4a 100%);
  color: #fff; padding: 64px 72px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.login-hero::after {
  content: ""; position: absolute; right: -160px; bottom: -160px; width: 520px; height: 520px;
  border-radius: 50%; background: rgba(255,255,255,.06);
}
.login-hero::before {
  content: ""; position: absolute; right: 60px; top: -120px; width: 320px; height: 320px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.18);
}
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 17px; letter-spacing: .5px; z-index: 1; }
.login-brand .mark {
  width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px;
  border: 1px solid rgba(255,255,255,.25);
}
.login-title { z-index: 1; }
.login-title h1 { font-size: 40px; line-height: 1.25; margin: 0 0 18px; font-weight: 650; letter-spacing: 1px; }
.login-title p { color: rgba(255,255,255,.72); font-size: 15px; line-height: 1.9; margin: 0; max-width: 460px; }
.login-feats { display: flex; gap: 28px; z-index: 1; color: rgba(255,255,255,.8); font-size: 13px; }
.login-feats span { display: flex; align-items: center; gap: 8px; }
.login-feats i { width: 6px; height: 6px; border-radius: 50%; background: #7ee0a3; display: inline-block; }
.login-panel { width: 460px; display: flex; align-items: center; justify-content: center; background: #fff; }
.login-box { width: 340px; }
.login-box h2 { font-size: 24px; margin: 0 0 8px; }
.login-box .sub { color: var(--ink-3); font-size: 13px; margin-bottom: 30px; }
.login-box .el-input { margin-bottom: 16px; }
.login-box .el-input__wrapper { padding: 6px 14px; border-radius: 9px; }
.login-submit { width: 100%; height: 44px; border-radius: 9px; font-size: 15px; margin-top: 6px; }
.login-tip { margin-top: 22px; font-size: 12px; color: var(--ink-3); line-height: 1.9; background: #f8fafc; border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; }

/* ============ 框架布局 ============ */
.layout { height: 100vh; display: flex; }
.side {
  width: 226px; flex: 0 0 226px; background: linear-gradient(180deg, var(--side-1), var(--side-2));
  color: #cbd5e1; display: flex; flex-direction: column; transition: width .2s;
}
.side.collapsed { width: 64px; flex: 0 0 64px; }
.side-logo { height: 60px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.side-logo .mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg,#3b82f6,#1d4ed8); display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 15px; flex: 0 0 30px; }
.side-logo .txt { font-size: 14px; color: #fff; font-weight: 600; letter-spacing: .5px; white-space: nowrap; }
.side-menu { flex: 1; overflow-y: auto; padding: 10px 8px; }
.side-menu::-webkit-scrollbar { width: 4px; }
.side-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }
.menu-item { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 8px; cursor: pointer; font-size: 14px; color: #b6c2d9; margin-bottom: 4px; white-space: nowrap; }
.menu-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.menu-item.active { background: linear-gradient(90deg, rgba(59,130,246,.95), rgba(37,99,235,.7)); color: #fff; box-shadow: 0 4px 14px rgba(37,99,235,.35); }
.menu-item .el-icon { font-size: 17px; }
.menu-group-title { font-size: 12px; color: #64748b; padding: 14px 12px 6px; letter-spacing: 1px; }
.side-foot { padding: 10px 8px 14px; }
.side-foot .collapse-btn { display: flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border-radius: 8px; color: #94a3b8; cursor: pointer; font-size: 13px; }
.side-foot .collapse-btn:hover { background: rgba(255,255,255,.07); color: #fff; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 60px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 22px; gap: 16px; }
.topbar .page-title { font-size: 16px; font-weight: 600; }
.topbar .crumb { color: var(--ink-3); font-size: 13px; }
.topbar .spacer { flex: 1; }
.top-user { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.top-user:hover { background: #f6f8fc; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg,#60a5fa,#2563eb); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.content { flex: 1; overflow-y: auto; padding: 20px 22px 40px; }

/* ============ 通用块 ============ */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); gap: 10px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

.page-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.page-toolbar .spacer { flex: 1; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; position: relative; overflow: hidden; }
.stat .label { color: var(--ink-3); font-size: 13px; }
.stat .value { font-size: 26px; font-weight: 650; margin-top: 8px; letter-spacing: .5px; }
.stat .unit { font-size: 13px; color: var(--ink-3); margin-left: 4px; font-weight: 400; }
.stat .hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.stat.primary { background: linear-gradient(135deg,#eff4ff,#fff); border-color: #dbe6ff; }
.stat.primary .value { color: var(--brand-dark); }
.stat .bar { position: absolute; left: 0; top: 0; width: 4px; height: 100%; background: var(--brand); opacity: .8; }
.stat.green .bar { background: #16a34a; }
.stat.amber .bar { background: #d97706; }
.stat.rose .bar { background: #e11d48; }

.muted { color: var(--ink-3); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.money { font-variant-numeric: tabular-nums; font-weight: 600; }
.strong { font-weight: 600; }
.link { color: var(--brand); cursor: pointer; }
.link:hover { text-decoration: underline; }

/* 状态气泡 */
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; line-height: 1; }
.pill-blue { background: #eff4ff; color: #1d4ed8; }
.pill-green { background: #ecfdf3; color: #067647; }
.pill-amber { background: #fffaeb; color: #b54708; }
.pill-red { background: #fef3f2; color: #b42318; }
.pill-gray { background: #f2f4f7; color: #475467; }
.pill-purple { background: #f4f3ff; color: #5925dc; }

/* 三段账 */
.ledger { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ledger > div { background: #fff; padding: 12px 14px; }
.ledger .k { font-size: 12px; color: var(--ink-3); }
.ledger .v { font-size: 17px; font-weight: 600; margin-top: 6px; }

/* 附件 */
.attach-group { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.attach-group .gh { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.attach-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; background: #fafbfd; margin-bottom: 6px; font-size: 13px; }
.attach-item:hover { background: #f2f6ff; }
.attach-item .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-item .fsize { color: var(--ink-3); font-size: 12px; }
.upload-box { border: 1px dashed #c9d4e8; border-radius: 10px; padding: 14px; text-align: center; color: var(--ink-3); font-size: 13px; cursor: pointer; }
.upload-box:hover { border-color: var(--brand); color: var(--brand); background: #f8fbff; }

/* 审批轨迹 */
.trace { position: relative; padding-left: 20px; }
.trace::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.trace-item { position: relative; padding-bottom: 18px; }
.trace-item::before { content: ""; position: absolute; left: -19px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; border: 2px solid #fff; box-shadow: 0 0 0 1px #cbd5e1; }
.trace-item.ok::before { background: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.trace-item.bad::before { background: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.trace-item .th { font-size: 13px; font-weight: 600; }
.trace-item .tm { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.trace-item .to { font-size: 13px; color: var(--ink-2); margin-top: 4px; background: #f8fafc; border-radius: 6px; padding: 6px 10px; }

.empty { text-align: center; color: var(--ink-3); padding: 40px 0; font-size: 13px; }

.detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
@media (max-width: 1180px) { .detail-grid { grid-template-columns: 1fr; } }

.kv { display: grid; grid-template-columns: 96px 1fr; gap: 10px 12px; font-size: 13px; }
.kv .k { color: var(--ink-3); }
.kv .v { color: var(--ink); word-break: break-all; }

.el-table th.el-table__cell { background: #f8fafc !important; color: var(--ink-2); font-weight: 600; }
.el-table { font-size: 13px; }
.el-dialog__header { border-bottom: 1px solid var(--line); margin-right: 0; padding-bottom: 14px; }
.el-dialog__title { font-size: 15px; font-weight: 600; }
.el-form-item__label { color: var(--ink-2); }
.form-section-title { font-size: 13px; font-weight: 600; color: var(--ink); margin: 6px 0 16px; padding-left: 9px; border-left: 3px solid var(--brand); }
