:root {
  --primary: #3370ff;
  --bg: #f5f6fa;
  --card-bg: #fff;
  --border: #e5e7eb;
  --text: #1f2329;
  --muted: #8f959e;
  --bad: #d93026;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: 56px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}
.brand { font-size: 18px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.filters { display: flex; align-items: center; gap: 10px; flex: 1; justify-content: center; }
.filter {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  max-width: 180px;
}
.name-input { width: 180px; }
.user-name { font-size: 14px; color: var(--muted); }
.logout { font-size: 13px; color: var(--primary); text-decoration: none; }

.btn-ghost {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.filter-info { font-size: 13px; color: var(--muted); }
.toolbar-right { display: flex; align-items: center; gap: 8px; }

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}
.page-info { font-size: 13px; color: var(--muted); }

.clickable { cursor: pointer; }
.clickable:hover { background: #eef3ff !important; }

.empty { text-align: center; color: var(--muted); padding: 24px 0; }

/* 员工详情弹窗 */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal[hidden] { display: none; }
.modal-box {
  width: min(920px, 94vw);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.modal-head h2 { font-size: 20px; }
.detail-meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.modal-close {
  border: none;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.modal-close:hover { color: var(--text); }
.modal-box h4 { font-size: 15px; margin: 18px 0 8px; }
.detail-chart { height: 220px; }
.scroll-box { overflow: auto; max-height: 260px; }

.container { max-width: 1080px; margin: 0 auto; padding: 20px 16px 48px; }
.loading { text-align: center; padding: 80px 0; color: var(--muted); }

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 16px;
  text-align: center;
}
.card-num { font-size: 28px; font-weight: 700; color: var(--primary); }
.card-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

.charts {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}
.chart-box, .table-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.chart-box h3, .table-box h3 {
  font-size: 15px;
  margin-bottom: 10px;
}
.chart { width: 100%; height: 320px; }

.table-box { margin-bottom: 20px; }
.sub { font-size: 13px; color: var(--muted); font-weight: 400; }

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.data-table thead th { color: var(--muted); font-weight: 500; background: #fafafa; }
.data-table tbody tr:hover { background: #f5f8ff; }
.data-table .bad { color: var(--bad); font-weight: 600; }

.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.6;
}
.badge-resigned { color: #fff; background: var(--bad); }
.badge-active { color: #27ae60; background: #e6f7ec; }

@media (max-width: 720px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .charts { grid-template-columns: 1fr; }
}
