/* ============================================================
   业绩榜大屏系统 · 后台样式（浅色仪表盘风，复用大屏演示令牌）
   ============================================================ */
:root {
  --pri: #25324b;
  --sec: #7c8aa5;
  --mut: #a9b4c8;
  --line: #eef1f7;
  --card: #ffffff;
  --card-sh: 0 12px 30px rgba(35, 55, 100, .08);
  --pos: #12b76a;
  --neg: #f5455c;
  --gold: #f7b731;
  --acc: #3b82f6;
  --acc2: #22a7f0;
  --bg: #f3f6fc;
  --sidebar-w: 232px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--pri);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--acc); text-decoration: none; }
a:hover { color: var(--acc2); }

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

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 22px; font-size: 18px; font-weight: 800;
  color: var(--pri); border-bottom: 1px solid var(--line);
}
.sidebar .brand .logo { color: var(--acc); display: flex; }
/* 覆盖 Bootstrap .nav 的横向 flex-wrap，强制侧边栏竖排 */
.sidebar .nav { padding: 14px 12px; flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; }
.sidebar .nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 11px; margin-bottom: 4px;
  color: var(--sec); font-size: 14.5px; font-weight: 600; cursor: pointer;
  transition: .18s;
}
.sidebar .nav-item:hover { background: #f4f7fd; color: var(--pri); }
.sidebar .nav-item.active { background: var(--acc); color: #fff; box-shadow: 0 6px 16px rgba(59,130,246,.28); }
.sidebar .nav-item.active .ico { color: #fff; }
.sidebar .nav-item .ico { color: var(--mut); display: flex; }
.sidebar .foot { padding: 12px; border-top: 1px solid var(--line); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; position: sticky; top: 0; z-index: 10;
}
.topbar .page-title { font-size: 17px; font-weight: 800; }
.topbar .who { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--sec); }
.content { padding: 24px 26px; flex: 1; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: none; border-radius: 16px;
  box-shadow: var(--card-sh);
}
.card .card-header {
  background: transparent; border-bottom: 1px solid var(--line);
  font-weight: 700; padding: 16px 20px;
}
.card .card-body { padding: 20px; }

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat {
  background: #fff; border-radius: 16px; box-shadow: var(--card-sh);
  padding: 20px; display: flex; align-items: center; gap: 16px;
}
.stat .ic {
  width: 48px; height: 48px; border-radius: 13px; flex: none;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.stat .ic.b { background: linear-gradient(135deg, #4f86f7, #22a7f0); }
.stat .ic.g { background: linear-gradient(135deg, #38d39f, #12b76a); }
.stat .ic.p { background: linear-gradient(135deg, #a855f7, #ec5cc8); }
.stat .ic.o { background: linear-gradient(135deg, #f7a733, #ff7a45); }
.stat .k { font-size: 13.5px; color: var(--sec); font-weight: 600; }
.stat .v { font-size: 28px; font-weight: 800; line-height: 1.1; letter-spacing: .5px; }

/* ---------- 表格 ---------- */
.table { --bs-table-hover-bg: #f6f9ff; margin: 0; }
.table > :not(caption) > * > * { padding: 12px 14px; }
.table thead th { color: var(--sec); font-weight: 700; font-size: 13px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.table td { vertical-align: middle; }

/* ---------- 按钮 ---------- */
.btn-primary { --bs-btn-bg: var(--acc); --bs-btn-border-color: var(--acc); --bs-btn-hover-bg: #2f74e6; --bs-btn-hover-border-color: #2f74e6; }
.btn-soft { background: #eef4ff; color: var(--acc); border: none; font-weight: 600; }
.btn-soft:hover { background: #e2edff; color: var(--acc); }
.btn-icon { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- 徽标 / 数值 ---------- */
.badge-soft { background: var(--line); color: var(--sec); font-weight: 600; border-radius: 6px; padding: 4px 9px; }
.pos { color: var(--pos); font-weight: 700; }
.neg { color: var(--neg); font-weight: 700; }
.num { font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif; }

/* ---------- 头像 ---------- */
.avatar {
  width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
  background: linear-gradient(140deg, #cdd8ee, #aebdda);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px; flex: none;
}

/* ---------- 表单 ---------- */
.form-label { font-weight: 600; font-size: 13.5px; color: var(--pri); margin-bottom: 6px; }
.form-control, .form-select { border-color: #e4e9f2; border-radius: 10px; padding: 9px 12px; }
.form-control:focus, .form-select:focus { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(59,130,246,.14); }
.form-text { color: var(--mut); }
.is-invalid ~ .invalid-feedback { display: block; }

/* ---------- 数据网格 ---------- */
.cell-dirty { background: #fff8e6 !important; border-color: var(--gold) !important; }
.text-mut { color: var(--mut); }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--mut); }
.empty .ic { color: #d4dcec; margin-bottom: 12px; display: flex; justify-content: center; }

/* ---------- 登录页 ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f3f7ff, #eaf0fb 60%, #f6f4ff); padding: 20px; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 22px; box-shadow: 0 24px 60px rgba(35,55,100,.14); padding: 38px 34px; }
.auth-card .logo { width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, var(--acc), var(--acc2));
  color: #fff; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.auth-card h1 { font-size: 21px; font-weight: 800; text-align: center; margin: 0 0 4px; }
.auth-card .sub { text-align: center; color: var(--mut); font-size: 13.5px; margin-bottom: 26px; }

/* ---------- 错误页 ---------- */
.err-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; }
.err-code { font-size: 84px; font-weight: 800; color: var(--acc); line-height: 1; }
.err-msg { color: var(--sec); font-size: 16px; margin: 12px 0 22px; }

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .sidebar { width: 68px; }
  .sidebar .brand span, .sidebar .nav-item span { display: none; }
}
