/* ============ 个人项目管理系统 - 全局样式 ============ */
:root {
  --primary: #2563eb;
  --primary-d: #1d4ed8;
  --primary-l: #eff4ff;
  --primary-ll: #f5f8ff;
  --success: #16a34a;
  --success-l: #e9f8ef;
  --warn: #f59e0b;
  --warn-l: #fef5e4;
  --danger: #e11d48;
  --danger-l: #fdeef1;
  --info: #0891b2;
  --purple: #7c3aed;

  --bg: #f4f6fb;
  --panel: #ffffff;
  --ink: #1e293b;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --line: #e8edf5;
  --line-2: #eef2f8;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.05);
  --shadow-hover: 0 8px 28px rgba(37,99,235,.12);
  --font: "Segoe UI", "Microsoft YaHei", "PingFang SC", -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

.app { display: flex; height: 100vh; width: 100%; }

/* ============ 侧边栏 ============ */
.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0f1c3f 0%, #132554 55%, #152a60 100%);
  display: flex;
  flex-direction: column;
  color: #c7d2e8;
  transition: width .22s ease;
  overflow: hidden;
  position: relative;
  z-index: 30;
}
.sidebar.collapsed { width: 72px; }

.brand {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
  position: relative;
}
.brand-logo { flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; white-space: nowrap; }
.brand-text strong { color: #fff; font-size: 16px; letter-spacing: .5px; }
.brand-text span { font-size: 10px; color: #7f96c4; letter-spacing: 1.2px; text-transform: uppercase; }
.sidebar-collapse {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border: none; border-radius: 6px;
  background: rgba(255,255,255,.1); color: #c7d2e8; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1;
  opacity: .55; transition: .2s;
}
.brand:hover .sidebar-collapse { opacity: 1; }
.sidebar.collapsed .sidebar-collapse { transform: translateY(-50%) rotate(180deg); right: 8px; }

.nav { flex: 1; overflow-y: auto; padding: 14px 10px; }
.nav::-webkit-scrollbar { width: 0; }
.nav-group-label {
  font-size: 11px; color: #6a80b0; padding: 14px 12px 7px; letter-spacing: 1px;
  white-space: nowrap;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  height: 44px; padding: 0 12px; border-radius: 9px;
  color: #b6c5e2; cursor: pointer; margin-bottom: 3px;
  transition: .15s; position: relative; white-space: nowrap;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(59,130,246,.9), rgba(37,99,235,.7)); color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.nav-item.active::before { content: ''; position: absolute; left: -10px; top: 11px; bottom: 11px; width: 3px; background: #60a5fa; border-radius: 0 3px 3px 0; }
.nav-ico { width: 20px; height: 20px; flex-shrink: 0; }
.nav-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-name { font-size: 14px; font-weight: 500; flex: 1; }
.nav-badge {
  background: rgba(255,255,255,.16); color: #e6eeff; font-size: 11px;
  min-width: 20px; height: 20px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0 6px;
}
.nav-badge.warn { background: rgba(245,158,11,.9); color: #fff; }

.sidebar-foot {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.08); white-space: nowrap; flex-shrink: 0;
}
.avatar {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, #60a5fa, #2563eb); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px;
}
.foot-info { display: flex; flex-direction: column; line-height: 1.4; }
.foot-info strong { color: #e6eeff; font-size: 13px; font-weight: 600; }
.foot-info span { color: #7087b6; font-size: 11px; }

.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-name,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .foot-info { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 0; }
.sidebar.collapsed .brand { justify-content: center; padding: 0; }
.sidebar.collapsed .sidebar-foot { justify-content: center; padding: 14px 0; }

/* ============ 主区域 ============ */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.site-footer {
  flex-shrink: 0; padding: 8px 26px; font-size: 12px; color: var(--ink-3);
  border-top: 1px solid var(--line); text-align: center; background: var(--panel);
}
.site-footer a { color: var(--ink-3); text-decoration: none; }
.site-footer a:hover { color: var(--primary); text-decoration: underline; }

.topbar {
  height: 68px; flex-shrink: 0; background: var(--panel);
  border-bottom: 1px solid var(--line); display: flex; align-items: center;
  justify-content: space-between; padding: 0 26px; gap: 16px;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 14px; }
.crumb { color: var(--ink-3); font-size: 14px; }
.crumb strong { color: var(--ink); font-weight: 600; }
.icon-btn {
  width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); color: var(--ink-2); cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center; transition: .15s; flex-shrink: 0;
}
.icon-btn:hover { background: var(--primary-l); color: var(--primary); border-color: #cfe0ff; }
.project-switch { display: flex; align-items: center; gap: 8px; }
.project-switch label { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.project-switch select {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 30px 8px 12px;
  background: var(--panel) url("data:image/svg+xml;charset=UTF8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none; cursor: pointer; min-width: 150px; color: var(--ink); font-weight: 500;
}
.project-switch select:focus { outline: none; border-color: var(--primary); }
.project-select-hidden { display: none; }
.project-combo { position: relative; display: flex; align-items: center; }
.project-combo input {
  height: 36px; min-width: 170px; max-width: 230px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 28px 0 12px; background: var(--panel); color: var(--ink); font-size: 13px; font-weight: 500; transition: .15s;
}
.project-combo input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.project-combo-caret { position: absolute; right: 10px; color: var(--ink-3); font-size: 11px; pointer-events: none; }
.project-combo-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 80; width: 280px; max-height: 320px;
  overflow-y: auto; padding: 5px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 12px 30px rgba(15,23,42,.16);
}
.project-option {
  width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--ink);
  text-align: left; cursor: pointer; font-size: 13px;
}
.project-option:hover, .project-option.sel { background: var(--primary-ll); color: var(--primary); }
.project-option small { color: var(--ink-3); font-size: 11px; }
.project-option-empty { padding: 14px; text-align: center; color: var(--ink-3); font-size: 12px; }
.date-chip { color: var(--ink-3); font-size: 12px; white-space: nowrap; padding-left: 4px; }

.content { flex: 1; overflow-y: auto; padding: 26px 28px 40px; }
.content::-webkit-scrollbar { width: 9px; }
.content::-webkit-scrollbar-thumb { background: #d7dfec; border-radius: 6px; border: 2px solid var(--bg); }
.content::-webkit-scrollbar-track { background: transparent; }

/* ============ 通用组件 ============ */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: .3px; }
.page-sub { color: var(--ink-3); font-size: 13px; margin-top: 5px; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: 9px; border: 1px solid transparent;
  cursor: pointer; font-weight: 500; white-space: nowrap; transition: .15s; font-size: 13px;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 3px 10px rgba(37,99,235,.25); }
.btn-primary:hover { background: var(--primary-d); box-shadow: 0 5px 16px rgba(37,99,235,.35); }
.btn-ghost { background: var(--panel); color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { border-color: #cfe0ff; color: var(--primary); background: var(--primary-ll); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #be123c; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12px; border-radius: 7px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { padding: 17px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h3 { font-size: 15px; font-weight: 650; }
.card-head .sub { color: var(--ink-3); font-size: 12px; font-weight: 400; margin-left: 8px; }
.card-body { padding: 20px; }

.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1180px) { .grid-4 { grid-template-columns: repeat(2,1fr); } .grid-3 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 820px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* 统计卡片 */
.stat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: .2s;
}
.stat-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.stat-card::after { content: ''; position: absolute; right: -18px; top: -18px; width: 90px; height: 90px; border-radius: 50%; opacity: .5; }
.stat-card.sc-blue::after { background: radial-gradient(circle, #e0ebff, transparent 70%); }
.stat-card.sc-green::after { background: radial-gradient(circle, #dcfce7, transparent 70%); }
.stat-card.sc-amber::after { background: radial-gradient(circle, #fef0c7, transparent 70%); }
.stat-card.sc-rose::after { background: radial-gradient(circle, #ffe0e8, transparent 70%); }
.stat-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.stat-label { color: var(--ink-2); font-size: 13px; font-weight: 500; }
.stat-ico { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.stat-ico svg { width: 20px; height: 20px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sc-blue .stat-ico { background: var(--primary-l); color: var(--primary); }
.sc-green .stat-ico { background: var(--success-l); color: var(--success); }
.sc-amber .stat-ico { background: var(--warn-l); color: var(--warn); }
.sc-rose .stat-ico { background: var(--danger-l); color: var(--danger); }
.stat-value { font-size: 27px; font-weight: 750; margin-top: 12px; letter-spacing: .5px; position: relative; z-index: 1; }
.stat-value small { font-size: 14px; font-weight: 500; color: var(--ink-3); margin-left: 3px; }
.stat-foot { margin-top: 8px; font-size: 12px; color: var(--ink-3); position: relative; z-index: 1; }
.stat-foot .up { color: var(--success); font-weight: 600; }
.stat-foot .down { color: var(--danger); font-weight: 600; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead th {
  text-align: left; padding: 12px 16px; background: #fafbfe; color: var(--ink-2);
  font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--primary-ll); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl strong { font-weight: 600; }
/* v3.1 分包商名录：长编码与活跃度展示 */
.code-cell { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11.5px; letter-spacing: .2px; white-space: nowrap; color: var(--ink-2); }
.act-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.cell-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 5px; }
.mini-btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-2);
  height: 28px; min-width: 28px; padding: 0 8px; border-radius: 7px; cursor: pointer; font-size: 12px; transition: .15s;
}
.mini-btn:hover { border-color: #cfe0ff; color: var(--primary); background: var(--primary-l); }
.mini-btn.del:hover { border-color: #fecdd3; color: var(--danger); background: var(--danger-l); }

/* 标签/徽章 */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag-gray { background: #f1f5f9; color: #64748b; }
.tag-blue { background: var(--primary-l); color: var(--primary); }
.tag-green { background: var(--success-l); color: var(--success); }
.tag-amber { background: var(--warn-l); color: #d97706; }
.tag-rose { background: var(--danger-l); color: var(--danger); }
.tag-purple { background: #f3e8ff; color: var(--purple); }

/* 进度条 */
.prog { display: flex; align-items: center; gap: 9px; min-width: 130px; }
.prog-track { flex: 1; height: 7px; background: #eef2f8; border-radius: 6px; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #60a5fa, #2563eb); transition: width .4s; }
.prog-fill.green { background: linear-gradient(90deg, #4ade80, #16a34a); }
.prog-fill.amber { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.prog-txt { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

/* 金额颜色 */
.money { font-variant-numeric: tabular-nums; font-weight: 600; }
.money.in { color: var(--success); }
.money.out { color: var(--danger); }
.money.profit { color: var(--primary); }

/* 空状态 */
.empty { padding: 60px 20px; text-align: center; color: var(--ink-3); }
.empty svg { width: 54px; height: 54px; margin: 0 auto 14px; fill: none; stroke: #cbd5e1; stroke-width: 1.4; }
.empty h4 { color: var(--ink-2); font-size: 15px; margin-bottom: 6px; }
.empty p { font-size: 13px; }

/* 工具栏 */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search-box { position: relative; }
.search-box input {
  height: 38px; width: 240px; border: 1px solid var(--line); border-radius: 9px;
  padding: 0 12px 0 36px; background: var(--panel); transition: .15s;
}
.search-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.search-box svg { position: absolute; left: 11px; top: 10px; width: 17px; height: 17px; fill: none; stroke: var(--ink-3); stroke-width: 2; }
.filter-select {
  height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; background: var(--panel); cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--primary); }
.toolbar .spacer { flex: 1; }
.result-count { color: var(--ink-3); font-size: 12px; }

/* ============ 看板 ============ */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1180px) { .kanban { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 700px) { .kanban { grid-template-columns: 1fr; } }
.kb-col { background: #eef1f7; border-radius: 12px; padding: 12px; min-height: 220px; }
.kb-col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 12px; font-weight: 600; font-size: 13px; }
.kb-dot { width: 9px; height: 9px; border-radius: 50%; }
.kb-count { margin-left: auto; background: #fff; color: var(--ink-2); font-size: 11px; min-width: 20px; height: 20px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0 6px; }
.kb-card {
  background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 12px;
  margin-bottom: 9px; box-shadow: 0 1px 3px rgba(16,24,40,.05); cursor: pointer; transition: .15s;
}
.kb-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.kb-card h4 { font-size: 13px; font-weight: 600; margin-bottom: 8px; line-height: 1.45; }
.kb-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--ink-3); }
.kb-meta .who { display: inline-flex; align-items: center; gap: 4px; }
.kb-avatar { width: 20px; height: 20px; border-radius: 50%; background: var(--primary-l); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; }
.kb-card .pri { margin-left: auto; }
.kb-card .prog { margin-top: 10px; }
.due-today { color: var(--danger) !important; font-weight: 600; }

/* 图表 */
.chart-box { position: relative; height: 240px; width: 100%; }
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding: 10px 4px 0; }
.bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-pair { display: flex; align-items: flex-end; gap: 3px; height: 100%; width: 100%; justify-content: center; }
.bar { width: 16px; border-radius: 4px 4px 0 0; transition: height .5s; min-height: 2px; }
.bar.in { background: linear-gradient(180deg, #4ade80, #16a34a); }
.bar.out { background: linear-gradient(180deg, #fda4af, #e11d48); }
.bar-label { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut { width: 160px; height: 160px; border-radius: 50%; flex-shrink: 0; position: relative; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-center strong { font-size: 22px; }
.donut-center span { font-size: 11px; color: var(--ink-3); }
.donut-legend { flex: 1; min-width: 180px; }
.dl-item { display: flex; align-items: center; gap: 9px; padding: 6px 0; font-size: 13px; }
.dl-item i { width: 10px; height: 10px; border-radius: 3px; }
.dl-item .dl-name { flex: 1; color: var(--ink-2); }
.dl-item .dl-val { font-weight: 600; font-variant-numeric: tabular-nums; }

/* 项目详情 */
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 700px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-item { background: var(--primary-ll); border-radius: 9px; padding: 13px 15px; }
.detail-item label { display: block; color: var(--ink-3); font-size: 11px; margin-bottom: 5px; }
.detail-item span { font-size: 14px; font-weight: 600; color: var(--ink); }

/* ============ 模态框 ============ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(3px); animation: fadeIn .15s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--panel); width: 100%; max-width: 560px; max-height: 90vh;
  border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.25); display: flex; flex-direction: column;
  animation: popIn .18s;
}
.modal.wide { max-width: 780px; }
@keyframes popIn { from { transform: translateY(10px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 17px; font-weight: 650; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 15px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.form-item { display: flex; flex-direction: column; gap: 7px; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.form-item label .req { color: var(--danger); }
.form-item input, .form-item select, .form-item textarea {
  height: 40px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; background: #fff; transition: .15s; width: 100%;
}
.form-item textarea { height: 80px; padding: 10px 12px; resize: vertical; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.form-item input[type=number] { font-variant-numeric: tabular-nums; }
.form-hint { font-size: 11px; color: var(--ink-3); }
.form-section-title { grid-column: 1 / -1; font-size: 12px; font-weight: 700; color: var(--primary); border-bottom: 1px solid var(--line); padding-bottom: 7px; margin-top: 4px; }

/* 确认框 */
.confirm-box {
  background: #fff; width: 100%; max-width: 400px; border-radius: 14px; padding: 28px;
  text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.25); animation: popIn .18s;
}
.confirm-ico {
  width: 52px; height: 52px; border-radius: 50%; background: var(--danger-l); color: var(--danger);
  font-size: 26px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
.confirm-box h3 { font-size: 18px; margin-bottom: 8px; }
.confirm-box p { color: var(--ink-2); font-size: 13px; line-height: 1.6; margin-bottom: 22px; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-actions .btn { min-width: 100px; }

/* Toast */
.toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--success);
  border-radius: 9px; padding: 12px 18px; box-shadow: 0 8px 30px rgba(0,0,0,.12);
  font-size: 13px; display: flex; align-items: center; gap: 10px; animation: slideIn .25s; min-width: 220px;
}
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--primary); }
.toast-ico { font-weight: 700; color: var(--success); }
.toast.error .toast-ico { color: var(--danger); }
.toast.info .toast-ico { color: var(--primary); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.out { animation: slideOut .25s forwards; }
@keyframes slideOut { to { transform: translateX(30px); opacity: 0; } }

/* 提示条 */
.notice {
  background: var(--primary-l); border: 1px solid #dbe7ff; color: var(--primary-d);
  padding: 12px 16px; border-radius: 9px; font-size: 13px; line-height: 1.6; margin-bottom: 18px;
  display: flex; gap: 10px; align-items: flex-start;
}
.notice b { flex-shrink: 0; }

/* 快速操作 */
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick-btn {
  display: flex; align-items: center; gap: 11px; padding: 13px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; cursor: pointer; transition: .15s; text-align: left;
}
.quick-btn:hover { border-color: #cfe0ff; background: var(--primary-ll); transform: translateY(-1px); }
.quick-ico { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.quick-ico svg { width: 18px; height: 18px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.quick-btn strong { font-size: 13px; display: block; }
.quick-btn span { font-size: 11px; color: var(--ink-3); }

/* 日志时间线 */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item::before { content: ''; position: absolute; left: -20px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--primary-l); }
.tl-item:last-child { padding-bottom: 0; }
.tl-date { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-3); margin-bottom: 3px; }
.tl-ops { margin-left: auto; display: inline-flex; gap: 4px; }
.tl-title { font-size: 13px; font-weight: 600; }
.tl-text { font-size: 12px; color: var(--ink-2); line-height: 1.6; margin-top: 3px; }

/* 库存预警行 */
.stock-low { background: var(--danger-l) !important; }
.hidden { display: none !important; }

/* ============ 进度款台账 ============ */
.ledger-alerts { background:var(--warn-l); border:1px solid #f7d9a0; border-radius:var(--radius); padding:12px 16px; margin-bottom:16px; }
.la-head { font-size:13px; font-weight:600; color:#a16207; margin-bottom:8px; }
.la-row { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--ink-2); padding:3px 0; }
.la-dot { width:7px; height:7px; border-radius:50%; background:var(--warn); flex:none; }
.la-row.high .la-dot { background:var(--danger); }
.la-proj { color:var(--ink); font-weight:500; flex:none; }
.la-row.high { color:#be123c; }
.ledger-ok { background:var(--success-l); border:1px solid #bbf0d0; border-radius:var(--radius); padding:10px 16px; margin-bottom:16px; font-size:12px; color:#15803d; }
.ledger-card { margin-bottom:18px; }
.ledger-card .card-head { align-items:flex-start; }
.ledger-grid { display:grid; grid-template-columns:minmax(300px,0.85fr) minmax(0,1.5fr); gap:16px; padding:16px 20px; }
.ledger-side { min-width:0; }
.ls-title { font-size:13px; font-weight:600; color:var(--primary-d); padding-bottom:10px; margin-bottom:10px; border-bottom:2px solid var(--primary-l); }
.ledger-side.down .ls-title { color:#b45309; border-bottom-color:#fef0d9; }
.ls-sub { font-size:11px; font-weight:400; color:var(--ink-3); }
.ls-flow { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-bottom:10px; }
.ls-cell { background:var(--bg); border-radius:var(--radius-sm); padding:6px 10px; min-width:78px; flex:1 1 auto; }
.ls-cell label { display:block; font-size:11px; color:var(--ink-3); margin-bottom:2px; }
.ls-cell span { font-size:13px; font-weight:600; font-variant-numeric:tabular-nums; }
.ls-cell span.hi, .hi { color:var(--primary); }
.hi2 { color:var(--primary-d); }
.ls-op { font-size:15px; color:var(--ink-3); font-weight:600; flex:none; }
.ls-deduct { background:var(--primary-ll); border:1px solid var(--line); border-radius:var(--radius-sm); padding:10px 12px; margin-top:4px; }
.lsd-title { font-size:12px; font-weight:600; color:var(--ink-2); margin-bottom:8px; }
.lsd-items { display:grid; grid-template-columns:1fr 1fr; gap:4px 12px; font-size:11.5px; color:var(--ink-2); }
.lsd-items b { color:var(--ink); font-variant-numeric:tabular-nums; }
.lsd-total { display:flex; justify-content:space-between; align-items:center; margin-top:8px; padding-top:8px; border-top:1px dashed var(--line); font-size:12px; font-weight:600; }
.lsd-total b { color:var(--danger); font-size:14px; font-variant-numeric:tabular-nums; }
.ledger-table table { font-size:12px; min-width:640px; }
.ledger-table th { white-space:nowrap; padding:8px 10px; font-size:11.5px; }
.ledger-table td { padding:8px 10px; vertical-align:middle; }
.lt-meta { font-size:10.5px; color:var(--ink-3); margin-top:2px; font-weight:400; }
.lt-total { background:var(--warn-l); }
.lt-total td { border-top:2px solid #f7d9a0; font-weight:600; }
.ls-kpi { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-top:10px; }
.kpi { background:var(--bg); border-radius:var(--radius-sm); padding:8px 10px; text-align:center; }
.kpi label { display:block; font-size:10.5px; color:var(--ink-3); margin-bottom:3px; }
.kpi b { font-size:14px; font-variant-numeric:tabular-nums; }
.kpi b.good { color:var(--success); }
.kpi b.bad { color:var(--danger); }
.ledger-foot { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:0 20px 18px; padding:12px 16px; background:linear-gradient(90deg,var(--primary-ll),#fff); border:1px solid var(--line); border-radius:var(--radius-sm); }
.lf-item label { display:block; font-size:10.5px; color:var(--ink-3); margin-bottom:2px; }
.lf-item b { font-size:14px; font-variant-numeric:tabular-nums; }
.lf-item.hl b { color:var(--info); }
.lf-item.hl2 { margin-left:auto; text-align:right; }
.lf-item.hl2 b { color:var(--primary); font-size:18px; }
.lf-op { font-size:15px; color:var(--ink-3); font-weight:600; }
.lf-sep { width:1px; height:34px; background:var(--line); }
.rules-box { font-size:13px; color:var(--ink-2); }
.rules-sec { margin-bottom:16px; }
.rules-sec h4 { font-size:13px; color:var(--primary-d); margin-bottom:8px; }
.rules-sec ul { list-style:none; padding-left:0; }
.rules-sec li { padding:4px 0 4px 16px; position:relative; line-height:1.6; }
.rules-sec li::before { content:''; position:absolute; left:2px; top:12px; width:5px; height:5px; border-radius:50%; background:var(--primary-l); border:1px solid var(--primary); }
.rules-sec.warn h4 { color:#b45309; }
.rules-sec.warn li::before { background:var(--warn-l); border-color:var(--warn); }
@media (max-width:1100px){ .ledger-grid { grid-template-columns:1fr; } .ls-kpi { grid-template-columns:repeat(2,1fr); } }

/* ============ 分包-支出交叉核对 ============ */
.cross-check { background:var(--primary-ll); border:1px solid var(--line); border-radius:var(--radius-sm); padding:10px 12px; font-size:12px; }
.cc-row { display:flex; justify-content:space-between; align-items:center; padding:3px 0; color:var(--ink-2); }
.cc-row b { color:var(--ink); font-variant-numeric:tabular-nums; }
.cc-sum { color:var(--primary) !important; }
.cc-result { margin:6px 0 8px; padding:6px 9px; border-radius:6px; font-size:12px; }
.cc-result.ok { background:var(--success-l); color:#15803d; }
.cc-result.warn { background:var(--danger-l); color:#be123c; }
.lt-meta.good { color:var(--success) !important; }
.lt-meta.bad { color:var(--danger) !important; font-weight:600; }
.row-warn { background:#fff8f9; }
.row-warn:hover { background:#fff0f2 !important; }

/* 版本标识（用于分辨新旧程序） */
.ver-chip {
  flex-shrink: 0; white-space: nowrap; font-size: 11px; font-weight: 700;
  color: var(--primary); background: var(--primary-ll);
  border: 1px solid #c7d9ff; border-radius: 999px; padding: 4px 10px;
  letter-spacing: .3px; cursor: default;
}
.ver-note {
  margin-top: 14px; padding: 11px 13px; border-radius: 8px;
  background: var(--primary-ll); border-left: 3px solid var(--primary);
  font-size: 12px; line-height: 1.75; color: var(--ink-2);
}
.ver-note b { color: var(--primary); }
.ver-note span { color: var(--ink-3); }

/* ============ v2.2 分包自动计算 / 支出明细关联 ============ */
/* 自动计算字段：只读、浅蓝底，明确区别于可编辑输入框 */
.auto-calc {
  background: var(--primary-ll) !important;
  color: var(--primary-d) !important;
  font-weight: 700; cursor: default;
  border-color: #c7d9ff !important;
}
.auto-calc:focus { box-shadow: none; outline: none; }
.calc-note {
  background: var(--success-l); border: 1px solid #bbf0d0; border-radius: 8px;
  padding: 8px 11px; font-size: 12px; line-height: 1.6; color: #15803d;
}
/* 对下供应商结算 · 支出明细弹窗 */
.se-head { display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.se-avatar {
  width:42px; height:42px; border-radius:10px; background:var(--primary-l); color:var(--primary);
  display:flex; align-items:center; justify-content:center; font-size:18px; font-weight:700; flex:none;
}
.se-kpi .kpi { text-align:center; }
.se-kpi .kpi b.bad { color:var(--danger); }

/* ===== 云端登录门禁 ===== */
.cloud-gate {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 50% 0%, #1e3a8a 0%, #0f1c3f 55%, #0b1730 100%);
  padding: 24px;
}
.cloud-gate[hidden] { display: none; }
.cloud-login-card {
  width: 100%; max-width: 420px; background: #fff; border-radius: 16px; padding: 32px;
  box-shadow: 0 24px 70px rgba(0,0,0,.28); color: var(--ink);
}
.cloud-login-brand { font-size: 13px; color: var(--primary); font-weight: 700; letter-spacing: .5px; margin-bottom: 10px; }
.cloud-login-card h2 { font-size: 21px; margin: 0 0 8px; }
.cloud-login-desc { font-size: 13px; line-height: 1.7; color: var(--ink-2); margin: 0 0 20px; }
.cloud-login-loading { font-size: 14px; color: var(--ink-2); padding: 18px 0; }
.cloud-field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.cloud-field span { font-size: 12px; color: var(--ink-2); }
.cloud-field input {
  width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 12px; font-size: 14px; color: var(--ink); background: var(--panel);
}
.cloud-field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-l); }
.cloud-row { display: flex; align-items: flex-end; gap: 10px; margin-top: 12px; }
.cloud-row .btn { height: 40px; white-space: nowrap; }
.cloud-login-submit { width: 100%; margin-top: 18px; height: 42px; }
.cloud-login-error { min-height: 18px; margin: 10px 0 0; font-size: 12px; color: var(--danger); }
#roleChip { border-color: var(--primary); color: var(--primary); background: var(--primary-l); }
.role-select { height: 30px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); font-size: 12px; padding: 0 6px; }
.tbl .audit-detail { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--ink-3); }
.cloud-gate [hidden] { display: none !important; }
.nav-item[hidden], [data-act][hidden], .modal-foot .btn[hidden], #btnImport[hidden] { display: none !important; }
