/* ============ 设计变量 ============ */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #475569;
  --line: #e6e9ef;
  --line-soft: #f0f2f6;
  --brand: #2563eb;
  --brand-2: #1d4ed8;
  --brand-soft: #eef4ff;
  --navy: #1e293b;
  --green: #15803d;
  --green-soft: #ecfdf3;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --red: #b91c1c;
  --red-soft: #fef2f2;
  /* 语义色（KPI / 状态条）：蓝=信息，绿=已完成，琥珀=待处理，紫=票据，红=风险 */
  --c-blue: #3b82f6;
  --c-green: #10b981;
  --c-amber: #f59e0b;
  --c-violet: #8b5cf6;
  --c-red: #ef4444;
  --c-slate: #64748b;
  --violet: #6d28d9;
  --violet-soft: #f5f3ff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 8px 30px rgba(15, 23, 42, 0.08);
  /* 字号层级：标题 > 区块标题 > 正文/值 > 标签 > 辅助 */
  --fs-title: 20px;
  --fs-panel: 16px;
  --fs-body: 14px;
  --fs-label: 14px;
  --fs-meta: 12px;
  --weak: #64748b;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Noto Sans CJK SC', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; }

.ico { flex: none; }

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

.sidebar {
  width: 228px;
  flex: none;
  background: var(--navy);
  color: #cbd5e1;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 18px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  display: grid; place-items: center; color: #fff; flex: none;
}
.brand-text b { display: block; font-size: 18px; color: #fff; letter-spacing: 0.3px; line-height: 1.25; }
.brand-text small { font-size: var(--fs-meta); color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; margin-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  color: var(--weak); font-size: var(--fs-body); text-decoration: none;
  position: relative; transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #e2e8f0; text-decoration: none; }
.nav-item.active { background: rgba(37, 99, 235, 0.2); color: #fff; }
.nav-item.active::before {
  content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px;
  width: 3px; border-radius: 3px; background: #60a5fa;
}
.nav-item .ico { opacity: 0.8; }
.nav-item.active .ico { opacity: 1; }

.sidebar-foot { margin-top: auto; padding: 14px 8px 2px; }
.foot-line { font-size: var(--fs-meta); color: #475569; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 16px 28px; background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.titles h1 { font-size: var(--fs-title); letter-spacing: 0.2px; }
.titles p { margin: 3px 0 0; font-size: var(--fs-meta); color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-actions { display: flex; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 600; font-size: var(--fs-body); flex: none;
}
.user-meta b { display: block; font-size: var(--fs-body); line-height: 1.2; }
.user-meta small { font-size: var(--fs-meta); color: var(--muted); }
.logout-form { margin: 0 0 0 4px; }

.content { padding: 22px 28px 48px; width: 100%; max-width: 1440px; }

/* ============ 面板 ============ */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 18px; overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft);
}
.panel-title { font-size: var(--fs-panel); font-weight: 600; color: var(--ink); }
.panel-actions { display: flex; gap: 8px; align-items: center; }
.panel-body { padding: 16px 18px; }
.panel-body.flush { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-side { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.grid-side > .panel { height: 100%; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* ============ KPI ============ */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent;
}
.kpi.blue::after { background: var(--c-blue); }
.kpi.green::after { background: var(--c-green); }
.kpi.amber::after { background: var(--c-amber); }
.kpi.violet::after { background: var(--c-violet); }
.kpi.red::after { background: var(--c-red); }
.kpi.slate::after { background: var(--c-slate); }
.kpi.cyan::after { background: #06b6d4; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: var(--fs-meta); color: var(--muted); }
.kpi-ico { color: #cbd5e1; }
.kpi-value { font-size: 24px; font-weight: 650; letter-spacing: -0.3px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: var(--fs-meta); color: var(--muted); margin-top: 5px; }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-body); }
.table th {
  text-align: left; font-weight: 500; font-size: var(--fs-meta); color: var(--muted);
  padding: 10px 14px; background: #fafbfd; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:hover { background: #fafcff; }
.table tbody tr:last-child td { border-bottom: none; }
.table .ta-r { text-align: right; }
.table .num { font-variant-numeric: tabular-nums; }
.table .strong { font-weight: 600; }
.table .sub { color: var(--weak); font-size: var(--fs-meta); }
.table a.row-link { font-weight: 500; }

/* ============ 徽标 ============ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-meta); line-height: 1; padding: 4px 8px; border-radius: 999px;
  font-weight: 500; white-space: nowrap;
}
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-blue { background: #eff6ff; color: #1d4ed8; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }

/* ============ 进度条 ============ */
.bar { height: 6px; background: #eef1f6; border-radius: 999px; overflow: hidden; flex: 1; min-width: 60px; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3b82f6, #60a5fa); transition: width 0.4s ease; }
.bar.green > i { background: linear-gradient(90deg, #10b981, #34d399); }
.bar.amber > i { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar.red > i { background: linear-gradient(90deg, #ef4444, #f87171); }
.prog-cell { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.prog-num { font-size: var(--fs-meta); color: var(--muted); font-variant-numeric: tabular-nums; width: 32px; text-align: right; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-size: var(--fs-body); font-family: inherit;
  cursor: pointer; white-space: nowrap; transition: all 0.15s; text-decoration: none;
}
.btn:hover { background: #f8fafc; border-color: #d5dbe5; text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-sm { padding: 5px 10px; font-size: var(--fs-meta); border-radius: 7px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #f1f5f9; color: var(--ink); }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: #fecaca; }

.btn-group { display: inline-flex; gap: 4px; }
.btn-group form { margin: 0; }

/* ============ 表单 ============ */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; padding: 16px 18px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-label); }
.field-label { color: var(--ink-2); font-weight: 500; }
.field .field-label { padding-left: 12px; }
.field-hint { color: var(--weak); font-size: var(--fs-meta); }
.field-hint.bad { color: var(--red); }
.span-2 { grid-column: span 2; }
.input {
  width: 100%; padding: 8px 11px; border: 1px solid #d8dee9; border-radius: 8px;
  font-size: var(--fs-body); line-height: 20px; font-family: inherit; color: var(--ink); background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s; outline: none;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
/* 输入框和下拉框统一行高，避免同一排两个字段一高一低 */
input.input, select.input { height: 38px; }
/* 数字框不要上下箭头：一万块总不能点一万下，直接键盘输入 */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
textarea.input { resize: vertical; min-height: 74px; }

/* Safari：空的日期框会渲染「像值一样」的当日占位。空且未聚焦时隐藏文字，
   看起来才是真空白；聚焦时保留浏览器分段编辑器，方便输入。 */
@supports (-webkit-hyphens: none) and (not (-moz-appearance: none)) {
  input[type="date"][data-empty-value]:not(:focus),
  input[type="time"][data-empty-value]:not(:focus),
  input[type="datetime-local"][data-empty-value]:not(:focus) {
    color: transparent;
  }
  input[type="date"][data-empty-value]:not(:focus)::-webkit-datetime-edit-text {
    color: transparent;
  }
}
.form-actions {
  grid-column: span 2; display: flex; align-items: center; justify-content: flex-end;
  gap: 12px; padding-top: 4px;
}
.form-hint { color: var(--weak); font-size: var(--fs-meta); margin-right: auto; }

.form-panel > summary { cursor: pointer; list-style: none; }
.form-panel > summary::-webkit-details-marker { display: none; }
.form-panel > summary .chev { font-size: var(--fs-meta); color: var(--muted); transition: transform 0.2s; }
.form-panel[open] > summary .chev { transform: rotate(180deg); }
.form-panel[open] > summary { border-bottom: 1px solid var(--line-soft); }

/* ============ 空状态 ============ */
.empty { padding: 40px 20px; text-align: center; }
.empty-title { color: var(--muted); font-size: var(--fs-body); }
.empty-hint { color: var(--weak); font-size: var(--fs-meta); margin-top: 6px; }

/* ============ 提示 ============ */
.flash {
  padding: 10px 14px; border-radius: 9px; font-size: var(--fs-body); margin-bottom: 16px;
  border: 1px solid transparent;
}
.flash-ok { background: var(--green-soft); color: var(--green); border-color: #bbf7d0; }
.flash-err { background: var(--red-soft); color: var(--red); border-color: #fecaca; }
.flash-info { background: var(--brand-soft); color: var(--brand-2); border-color: #dbeafe; }

/* ============ 详情 ============ */
.kv { margin: 0; display: grid; gap: 0; }
.kv-row { display: grid; grid-template-columns: 104px 1fr; gap: 12px; padding: 7px 0; font-size: var(--fs-body); border-bottom: 1px dashed var(--line-soft); }
.kv-row:last-child { border-bottom: none; }
.kv-row dt { color: var(--muted); font-size: var(--fs-meta); }
.kv-row dd { margin: 0; color: var(--ink); word-break: break-word; }

.amount { font-variant-numeric: tabular-nums; font-weight: 600; }
.amount.neg { color: var(--red); }

.meta-line { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: var(--fs-meta); color: var(--muted); }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .ph-title { font-size: var(--fs-title); font-weight: 650; letter-spacing: -0.2px; }
.page-head .ph-sub { color: var(--muted); font-size: var(--fs-meta); margin-top: 5px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* 页头信息块：带小标签的独立小块，按类分组、分隔线隔开 */
.ph-sub .ph-item {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 6px;
  background: #fff; border: 1px solid var(--line);
  font-size: var(--fs-meta); color: var(--ink-2);
}
.ph-sub .ph-item i { font-style: normal; font-size: var(--fs-meta); color: var(--muted); }
.ph-sub .ph-item.bad { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.ph-sub .ph-item.bad i { color: #b91c1c; opacity: 0.8; }
.ph-sub .ph-sep { width: 1px; height: 14px; background: var(--line); }

/* ============ 时间线 ============ */
.timeline { list-style: none; margin: 0; padding: 0; }
.tl-item { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; padding-bottom: 18px; position: relative; align-items: start; }
.tl-item::before { content: ''; position: absolute; left: 10px; top: 24px; bottom: 0; width: 1px; background: var(--line); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item:last-child::before { display: none; }
.tl-dot {
  width: 21px; height: 21px; border-radius: 50%; border: 2px solid var(--line);
  background: #fff; display: grid; place-items: center; font-size: 10px; z-index: 1; color: var(--muted);
}
.tl-dot.done { border-color: #16a34a; background: #16a34a; color: #fff; }
.tl-dot.doing { border-color: #2563eb; color: #2563eb; }
.tl-name { font-size: var(--fs-body); font-weight: 500; }
.tl-meta { font-size: var(--fs-meta); color: var(--weak); margin-top: 3px; }

/* ============ 项目卡片 ============ */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.proj-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
}
.proj-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); border-color: #d7e0ef; }
.proj-card .pc-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.proj-card .pc-name { font-weight: 600; font-size: var(--fs-body); }
.proj-card .pc-no { color: var(--weak); font-size: var(--fs-meta); margin-top: 3px; }
.proj-card .pc-meta { display: flex; justify-content: space-between; font-size: var(--fs-meta); color: var(--weak); }

/* ============ 登录页 ============ */
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1000px 600px at 15% 10%, #e8efff 0%, transparent 55%),
    radial-gradient(900px 500px at 90% 90%, #eef7f3 0%, transparent 55%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 32px 30px; box-shadow: var(--shadow-lg);
}
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.login-brand .brand-mark { width: 40px; height: 40px; border-radius: 11px; }
.login-brand b { display: block; font-size: 16px; }
.login-brand small { color: var(--muted); font-size: var(--fs-meta); }
.login-title { font-size: var(--fs-title); font-weight: 650; margin-bottom: 4px; }
.login-sub { color: var(--muted); font-size: var(--fs-meta); margin: 0 0 22px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .btn { width: 100%; padding: 10px; font-size: var(--fs-body); margin-top: 4px; }
.login-err { background: var(--red-soft); color: var(--red); border: 1px solid #fecaca; border-radius: 8px; padding: 9px 12px; font-size: var(--fs-meta); }
.login-hint { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); font-size: var(--fs-meta); color: var(--muted); line-height: 1.8; }
.login-hint code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: var(--fs-meta); color: var(--ink-2); }
.login-foot { margin-top: 14px; text-align: center; font-size: 12px; color: var(--weak); display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.login-foot a { color: var(--weak); text-decoration: none; }
.login-foot a:hover { color: var(--muted); text-decoration: underline; }

/* ============ 响应式 ============ */
@media (max-width: 1080px) {
  .grid-side { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .app { flex-direction: column; }
  .main { min-width: 0; width: 100%; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .topbar-right { flex: 1 1 100%; justify-content: space-between; gap: 10px; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .proj-grid { grid-template-columns: minmax(0, 1fr); }
  .head-progress { min-width: 0; width: 100%; }
  .filter-search, .filter-select { flex: 1 1 100%; max-width: none; }
  .page-head { gap: 10px; }
  .table { font-size: var(--fs-meta); }
  .table th, .table td { padding: 9px 10px; }
  .sidebar {
    width: auto; max-width: 100vw; height: auto; position: static; flex-direction: row;
    align-items: center; padding: 10px 14px; overflow-x: auto; gap: 6px;
  }
  .nav { min-width: 0; flex: 1 1 auto; }
  .brand { padding: 0 12px 0 0; }
  .brand-text small { display: none; }
  .brand-text b { font-size: var(--fs-body); white-space: nowrap; }
  .nav { flex-direction: row; margin: 0; overflow-x: auto; }
  .nav-item { padding: 7px 10px; white-space: nowrap; }
  .nav-item.active::before { display: none; }
  .sidebar-foot { display: none; }
  .topbar { padding: 12px 16px; }
  .content { padding: 14px 16px 40px; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .form-actions { grid-column: span 1; }
  .user-meta { display: none; }
  .titles h1 { font-size: var(--fs-title); }
}

/* ============ 补充组件 ============ */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--fs-meta); letter-spacing: 0.2px; }
.num { font-variant-numeric: tabular-nums; }
.ok { color: var(--green); }
.warn { color: var(--amber); }
.bad { color: var(--red); }

.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow);
}
.filter-search { flex: 1 1 260px; max-width: 420px; }
.filter-select { flex: 0 1 150px; max-width: 180px; }

.stack-tight { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px dashed var(--line-soft);
}
.list-row:last-child { border-bottom: none; }
.list-row:first-child { padding-top: 2px; }
.lr-title { font-size: var(--fs-body); font-weight: 500; }
.lr-sub { font-size: var(--fs-meta); color: var(--weak); margin-top: 2px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px;
  font-size: var(--fs-meta); background: #f1f5f9; color: #475569;
}
.chip-ok { background: var(--green-soft); color: var(--green); }
.chip-miss { background: var(--red-soft); color: var(--red); }

.mini-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mini-stats > div {
  background: #fafbfd; border: 1px solid var(--line-soft); border-radius: 9px; padding: 10px 12px;
}
.mini-stats span { display: block; font-size: var(--fs-meta); color: var(--muted); margin-bottom: 4px; }
.mini-stats b { font-size: var(--fs-body); font-variant-numeric: tabular-nums; letter-spacing: -0.2px; }

.head-progress { min-width: 220px; flex: 0 0 auto; }
.head-progress-top { display: flex; justify-content: space-between; font-size: var(--fs-meta); color: var(--muted); margin-bottom: 6px; }
.head-progress-top b { color: var(--ink); font-variant-numeric: tabular-nums; }

.section-title { font-size: var(--fs-body); color: var(--muted); margin: 4px 0 12px; font-weight: 500; }

.notice {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--amber-soft); border: 1px solid #fde68a; border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 20px;
}
.notice-tag { flex: none; }
.notice b { font-size: var(--fs-body); }
.notice p { margin: 6px 0 0; font-size: var(--fs-meta); color: #92400e; line-height: 1.65; }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 18px; }
.plan-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.plan-ico {
  width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft);
  color: var(--brand); display: grid; place-items: center; margin-bottom: 12px;
}
.plan-card h3 { font-size: var(--fs-body); margin-bottom: 6px; }
.plan-card p { margin: 0; font-size: var(--fs-meta); color: var(--muted); line-height: 1.65; }

.hint-p { margin: 0; font-size: var(--fs-body); color: var(--muted); line-height: 1.75; }
.hint-ol { margin: 0; padding-left: 20px; font-size: var(--fs-body); color: var(--ink-2); line-height: 2; }

.btn[disabled] { opacity: 0.65; cursor: not-allowed; }

/* ============ 录入表单 ============ */
.form-section {
  display: flex; flex-direction: column; gap: 3px;
  margin: 8px 0 2px; padding-top: 16px; border-top: 1px solid var(--line-soft);
}
.form-section > span { font-size: var(--fs-panel); font-weight: 600; color: var(--ink); }
.form-section > small { font-size: var(--fs-meta); color: var(--weak); }

.form-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 4px 2px 0; margin-bottom: 30px;
}

.member-picker { display: flex; flex-direction: column; gap: 14px; }
.member-group-title {
  display: flex; align-items: baseline; gap: 8px;
  font-size: var(--fs-meta); color: var(--muted); margin-bottom: 8px; font-weight: 500;
}
.member-group-title span { font-size: var(--fs-meta); color: var(--weak); }
.member-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 8px; }
.member-item {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px;
  transition: all 0.15s; background: #fff;
}
.member-item:hover { border-color: #c7d4ea; background: #fafcff; }
.member-item.picked { border-color: var(--brand); background: var(--brand-soft); }
.member-item input { accent-color: var(--brand); flex: none; }
.mi-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: #eef2f8; color: #475569; font-size: var(--fs-meta);
  display: grid; place-items: center; font-weight: 500;
}
.member-item.picked .mi-avatar { background: #dbeafe; color: var(--brand-2); }
.mi-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.mi-text b { font-size: var(--fs-meta); font-weight: 500; }
.mi-text small { font-size: var(--fs-meta); color: var(--muted); }

.inline-form {
  display: grid; grid-template-columns: 1fr auto; gap: 8px;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-soft);
}
.inline-form .input { font-size: var(--fs-meta); padding: 6px 9px; }
.inline-form select { grid-column: 1 / -1; }

@media (max-width: 860px) {
  .member-list { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .inline-form { flex-wrap: wrap; }
  .form-footer .btn { flex: 1; }
}

/* 金额预览：标签和数字挨着，不同项之间留距 */
.amount-preview {
  display: flex; align-items: baseline; flex-wrap: wrap; justify-content: flex-start; gap: 6px 10px;
  background: #f8fafc; border: 1px dashed var(--line); border-radius: 8px; padding: 10px 14px;
  min-height: 44px;
}
.amount-preview > span:not(:first-child) { margin-left: 28px; }
.preview-empty { font-size: var(--fs-meta); color: var(--muted); }
.amount-preview > span { font-size: var(--fs-meta); color: var(--muted); }
.preview-value { font-size: 16px; font-variant-numeric: tabular-nums; font-weight: 600; }
.preview-value.ok { color: var(--green); }
.preview-value.pending { color: var(--amber); }
.preview-value.muted { color: var(--muted); font-weight: 400; font-size: var(--fs-body); }

/* 签约主体：四个大按钮 */
.entity-label { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.entity-label em { font-style: normal; font-size: var(--fs-meta); color: var(--muted); font-weight: 400; }
.entity-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.entity-opt {
  position: relative; display: flex; align-items: center; justify-content: center;
  padding: 13px 10px; border: 1.5px solid var(--line); border-radius: 9px;
  background: #fff; cursor: pointer; font-size: var(--fs-body); font-weight: 500; color: var(--ink2);
  transition: all .15s;
}
.entity-opt input { position: absolute; opacity: 0; pointer-events: none; }
.entity-opt:hover { border-color: #c7d4ea; background: #fafcff; }
.entity-opt.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-2); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.entity-opt.on::after {
  content: '✓'; position: absolute; top: 4px; right: 7px; font-size: 10px; color: var(--brand);
}
.member-list.flat { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

/* 执行进度链 */
.flow { display: flex; align-items: flex-start; padding: 6px 0 2px; }
.flow-step { flex: 1; text-align: center; position: relative; }
.flow-step::before {
  content: ''; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: var(--line);
}
.flow-step:first-child::before { display: none; }
.flow-step.done::before, .flow-step.now::before { background: var(--brand); }
.flow-dot {
  width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--line);
  margin: 0 auto 7px; display: grid; place-items: center; position: relative; z-index: 1;
  font-size: 10px; color: var(--muted);
}
.flow-step.done .flow-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.flow-step.now .flow-dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.flow-name { font-size: var(--fs-meta); color: var(--muted); }
.flow-step.done .flow-name, .flow-step.now .flow-name { color: var(--ink); font-weight: 500; }
.flow-note { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line-soft); font-size: var(--fs-meta); color: var(--muted); }
.flow-note b { color: var(--ink); }

.flow-cap { font-size: var(--fs-meta); color: var(--muted); margin-bottom: 10px; }
.flow-cap em { font-style: normal; color: var(--faint); font-size: var(--fs-meta); margin-left: 6px; }
.flow-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.flow-actions form { margin: 0; }
.check-list { display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-meta); color: var(--muted); }
.check-list > div { display: flex; align-items: center; gap: 8px; }
.check-list i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line); display: inline-block; flex: none; }
.check-list .ok { color: var(--ink); }
.check-list .ok i { background: var(--green); border-color: var(--green); position: relative; }
.check-list .ok i::after { content: '✓'; color: #fff; font-size: 9px; position: absolute; inset: 0; display: grid; place-items: center; }
.inline-mini { display: inline; }

.pending-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding: 10px 12px; border-radius: 8px;
  background: var(--amber-soft); border: 1px solid #fde68a; font-size: var(--fs-meta); color: var(--amber);
}
.pending-bar b { color: #92400e; }
.pending-bar.member { justify-content: flex-start; }
.pending-bar .btn-group form { margin: 0; }

/* 专家会录入：类型 / 日期 / 人数 / 每人 / 餐费 / 备注 六格平分，添加跟在后面 */
.meeting-form {
  display: grid; grid-template-columns: 100px 140px repeat(3, minmax(0, 1fr)) minmax(0, 2fr) auto; gap: 8px; align-items: center;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-soft);
}
.meeting-form .input { font-size: var(--fs-meta); padding: 6px 9px; width: 100%; }
.meeting-form .btn { justify-self: start; }
/* 专家会列表：定住前几列宽度，别让数字被拉得满屏都是空隙 */
.meeting-table th:nth-child(1), .meeting-table td:nth-child(1) { width: 96px; }
.meeting-table th:nth-child(2), .meeting-table td:nth-child(2) { width: 120px; }
.meeting-table th:nth-child(3), .meeting-table td:nth-child(3) { width: 92px; }
.meeting-table th:nth-child(4), .meeting-table td:nth-child(4) { width: 116px; }
.meeting-table th:nth-child(5), .meeting-table td:nth-child(5) { width: 104px; }
.meeting-table th:nth-child(6), .meeting-table td:nth-child(6) { width: 132px; }
.meeting-table th:nth-child(7), .meeting-table td:nth-child(7) { width: auto; }
@media (max-width: 900px) {
  .meeting-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .meeting-form .btn { justify-self: stretch; }
}
}

/* 必填校验 */
.field-error {
  display: block;
  color: #b42318;
  font-size: var(--fs-meta);
  margin-top: 5px;
  line-height: 1.4;
}
.invalid,
.entity-pick.invalid .entity-opt {
  border-color: #f04438 !important;
  box-shadow: 0 0 0 3px rgba(240, 68, 56, 0.12);
}
.entity-pick.invalid .entity-opt.on {
  background: #fef3f2;
}

/* 对外：是/否 清单 */
.yn-list { display: flex; flex-direction: column; }
.yn-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 2px; border-bottom: 1px dashed var(--line-soft); font-size: var(--fs-meta);
}
.yn-row:last-child { border-bottom: 0; }
.yn-dot {
  width: 17px; height: 17px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--line); display: grid; place-items: center;
  font-size: 9px; color: #fff; background: #fff;
}
.yn-row.on .yn-dot { background: var(--green); border-color: var(--green); }
.yn-label { flex: 1; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.yn-row.on .yn-label { color: var(--ink); }
.yn-label em { font-style: normal; font-size: var(--fs-meta); color: var(--faint); }
.yn-badge {
  font-size: var(--fs-meta); padding: 2px 9px; border-radius: 999px; min-width: 34px; text-align: center;
}
.yn-badge.no { background: #f2f4f7; color: var(--muted); }
.yn-badge.yes { background: var(--green-soft); color: var(--green); font-weight: 500; }

/* 收资 · 现场支线 */
.field-line {
  margin-top: 14px; padding: 12px 14px;
  background: #fafbfc; border: 1px solid var(--line-soft); border-radius: 8px;
}
.field-line-head {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-meta); color: var(--muted); margin-bottom: 6px;
}
.field-line-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.field-line-right form { margin: 0; }
.field-row { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: var(--fs-meta); }
.chk {
  width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line);
  display: grid; place-items: center; font-size: 10px; color: #fff; flex: none;
}
.chk.on { background: var(--green); border-color: var(--green); }
.field-name { flex: 1; }
.field-note { font-size: var(--fs-meta); padding: 6px 0; color: var(--muted); }
.field-note.bad { color: var(--red); }
.field-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.field-actions form { margin: 0; }
.return-form { display: flex; gap: 6px; align-items: center; }
.return-form .input { padding: 5px 8px; font-size: var(--fs-meta); width: 150px; }

.msg-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line-soft); }
.msg-row:last-child { border-bottom: 0; }
.msg-row form { margin: 0; }

.chk-form { display: flex; align-items: center; gap: 9px; padding: 5px 0; margin: 0; }
.chk-form .chk { cursor: pointer; padding: 0; background: #fff; }
.chk-form .chk.on { background: var(--green); }
.chk-form .chk:disabled { cursor: not-allowed; opacity: .5; }
.chk-form .field-name { font-size: var(--fs-meta); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.ftask {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 7px 0; border-bottom: 1px dashed var(--line-soft);
}
.ftask:last-child { border-bottom: 0; }
.ftask-name { font-size: var(--fs-meta); flex: 0 0 auto; }
.ftask-act { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.ftask-act form { margin: 0; }
.chk-inline { margin: 0; display: inline-flex; }
.chk-inline .chk { cursor: pointer; padding: 0; }
.chk-inline .chk:disabled { cursor: not-allowed; opacity: .5; }
.ftask .field-note { flex: 1 0 100%; padding: 2px 0 0 25px; }

.field-submit { display: flex; justify-content: flex-end; margin-top: 10px; }
.field-submit form { margin: 0; }

/* 合同 → 项目分配：项目勾选 + 每个项目一行金额 */
/* 固定高度：切换合同类型 / 签约主体时列表行数会变，但框的高度不变，页面不跳 */
.pick-scroll { height: 180px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 6px; }
.proj-pick { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: var(--fs-body); }
.proj-pick:hover { background: #f6f8fc; }
.proj-pick input { accent-color: var(--brand); }
.amount-box { margin-top: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfd; padding: 10px 12px; }
.amount-title { font-size: var(--fs-meta); color: var(--muted); margin-bottom: 9px; }
/* 列注释：项目 / 合同额 / 管理费，填完数字也认得出 */
.amt-head { display: grid; grid-template-columns: minmax(0, 1fr) 150px 150px; gap: 8px; font-size: var(--fs-meta); color: var(--muted); padding: 0 0 6px; }
.amt-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 150px; gap: 8px; align-items: center; margin-bottom: 8px; }
/* 费用合同：管理费列保留不隐藏，自动等于合同额（只读），宽度不跳 */
.amount-box.fee .amt-mgmt { background: #f1f3f6; color: var(--muted); }
.amt-name { font-size: var(--fs-meta); color: var(--ink-2); }
.check-line { display: flex; align-items: center; gap: 8px; font-size: var(--fs-body); color: var(--ink-2); padding: 8px 0; cursor: pointer; }
.check-line input { accent-color: var(--brand); }
.amount-sum { font-size: var(--fs-meta); color: var(--muted); padding-top: 7px; border-top: 1px dashed var(--line-soft); }
.amount-sum b { color: var(--ink); font-variant-numeric: tabular-nums; }
.field-note-inline { font-style: normal; font-size: var(--fs-meta); color: var(--muted); margin-left: 8px; font-weight: 400; }
@media (max-width: 720px) { .amt-row { grid-template-columns: 1fr; } }

/* 项目 / 项目仓库 页签 */
.tabs { display: flex; gap: 2px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; margin-bottom: -1px;
  font-size: var(--fs-body); color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 550; }
.tab-count {
  font-size: var(--fs-meta); line-height: 1; padding: 3px 7px; border-radius: 9px;
  background: #eef2f7; color: var(--muted); font-variant-numeric: tabular-nums;
}
.tab.active .tab-count { background: var(--brand-soft); color: var(--brand); }

/* 项目详情 · 第一屏关键数字 */
.stat-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px; margin: 14px 0 16px;
}
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stat .k { font-size: var(--fs-meta); color: var(--muted); }
.stat .v { font-size: 24px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .v.ok { color: var(--green); }
.stat .v.warn { color: #b45309; }
.stat-note { display: flex; gap: 18px; flex-wrap: wrap; font-size: var(--fs-meta); color: var(--muted); margin: -6px 0 14px; }
.stat-note .bad { color: #b91c1c; }
.bad-text, .sub.bad-text, .table .bad-text { color: #b91c1c; }

/* 打印：只留内容，去掉导航、筛选和按钮 */
@media print {
  .sidebar, .topbar, .filter-bar, .btn, .btn-group, .kpi-row, .page-head .btn-group { display: none !important; }
  body { background: #fff; }
  .main { margin-left: 0; padding: 0; }
  .panel { box-shadow: none; border-color: #e5e7eb; break-inside: avoid; }
  a { color: #111; text-decoration: none; }
}


/* 浮动错误提示：不占文档流，不推页面 */
.flash-toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 9999; max-width: calc(100vw - 32px); box-shadow: var(--shadow-lg);
  margin: 0;
}

/* 项目详情：合同金额 / 开票收款 两组分开（方案 B：整组浅底 + 标签） */
.stat-groups { display: grid; grid-template-columns: 0.8fr 1.45fr 1.45fr; gap: 14px; align-items: stretch; margin: 14px 0 16px; }
.stat-group {
  flex: 1; min-width: 0;
  background: #eef3fb; border: 1px solid #dbe4f3; border-radius: 12px;
  padding: 10px 12px 12px;
}
.stat-group + .stat-group { margin-left: 0; }
.stat-cap {
  display: inline-block; font-size: var(--fs-meta); font-weight: 600; color: #1d4ed8;
  background: #dbeafe; border-radius: 999px; padding: 3px 10px; margin-bottom: 9px;
}
.stat-groups .stat-strip { margin: 0; gap: 10px; }
.stat-groups .stat { background: #fff; border-color: #dbe4f3; }
.stat-group.solo .stat .v { font-size: 28px; }
@media (max-width: 860px) {
  .stat-groups { grid-template-columns: 1fr; gap: 12px; }
  .stat-group + .stat-group { margin-left: 0; }
}

/* 页面级提示：浮层，不占文档流、不顶动页面 */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 9999; max-width: min(560px, calc(100vw - 32px));
  padding: 11px 16px; border-radius: 10px; border: 1px solid;
  box-shadow: var(--shadow-lg); font-size: var(--fs-body); cursor: pointer;
}
.toast-ok { background: #ecfdf5; color: #15803d; border-color: #bbf7d0; }
.toast-err { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.toast-info { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }

/* 项目详情：统一排版（借鉴用量面板） */
.project-detail { font-size: var(--fs-body); color: #111827; }
.project-detail .panel { border-radius: 14px; }
.project-detail .panel-head { padding: 16px 20px; }
.project-detail .panel-title { font-size: var(--fs-panel); font-weight: 600; letter-spacing: -0.2px; }
.project-detail .panel-body { padding: 18px 20px; }
.project-detail .table th { font-size: var(--fs-meta); color: #6b7280; font-weight: 500; }
.project-detail .table td { font-size: var(--fs-body); }
.project-detail .sub, .project-detail .flow-note { color: #6b7280; }
.project-detail .page-head .ph-title { font-size: var(--fs-title); font-weight: 650; letter-spacing: -0.4px; }
.project-detail .ph-sub { font-size: var(--fs-body); }

/* 金额区：主数字 + 两行卡片 */
.money-hero { background: #eef1f5; border-radius: 16px; padding: 22px 26px 26px; margin: 16px 0 0; }
.money-hero .mh-label { font-size: var(--fs-body); color: #6b7280; }
.money-hero .mh-sub { font-size: var(--fs-meta); color: #9ca3af; margin-top: 3px; }
.money-hero .mh-value { font-size: 40px; font-weight: 650; letter-spacing: -0.5px; margin-top: 14px; font-variant-numeric: tabular-nums; }
.money-hero .mh-value.warn { color: var(--amber); }
.money-hero .mh-value.ok { color: var(--green); }
.money-cap { font-size: var(--fs-meta); color: #9ca3af; margin: 18px 0 8px; }
.money-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.money-row.two { grid-template-columns: repeat(2, 1fr); }
.money-tile { background: #eef1f5; border-radius: 14px; padding: 16px 18px 18px; }
.money-tile .k { font-size: var(--fs-meta); color: #6b7280; }
.money-tile .v { font-size: 24px; font-weight: 600; margin-top: 10px; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; }
.money-tile .v.warn { color: var(--amber); }
.money-tile .v.ok { color: var(--green); }
@media (max-width: 860px) {
  .money-row, .money-row.two { grid-template-columns: 1fr 1fr; }
  .money-hero .mh-value { font-size: 32px; }
}

/* 项目详情：折叠与页内页签 */
.project-detail .fold { border: 1px solid var(--line); border-radius: 10px; margin-top: 10px; background: #fff; }
.project-detail .fold > summary { cursor: pointer; padding: 10px 12px; font-size: var(--fs-body); font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.project-detail .fold > summary::after { content: '展开'; font-size: var(--fs-meta); color: var(--muted); font-weight: 400; }
.project-detail .fold[open] > summary::after { content: '收起'; }
.project-detail .fold > .fold-body { padding: 0 12px 12px; }
.project-detail .field-detail summary { cursor: pointer; font-size: var(--fs-meta); color: var(--muted); margin: 2px 0 6px; }
.detail-tabs { margin-top: 14px; }
.detail-tabs > input { position: absolute; opacity: 0; pointer-events: none; }
.detail-tabs > label { display: inline-block; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: var(--fs-body); cursor: pointer; margin-right: 8px; }
.detail-tabs > input:checked + label { background: #0f172a; color: #fff; border-color: #0f172a; }
.detail-tabs > .tab-pane { display: none; margin-top: 12px; }
.detail-tabs > input#dt-contract:checked ~ .pane-contract { display: block; }
.detail-tabs > input#dt-money:checked ~ .pane-money { display: block; }
.detail-tabs > input#dt-meeting:checked ~ .pane-meeting { display: block; }

/* 工资表：横向滚动、不换行、输入框收窄 */
.salary-wrap { overflow-x: auto; }
.salary-wrap table { min-width: 1180px; }
.salary-wrap th, .salary-wrap td { white-space: nowrap; }
.salary-wrap td:first-child { min-width: 84px; }
.salary-wrap .input { width: 78px; padding: 4px 6px; font-size: var(--fs-meta); text-align: right; }
.salary-wrap .num { font-variant-numeric: tabular-nums; }
.salary-wrap .btn-sm { white-space: nowrap; }

}


.nav-group { margin: 12px 12px 4px; font-size: var(--fs-meta); letter-spacing: 0.12em; color: var(--muted); }

/* 侧栏浅蓝纯色 */
.sidebar { background: #dbeafe; }
.sidebar .brand-text b { color: #0f2a4a; }
.sidebar .brand-text small { color: #475569; }
.sidebar .nav-item { color: #334155; }
.sidebar .nav-item:hover { background: rgba(37, 99, 235, 0.1); color: #0f172a; }
.sidebar .nav-item.active { background: #bfdbfe; color: #1d4ed8; }
.sidebar .nav-item.active::before { background: #2563eb; }
.sidebar .nav-group { color: #475569; }
.sidebar .sidebar-foot { color: #475569; }

/* 人员分组表：固定列宽，各组对齐 */
.emp-table { table-layout: fixed; width: 100%; }
.emp-table th:nth-child(1) { width: 22%; }
.emp-table th:nth-child(2) { width: 20%; }
.emp-table th:nth-child(3) { width: 20%; }
.emp-table th:nth-child(4) { width: 20%; }
.emp-table th:nth-child(5) { width: 18%; }
.emp-table td, .emp-table th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 人员表列间距 */
.emp-table th, .emp-table td { padding-left: 18px; padding-right: 18px; }

/* 人员表字号 */
.emp-table th, .emp-table td { font-size: var(--fs-body); }
.emp-table th { font-size: var(--fs-body); }

/* ============ 统一字号规范 ============
   标题 20 / 区块标题 15 / 正文·表格·输入 14 / 标签·按钮 13 / 辅助·表头 12
*/
.titles h1 { font-size: var(--fs-title); }
.page-head .ph-title { font-size: var(--fs-title); }
.panel-title { font-size: var(--fs-panel); }
.table { font-size: var(--fs-body); }
.table th { font-size: var(--fs-meta); }
.table td { font-size: var(--fs-body); }
.table .sub { font-size: var(--fs-meta); }
.badge { font-size: var(--fs-meta); }
.btn { font-size: var(--fs-body); }
.btn-sm { font-size: var(--fs-meta); }
.input, select.input, textarea.input { font-size: var(--fs-body); }
.nav-item { font-size: var(--fs-body); }
.nav-group { font-size: var(--fs-meta); color: var(--muted); }
.brand-text b { font-size: 18px; }
.brand-text small { font-size: var(--fs-meta); }
.kpi-value { font-size: 24px; }
.kpi-label, .kpi-sub { font-size: var(--fs-meta); }
.field { font-size: var(--fs-label); }
.field-hint, .form-hint, .empty-hint { font-size: var(--fs-meta); }
.emp-table th, .emp-table td { font-size: var(--fs-body); }
.emp-table th { font-size: var(--fs-meta); }

/* 项目列表：列多，保持单行、横向滚动 */
.project-table { min-width: 1180px; width: 100%; }
.project-table th, .project-table td { white-space: nowrap; }

/* 项目列表：固定列宽铺满，避免横向滚动 */
.content { max-width: 100%; }
.project-table { table-layout: fixed; width: 100%; min-width: 0; }
.project-table th, .project-table td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-table th:nth-child(1) { width: 24%; }
.project-table th:nth-child(2) { width: 6%; }
.project-table th:nth-child(3) { width: 8%; }
.project-table th:nth-child(4) { width: 8%; }
.project-table th:nth-child(5) { width: 13%; }
.project-table th:nth-child(6) { width: 9%; }
.project-table th:nth-child(7) { width: 10%; }
.project-table th:nth-child(8) { width: 9%; }
.project-table th:nth-child(9) { width: 8%; }
.project-table td:nth-child(1), .project-table td:nth-child(5) { white-space: normal; }

/* 项目表：按屏幕宽度自适应 */
@media (max-width: 1500px) {
  .project-table th:nth-child(1) { width: 21%; }
  .project-table th:nth-child(3) { width: 8%; }
  .project-table th:nth-child(5) { width: 14%; }
  .project-table th:nth-child(6) { width: 8%; }
  .project-table th:nth-child(7) { width: 11%; }
  .project-table th:nth-child(8) { width: 9%; }
  .project-table th:nth-child(9) { width: 8%; }
}
@media (max-width: 1200px) {
  .project-table { min-width: 1080px; }
}

/* 项目详情：管理费直接在数字上编辑 */
.stat .stat-input { width: 100%; border: 1px dashed transparent; background: transparent; font: inherit; font-size: 20px; font-weight: 600; color: inherit; padding: 2px 0; border-radius: 6px; }
.stat .stat-input:hover { border-color: #cbd5e1; }
.stat .stat-input:focus { outline: none; border-style: solid; border-color: #2563eb; background: #fff; padding: 2px 6px; }
.stat .stat-input::placeholder { color: #b45309; opacity: 1; }

/* 金额卡片：同一排等高对齐 */
.stat-strip { align-items: stretch; }
.stat { min-height: 112px; display: flex; flex-direction: column; justify-content: space-between; }

/* 项目详情：Infor Profile Record 式基本信息区 */
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--primary, #2563eb); }
.primary-card { background: #fff; border: 1px solid #e5eaf2; border-radius: 12px; padding: 16px 20px; margin: 14px 0 18px; }
.pp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 20px; }
.pp-k { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.pp-v { font-size: 14px; font-weight: 500; color: var(--text, #0f172a); }
.pp-v.bad { color: #b91c1c; }
@media (max-width: 1200px) { .pp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 金额卡片：窄屏自适应，避免数字溢出 */
.stat { min-height: 112px; height: auto; }
.stat .stat-hint { font-size: 11px; line-height: 1.4; color: var(--muted); margin-top: 3px; }
/* 数字一行放下：宽屏 24，窄屏逐级缩小，永不折行 */
.stat .v { font-size: clamp(19px, 1.6vw, 24px); white-space: nowrap; }
.stat-group.solo .stat .v { font-size: clamp(22px, 2.2vw, 28px); }
@media (max-width: 900px) { .stat .v { font-size: 16px; } .stat-group.solo .stat .v { font-size: 18px; } }
@media (max-width: 620px) { .stat .v { font-size: 14px; } .stat-group.solo .stat .v { font-size: 16px; } }

/* 金额卡片：禁止被长数字撑破 */
.stat-group, .stat { min-width: 0; }
.stat { max-width: 100%; overflow: hidden; }
.stat .v { overflow-wrap: normal; }
@media (max-width: 1100px) {
  .stat-groups { grid-template-columns: 1fr; gap: 12px; }
}

/* 筛选栏：下拉不压缩，放不下自动换行 */
.filter-bar { row-gap: 10px; }
/* 筛选栏里的按钮和输入框同高、文字上下居中 */
.filter-bar > .btn, .filter-bar > .btn-group > .btn, .filter-bar > a.btn {
  height: 38px; padding-top: 0; padding-bottom: 0;
}
.filter-search { flex: 1 1 320px; max-width: 460px; }
.filter-select { flex: 0 0 150px; width: 150px; max-width: 150px; }
/* 筛选：每个下拉下面一行灰色注释，说明可选范围 */
.filter-item { display: flex; flex-direction: column; gap: 4px; flex: 0 0 150px; }
.filter-item .filter-select { width: 100%; max-width: 100%; flex: none; }
.filter-hint {
  font-size: var(--fs-meta); color: var(--weak); line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 2px;
  max-width: 100%;
}
@media (max-width: 900px) {
  .filter-search, .filter-select { flex: 1 1 100%; width: 100%; max-width: none; }
  .filter-item { flex: 1 1 100%; }
}

/* 开票 / 收款流水表：整表适配屏宽，长内容换行 */
.invoice-table, .payment-table { width: 100%; }
.invoice-table th, .invoice-table td,
.payment-table th, .payment-table td { white-space: normal; word-break: break-word; }
.invoice-table td:nth-child(4), .invoice-table td:nth-child(6),
.payment-table td:nth-child(1), .payment-table td:nth-child(4) { white-space: nowrap; }

/* 宽屏流水表：固定列宽，备注不被挤成一条 */
@media (min-width: 1101px) {
  .invoice-table, .payment-table { table-layout: fixed; width: 100%; }
  .invoice-table th:nth-child(1) { width: 7%; }
  .invoice-table th:nth-child(2) { width: 18%; }
  .invoice-table th:nth-child(3) { width: 20%; }
  .invoice-table th:nth-child(4) { width: 9%; }
  .invoice-table th:nth-child(5) { width: 7%; }
  .invoice-table th:nth-child(6) { width: 9%; }
  .invoice-table th:nth-child(7) { width: 6%; }
  .invoice-table th:nth-child(8) { width: 18%; }
  .invoice-table th:nth-child(9) { width: 6%; }
  .payment-table th:nth-child(1) { width: 10%; }
  .payment-table th:nth-child(2) { width: 18%; }
  .payment-table th:nth-child(3) { width: 19%; }
  .payment-table th:nth-child(4) { width: 9%; }
  .payment-table th:nth-child(5) { width: 10%; }
  .payment-table th:nth-child(6) { width: 7%; }
  .payment-table th:nth-child(7) { width: 20%; }
  .payment-table th:nth-child(8) { width: 7%; }
}

/* 紧凑表格：列多但还想在一屏里看全时用，靠缩内边距换列宽 */
.table-compact th, .table-compact td { padding: 8px 9px; }

/* 通用：列多的表格在窄屏降级为卡片（字段名在左、值在右） */
/* 容器宽度不够时同样降级：按面板实际可用宽度判断，不只看浏览器视口 */
.table-wrap { container-type: inline-size; }
@container (max-width: 700px) {
  /* 卡片：标签在左、值在右，一行一个字段（2026-10-26 恢复原样） */
  table.table-cards thead { display: none; }
  table.table-cards, table.table-cards tbody, table.table-cards tr, table.table-cards td { display: block; width: auto; }
  table.table-cards tr {
    border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: #fff;
  }
  table.table-cards td {
    border: none; padding: 4px 0; display: flex; gap: 12px; align-items: flex-start;
    text-align: left !important; white-space: normal !important;
  }
  table.table-cards td::before {
    content: attr(data-label); color: #64748b; flex: 0 0 76px; font-size: 12px; line-height: 1.6;
  }
  table.table-cards td:empty { display: none; }
}

@media (max-width: 1100px) {
  /* 卡片：标签在左、值在右，一行一个字段（2026-10-26 恢复原样） */
  table.table-cards thead { display: none; }
  table.table-cards, table.table-cards tbody, table.table-cards tr, table.table-cards td { display: block; width: auto; }
  table.table-cards tr {
    border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: #fff;
  }
  table.table-cards td {
    border: none; padding: 4px 0; display: flex; gap: 12px; align-items: flex-start;
    text-align: left !important; white-space: normal !important;
  }
  table.table-cards td::before {
    content: attr(data-label); color: #64748b; flex: 0 0 76px; font-size: 12px; line-height: 1.6;
  }
  table.table-cards td:empty { display: none; }
}

/* ============ 待办页 ============ */
.todo-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; padding: 16px 20px; margin-bottom: 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.todo-total { display: flex; flex-direction: column; gap: 4px; }
.todo-total b { font-size: 32px; line-height: 1; color: var(--ink); font-weight: 650; }
.todo-total span { font-size: 14px; color: var(--ink-2); }
.todo-total small { color: var(--weak); font-size: 12px; }
.todo-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.todo-chip {
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--muted); font-size: 12px; white-space: nowrap;
}
.todo-chip b { font-size: 14px; color: var(--ink); }
.todo-chip:hover { text-decoration: none; border-color: var(--brand); color: var(--brand-2); }
.todo-chip.zero { opacity: 0.55; }
.todo-chip.hot b { color: var(--red); }
.todo-chip.warn b { color: var(--amber); }
.todo-chip.info b { color: var(--brand); }
.todo-group-title {
  margin: 22px 0 10px; font-size: 13px; font-weight: 600; color: var(--muted);
}
.todo-group-title:first-of-type { margin-top: 12px; }
.todo-empty { text-align: center; }
@media (max-width: 700px) {
  .todo-hero { align-items: flex-start; }
  .todo-chips { justify-content: flex-start; }
}

/* 付安源：时间 / 金额 / 收款人 / 付款人 / 备注 */
.pay-panel { overflow: visible; }
.pay-panel .panel-body { overflow: visible; }
.pay-form {
  display: grid;
  grid-template-columns: 156px 132px 118px 118px minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
}
.pay-form .field { margin: 0; min-width: 0; }
.pay-form .field-label { margin-bottom: 3px; }
.pay-form .pay-submit { display: flex; align-items: end; }
.pay-form .pay-submit .btn { height: 38px; white-space: nowrap; }
@media (max-width: 980px) {
  .pay-form { grid-template-columns: 1fr 1fr; }
  .pay-form .pay-submit { grid-column: 1 / -1; }
}

/* 中文日期选择器 */
.date-pick { position: relative; }
.date-pop-fixed { position: fixed; z-index: 1000; }
.date-pick-btn { width: 100%; text-align: left; background: #fff; cursor: pointer; }
.date-pop {
  position: absolute; z-index: 60; top: calc(100% + 4px); left: 0;
  width: 264px; background: #fff; border: 1px solid var(--line, #dbe3ee);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 23, 42, .14); padding: 10px;
}
.date-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.date-head b { font-size: 13px; }
.date-head button, .date-foot button {
  border: 0; background: transparent; color: var(--text, #0f172a); cursor: pointer; padding: 2px 8px; border-radius: 6px;
}
.date-head button:hover, .date-foot button:hover { background: var(--bg, #f1f5f9); }
.date-week, .date-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.date-week span { text-align: center; font-size: 11px; color: var(--muted, #64748b); padding: 3px 0; }
.date-cell {
  border: 0; background: transparent; border-radius: 6px; height: 30px; cursor: pointer;
  color: var(--text, #0f172a); font-size: 12px;
}
.date-cell:hover { background: var(--bg, #f1f5f9); }
.date-cell.active { background: var(--blue, #2563eb); color: #fff; }
.date-foot { display: flex; justify-content: space-between; margin-top: 8px; border-top: 1px solid var(--line, #e2e8f0); padding-top: 6px; font-size: 12px; }

/* 自定义确认框 */
.confirm-mask[hidden] { display: none; }
.confirm-mask {
  position: fixed; inset: 0; z-index: 2000; background: rgba(15, 23, 42, .38);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.confirm-box {
  width: min(420px, 100%); background: #fff; border-radius: 14px; padding: 20px 20px 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .24);
}
.confirm-title { font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.confirm-msg { color: var(--ink-2, #475569); font-size: 14px; line-height: 1.6; margin: 0 0 16px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* 列表分页 */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px 4px; flex-wrap: wrap; }
.pager-btns { display: flex; gap: 6px; }
