:root{
  --bg:#f5f6f8; --surface:#fff; --line:#e6e8eb; --line-soft:#f0f2f5;
  --text:#1f2329; --muted:#8a9099; --sub:#5a626d;
  --primary:#2f6bff; --primary-soft:#eef3ff;
  --ok:#0f8a4d; --ok-soft:#e7f7ef;
  --warn:#b25e00; --warn-soft:#fff4e5;
  --danger:#c62828; --danger-soft:#fdecec;
  --shadow:0 1px 2px rgba(16,24,40,.04);
}
*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;padding:0;height:100%}
body{
  font-family:"PingFang SC","Microsoft YaHei","Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  font-size:14px;color:var(--text);background:var(--bg);
  -webkit-font-smoothing:antialiased;
}
a{color:inherit}

/* ---------- 布局 ---------- */
.app{display:flex;min-height:100vh}
.sidebar{
  width:232px;flex:0 0 232px;background:var(--surface);
  border-right:1px solid var(--line);
  position:fixed;top:0;left:0;bottom:0;
  display:flex;flex-direction:column;z-index:30;
}
.brand{display:flex;align-items:center;gap:10px;padding:20px 18px 16px}
.logo{
  width:34px;height:34px;border-radius:10px;flex:0 0 34px;
  background:linear-gradient(135deg,#2f6bff,#6f9bff);
  color:#fff;font-weight:700;font-size:16px;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 4px 12px rgba(47,107,255,.28);
}
.brand-name{font-size:15px;font-weight:650;letter-spacing:.2px}
.brand-sub{font-size:11px;color:var(--muted);margin-top:2px}
.nav{flex:1;overflow-y:auto;padding:4px 12px 20px}
.nav-group{font-size:11px;color:#9aa1ab;letter-spacing:.08em;padding:0 10px;margin:16px 0 6px}
.nav-item{
  display:flex;align-items:center;gap:9px;height:36px;padding:0 10px;
  border-radius:8px;color:#4a515b;font-size:13.5px;text-decoration:none;
  cursor:pointer;user-select:none;
}
.nav-item .dot{width:6px;height:6px;border-radius:2px;background:#cfd4dc;transition:.15s}
.nav-item:hover{background:#f5f7fa;color:var(--text)}
.nav-item.active{background:var(--primary-soft);color:var(--primary);font-weight:600}
.nav-item.active .dot{background:var(--primary)}
.side-foot{
  border-top:1px solid var(--line);padding:12px 16px;
  display:flex;align-items:center;gap:10px;
}
.side-user{font-size:13px;font-weight:600}
.side-role{font-size:11.5px;color:var(--muted)}
.main{margin-left:232px;flex:1;min-width:0;display:flex;flex-direction:column}

.topbar{
  height:60px;background:rgba(255,255,255,.9);backdrop-filter:blur(8px);
  border-bottom:1px solid var(--line);
  display:flex;align-items:center;justify-content:space-between;
  padding:0 24px;position:sticky;top:0;z-index:20;
}
.crumb{font-size:13px;color:var(--muted)}
.crumb-strong{color:var(--text);font-weight:600}
.crumb .sep{margin:0 8px;color:#c8cdd6}
.top-right{display:flex;align-items:center;gap:12px}
.top-search{width:240px}
.icon-btn{
  width:34px;height:34px;border-radius:8px;border:1px solid var(--line);
  background:#fff;display:flex;align-items:center;justify-content:center;
  cursor:pointer;color:#5a626d;position:relative;
}
.icon-btn:hover{background:#f7f8fa}
.bell-dot{
  position:absolute;top:7px;right:8px;width:6px;height:6px;border-radius:50%;
  background:#f04438;border:1.5px solid #fff;
}
.page{padding:22px 24px 48px;max-width:1400px;width:100%;margin:0 auto}

/* ---------- 通用组件 ---------- */
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:18px;flex-wrap:wrap}
.page-title{font-size:20px;font-weight:650;margin:0;letter-spacing:-.2px}
.page-sub{font-size:12.5px;color:var(--muted);margin-top:5px}
.grid{display:grid;gap:16px}
.g4{grid-template-columns:repeat(4,1fr)}
.g3{grid-template-columns:repeat(3,1fr)}
.g2{grid-template-columns:repeat(2,1fr)}
.g21{grid-template-columns:1.6fr 1fr}
.mt{margin-top:16px}
.card{background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);overflow:hidden}
.card-head{padding:14px 18px;border-bottom:1px solid var(--line-soft);display:flex;align-items:center;justify-content:space-between;gap:12px}
.card-title{font-size:14px;font-weight:600}
.card-body{padding:16px 18px}
.card-body.tight{padding:0}
.stat{padding:18px}
.stat-label{font-size:12.5px;color:var(--muted);display:flex;align-items:center;gap:6px}
.stat-value{font-size:27px;font-weight:650;letter-spacing:-.6px;margin-top:8px;line-height:1.1}
.stat-foot{font-size:12px;color:var(--muted);margin-top:8px}
.up{color:var(--ok)}.down{color:var(--danger)}

.badge{display:inline-flex;align-items:center;gap:4px;height:22px;padding:0 8px;border-radius:6px;font-size:12px;font-weight:500;white-space:nowrap;vertical-align:middle}
.badge.green{background:var(--ok-soft);color:var(--ok)}
.badge.blue{background:var(--primary-soft);color:var(--primary)}
.badge.amber{background:var(--warn-soft);color:var(--warn)}
.badge.red{background:var(--danger-soft);color:var(--danger)}
.badge.gray{background:#f1f3f5;color:var(--sub)}

.btn{
  height:34px;padding:0 14px;border-radius:8px;border:1px solid var(--line);
  background:#fff;color:#333;font-size:13px;cursor:pointer;font-family:inherit;
  display:inline-flex;align-items:center;gap:6px;transition:.15s;white-space:nowrap;
}
.btn:hover{background:#f7f8fa}
.btn.primary{background:var(--primary);border-color:var(--primary);color:#fff}
.btn.primary:hover{background:#255ae0}
.btn.ghost{border-color:transparent;background:transparent;color:var(--primary)}
.btn.ghost:hover{background:var(--primary-soft)}
.btn.sm{height:28px;padding:0 10px;font-size:12px;border-radius:6px}
.btn.danger{color:var(--danger);border-color:#f3c9c9}

.input,.select{
  height:34px;border:1px solid var(--line);border-radius:8px;padding:0 10px;
  font-size:13px;background:#fff;color:var(--text);font-family:inherit;outline:none;
}
.input::placeholder{color:#a8aeb7}
.input:focus,.select:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(47,107,255,.1)}
.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px}
.toolbar .spacer{flex:1}
.search{width:230px}

.tbl{width:100%;border-collapse:collapse;font-size:13px}
.tbl th{
  text-align:left;font-weight:500;color:#6b7280;background:#fafbfc;
  padding:9px 14px;border-bottom:1px solid var(--line);white-space:nowrap;font-size:12.5px;
}
.tbl td{padding:11px 14px;border-bottom:1px solid var(--line-soft);vertical-align:middle}
.tbl tbody tr:last-child td{border-bottom:none}
.tbl tbody tr:hover{background:#fafbfc}
.tbl tr.link{cursor:pointer}
.tbl .num{text-align:right;font-variant-numeric:tabular-nums}
.tbl .strong{font-weight:600}

.tabs{display:flex;gap:2px;border-bottom:1px solid var(--line);margin-bottom:18px}
.tab{padding:10px 14px;font-size:13.5px;color:var(--sub);cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px;user-select:none}
.tab:hover{color:var(--text)}
.tab.active{color:var(--primary);border-bottom-color:var(--primary);font-weight:600}

.avatar{
  width:36px;height:36px;border-radius:50%;background:var(--primary-soft);color:var(--primary);
  display:flex;align-items:center;justify-content:center;font-weight:600;font-size:13px;flex:0 0 auto;
}
.avatar.lg{width:64px;height:64px;font-size:22px;border-radius:18px}
.person{display:flex;align-items:center;gap:10px}
.person-name{font-weight:600;font-size:13px}
.person-sub{font-size:12px;color:var(--muted);margin-top:2px}

.bars{display:flex;align-items:flex-end;gap:10px;height:158px;padding-top:8px}
.card:has(.bars){display:flex;flex-direction:column}
.card:has(.bars) .card-body{flex:1;display:flex;flex-direction:column;justify-content:flex-end}
.card:has(.bars) .bars{flex:1;height:auto;min-height:150px}
.bar-col{flex:1;display:flex;flex-direction:column;align-items:center;gap:7px;height:100%;justify-content:flex-end;min-width:0}
.bar-wrap{flex:1;width:100%;display:flex;align-items:flex-end;justify-content:center}
.bar{width:100%;max-width:36px;background:linear-gradient(180deg,#6f9bff,#2f6bff);border-radius:6px 6px 0 0;min-height:4px;transition:.3s}
.bar.soft{background:linear-gradient(180deg,#dbe4f7,#c3d2f2)}
.bar-label{font-size:11px;color:#8a9099;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.bar-label.on{color:#4a515b}

.legend{display:flex;gap:16px;font-size:12px;color:var(--sub);flex-wrap:wrap}
.legend i{display:inline-block;width:8px;height:8px;border-radius:2px;margin-right:5px}

.donut{width:132px;height:132px;border-radius:50%;position:relative;flex:0 0 auto}
.donut::after{
  content:"";position:absolute;inset:26px;background:#fff;border-radius:50%;
}
.donut-center{
  position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;
  z-index:2;font-size:12px;color:var(--muted);
}
.donut-center b{font-size:19px;color:var(--text);font-weight:650}

.tree-row{display:flex;align-items:center;gap:9px;padding:8px 10px;border-radius:8px;cursor:pointer;font-size:13.5px}
.tree-row:hover{background:#f6f8fb}
.tree-row.active{background:var(--primary-soft);color:var(--primary);font-weight:600}
.tree-row .count{margin-left:auto;color:#9aa1ab;font-size:12px;font-weight:400}
.tree-indent{display:inline-block;width:18px}

.kanban{display:grid;grid-template-columns:repeat(5,1fr);gap:12px}
.kcol{background:#f0f2f5;border-radius:10px;padding:10px;min-height:400px}
.kcol-head{font-size:12.5px;font-weight:600;color:var(--sub);display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;padding:0 2px}
.kcount{background:#fff;border-radius:99px;padding:0 7px;height:18px;display:inline-flex;align-items:center;font-size:11px;color:var(--sub)}
.kcard{background:#fff;border:1px solid #e3e6ea;border-radius:8px;padding:10px;margin-bottom:8px;cursor:pointer;transition:.15s}
.kcard:hover{box-shadow:0 4px 14px rgba(16,24,40,.1);transform:translateY(-1px)}
.kcard-name{font-size:13px;font-weight:600}
.kcard-sub{font-size:11.5px;color:var(--muted);margin-top:3px}
.kcard-foot{display:flex;justify-content:space-between;align-items:center;margin-top:8px;font-size:11px;color:#9aa1ab}
.tag{display:inline-block;padding:1px 6px;border-radius:4px;background:#f3f5f8;color:#6b7280;font-size:11px}

.kv{display:grid;grid-template-columns:96px 1fr;gap:12px 14px;font-size:13px;margin:0}
.kv dt{color:var(--muted)}
.kv dd{margin:0;color:var(--text)}

.bar-line{height:6px;background:#eef0f3;border-radius:99px;overflow:hidden}
.bar-line i{display:block;height:100%;background:var(--primary);border-radius:99px}
.bar-line i.over{background:#f79009}

.payslip{max-width:620px;margin:0 auto}
.payslip-row{display:flex;justify-content:space-between;padding:9px 0;border-bottom:1px dashed #e9ebef;font-size:13px}
.payslip-row:last-child{border-bottom:none}
.total{display:flex;justify-content:space-between;align-items:baseline;padding:18px 0 6px;border-top:2px solid #1f2329;margin-top:12px}
.total .amount{font-size:28px;font-weight:700;color:var(--ok);letter-spacing:-.5px}
.section-label{font-size:11.5px;font-weight:600;color:#9aa1ab;letter-spacing:.06em;margin:16px 0 6px}

.empty{padding:44px 20px;text-align:center;color:#9aa1ab;font-size:13px}
.divider{height:1px;background:var(--line-soft);margin:14px 0}

.toast-wrap{position:fixed;top:22px;left:50%;transform:translateX(-50%);z-index:400;display:flex;flex-direction:column;gap:8px;align-items:center}
.toast{
  background:#1f2329;color:#fff;padding:9px 16px;border-radius:8px;font-size:13px;
  box-shadow:0 10px 30px rgba(0,0,0,.2);animation:toastIn .18s ease;
}
@keyframes toastIn{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:none}}

.modal-mask{position:fixed;inset:0;background:rgba(16,24,40,.36);display:none;align-items:center;justify-content:center;z-index:300;padding:20px}
.modal-mask.show{display:flex}
.modal{background:#fff;border-radius:14px;width:660px;max-width:100%;max-height:88vh;overflow:auto;box-shadow:0 30px 70px rgba(16,24,40,.28);animation:toastIn .18s ease}
.modal-head{padding:18px 22px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center}
.modal-title{font-size:15px;font-weight:650}
.modal-body{padding:20px 22px}
.modal-foot{padding:14px 22px;border-top:1px solid var(--line);display:flex;justify-content:flex-end;gap:10px}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:14px 16px}
.field{display:flex;flex-direction:column;gap:6px}
.field label{font-size:12.5px;color:var(--sub)}
.field .input,.field .select{width:100%}
.close-x{border:none;background:transparent;font-size:20px;line-height:1;color:#9aa1ab;cursor:pointer;padding:2px 6px}
.close-x:hover{color:var(--text)}

.notice{
  display:flex;gap:12px;padding:12px 14px;border-radius:10px;
  background:var(--primary-soft);color:#2b4a8a;font-size:12.5px;line-height:1.6;
}
.notice b{color:#1d3a7a}
.todo-item{display:flex;gap:12px;align-items:flex-start;padding:12px 0;border-bottom:1px solid var(--line-soft)}
.todo-item:last-child{border-bottom:none}
.todo-icon{width:30px;height:30px;border-radius:8px;background:#f3f5f8;display:flex;align-items:center;justify-content:center;font-size:14px;flex:0 0 30px}
.todo-title{font-size:13px;font-weight:500}
.todo-sub{font-size:12px;color:var(--muted);margin-top:3px}
.todo-item .btn{margin-left:auto}

@media (max-width:1180px){
  .g4{grid-template-columns:repeat(2,1fr)}
  .g3{grid-template-columns:repeat(2,1fr)}
  .g21{grid-template-columns:1fr}
  .kanban{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:860px){
  .sidebar{display:none}
  .main{margin-left:0}
  .g4,.g3,.g2{grid-template-columns:1fr}
  .top-search{display:none}
}
