* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #0a5bd3;
  --primary-dark: #084bb0;
  --bg: #f4f6fb;
  --side: #0e1b3a;
  --side-2: #14264f;
  --card: #ffffff;
  --text: #1f2733;
  --muted: #7a8699;
  --line: #e6eaf2;
  --green: #15a05a;
  --red: #e04545;
  --amber: #e0922a;
}
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
.app { display: flex; min-height: 100vh; }
/* 侧边栏 */
.sidebar { width: 232px; background: linear-gradient(180deg, var(--side), var(--side-2)); color: #cdd6e8; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-logo { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, #2e7bff, #0a5bd3); color: #fff; font-weight: 800; display: grid; place-items: center; letter-spacing: -.5px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { color: #fff; font-size: 15px; }
.brand-text span { font-size: 11px; color: #7f8db0; }
.nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav a { color: #b9c4dc; text-decoration: none; padding: 11px 14px; border-radius: 9px; font-size: 13.5px; transition: .15s; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(10,91,211,.35); }
.sidebar-foot { padding: 14px 18px; font-size: 11px; color: #6c79a0; border-top: 1px solid rgba(255,255,255,.08); }
/* 主区 */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { padding: 20px 28px; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-title { font-size: 19px; font-weight: 700; }
.topbar-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.content { padding: 24px 28px; overflow-x: auto; }
/* 卡片/KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -20px; top: -20px; width: 80px; height: 80px; border-radius: 50%; background: rgba(10,91,211,.06); }
.kpi .label { font-size: 12.5px; color: var(--muted); }
.kpi .value { font-size: 24px; font-weight: 800; margin-top: 8px; }
.kpi .value.green { color: var(--green); }
.kpi .value.red { color: var(--red); }
.kpi .value.blue { color: var(--primary); }
.kpi .value.amber { color: var(--amber); }
/* 面板 */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h3 { font-size: 15px; }
/* 工具条 */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.btn { border: none; border-radius: 9px; padding: 9px 16px; font-size: 13px; cursor: pointer; font-weight: 600; transition: .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: #eef2f9; color: var(--text); }
.btn-ghost:hover { background: #e2e8f3; }
.btn-sm { padding: 6px 11px; font-size: 12px; }
select, input, textarea { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; color: var(--text); background: #fff; }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--primary); }
.flex { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; background: #fafbfe; font-size: 12px; }
tbody tr:hover { background: #f7f9fd; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.tag.green { background: #e3f7ec; color: var(--green); }
.tag.red { background: #fdeaea; color: var(--red); }
.tag.blue { background: #e6f0ff; color: var(--primary); }
.tag.amber { background: #fdf0dd; color: var(--amber); }
.tag.gray { background: #eef1f6; color: var(--muted); }
.money { font-variant-numeric: tabular-nums; font-weight: 600; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 12.5px; color: var(--muted); }
.form-actions { margin-top: 16px; display: flex; gap: 10px; justify-content: flex-end; }
/* 进度条 */
.bar { height: 8px; border-radius: 6px; background: #eef1f6; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, #2e7bff, #0a5bd3); }
/* 模态 */
.modal-mask { position: fixed; inset: 0; background: rgba(14,27,58,.45); display: grid; place-items: center; z-index: 50; }
.modal { width: 560px; max-width: 92vw; background: #fff; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); font-weight: 700; }
.modal-close { border: none; background: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-body { padding: 18px; max-height: 78vh; overflow: auto; }
/* toast */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: #1f2733; color: #fff; padding: 11px 20px; border-radius: 10px; font-size: 13px; z-index: 80; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.section-title { font-size: 14px; font-weight: 700; margin: 4px 0 12px; }
.stat-row { display: flex; gap: 20px; flex-wrap: wrap; }
.stat-block { flex: 1; min-width: 200px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
