/* ============ 启界CRM · 客服数据管理系统 ============ */
:root {
  --primary: #2563eb;
  --primary-600: #1d4ed8;
  --primary-soft: #eef4ff;
  --success: #16a34a;
  --success-soft: #e9f8ef;
  --warning: #d97706;
  --warning-soft: #fff6e8;
  --danger: #dc2626;
  --danger-soft: #fdeeee;
  --purple: #7c3aed;
  --text: #1e2635;
  --text-2: #4b5565;
  --muted: #8794a5;
  --line: #e9edf4;
  --line-strong: #dce3ee;
  --bg: #f4f6fb;
  --card: #ffffff;
  --sidebar: #1b2233;
  --sidebar-2: #232c40;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px -18px rgba(16, 24, 40, 0.25);
  --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--primary); text-decoration: none; }
svg { display: block; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cfd8e6; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 登录页 ============ */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: #fff;
}
.login-brand {
  position: relative;
  overflow: hidden;
  padding: 56px 64px;
  color: #fff;
  background: radial-gradient(120% 120% at 0% 0%, #1e3a8a 0%, #172554 45%, #0f172a 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-brand::before,
.login-brand::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.login-brand::before {
  width: 520px; height: 520px;
  right: -180px; top: -160px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.45), transparent 65%);
  filter: blur(10px);
}
.login-brand::after {
  width: 420px; height: 420px;
  left: -140px; bottom: -180px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.28), transparent 65%);
}
.login-brand > * { position: relative; z-index: 1; }
.brand-mark { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  display: grid; place-items: center;
  font-size: 20px; font-weight: 700; color: #fff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
}
.brand-name { font-size: 20px; font-weight: 600; letter-spacing: 0.5px; }
.brand-name span { font-weight: 400; opacity: 0.65; font-size: 14px; margin-left: 8px; }
.login-hero { max-width: 480px; margin: 30px 0; }
.login-hero h1 { font-size: 38px; line-height: 1.35; font-weight: 600; letter-spacing: 0.5px; }
.login-hero h1 em { font-style: normal; color: #7dd3fc; }
.login-hero p { margin-top: 18px; font-size: 15px; line-height: 1.9; color: rgba(226, 240, 255, 0.72); }
.login-features { display: flex; flex-direction: column; gap: 14px; margin-top: 28px; }
.login-feature { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; color: rgba(226, 240, 255, 0.9); }
.login-feature .fi {
  width: 30px; height: 30px; flex: none; border-radius: 9px;
  background: rgba(96, 165, 250, 0.16);
  border: 1px solid rgba(147, 197, 253, 0.25);
  display: grid; place-items: center; color: #93c5fd;
}
.login-feature b { display: block; font-weight: 500; margin-bottom: 2px; }
.login-feature small { color: rgba(191, 219, 254, 0.6); font-size: 12px; }
.login-stats { display: flex; gap: 48px; padding-top: 28px; border-top: 1px solid rgba(148, 163, 184, 0.2); }
.login-stats b { font-size: 26px; font-weight: 600; }
.login-stats small { display: block; margin-top: 4px; color: rgba(191, 219, 254, 0.6); font-size: 12px; }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: #fff; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 26px; font-weight: 600; letter-spacing: 0.3px; }
.login-card .sub { margin: 10px 0 30px; color: var(--muted); font-size: 13.5px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 8px; font-weight: 500; }
.field label i { color: var(--danger); font-style: normal; margin-left: 2px; }
.input-box { position: relative; display: flex; align-items: center; }
.input-box .lead { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.input-box .tail { position: absolute; right: 8px; color: var(--muted); padding: 6px; border-radius: 6px; }
.input-box .tail:hover { background: var(--primary-soft); color: var(--primary); }
.input-box input { width: 100%; height: 44px; padding: 0 42px; border-radius: 9px; border: 1px solid var(--line-strong); background: #fbfcfe; transition: 0.18s; }
.input-box input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.login-row { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 22px; font-size: 13px; color: var(--text-2); }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.check input { width: 15px; height: 15px; accent-color: var(--primary); }
.login-btn {
  width: 100%; height: 46px; border-radius: 9px; font-size: 15px; font-weight: 500; color: #fff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 10px 24px -10px rgba(37, 99, 235, 0.75);
  transition: 0.2s; display: grid; place-items: center;
}
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -12px rgba(37, 99, 235, 0.8); }
.login-btn:active { transform: translateY(0); }
.login-error {
  display: none; margin-bottom: 16px; padding: 10px 13px; border-radius: 8px;
  background: var(--danger-soft); color: var(--danger); font-size: 13px;
  align-items: center; gap: 8px;
}
.login-error.show { display: flex; animation: shake 0.28s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.demo-box { margin-top: 28px; padding-top: 22px; border-top: 1px dashed var(--line-strong); }
.demo-box h4 { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.demo-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-chip {
  text-align: left; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: #fafbfe; transition: 0.16s;
}
.demo-chip:hover { border-color: #bcd0f7; background: var(--primary-soft); }
.demo-chip b { display: block; font-size: 12.5px; font-weight: 500; }
.demo-chip small { color: var(--muted); font-size: 11.5px; }
.login-foot { margin-top: 22px; text-align: center; font-size: 12px; color: #aab4c3; }

/* ============ 应用框架 ============ */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 232px; z-index: 60;
  background: linear-gradient(180deg, var(--sidebar) 0%, #182031 100%);
  color: #cbd5e1; display: flex; flex-direction: column;
  transition: transform 0.24s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 16px; }
.sidebar-brand .brand-logo { width: 36px; height: 36px; border-radius: 10px; font-size: 17px; }
.sidebar-brand .t { font-size: 15.5px; font-weight: 600; color: #f1f5f9; letter-spacing: 0.4px; line-height: 1.25; }
.sidebar-brand .t small { display: block; font-weight: 400; font-size: 11px; color: #64748b; margin-top: 2px; letter-spacing: 0.2px; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 6px 12px 16px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: #334155; }
.nav-group { margin-top: 14px; }
.nav-group-title { font-size: 11px; color: #5b6b82; padding: 0 10px 7px; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 11px; margin-bottom: 2px; border-radius: 8px;
  color: #aab8cc; font-size: 13.5px; text-align: left; transition: 0.15s; position: relative;
}
.nav-item svg { color: #7d8ca3; transition: 0.15s; }
.nav-item:hover { background: rgba(148, 163, 184, 0.1); color: #e2e8f0; }
.nav-item:hover svg { color: #cbd5e1; }
.nav-item.active { background: linear-gradient(90deg, rgba(37, 99, 235, 0.9), rgba(37, 99, 235, 0.65)); color: #fff; box-shadow: 0 6px 16px -8px rgba(37, 99, 235, 0.9); }
.nav-item.active svg { color: #fff; }
.nav-item .lock { margin-left: auto; opacity: 0.5; }
.sidebar-foot { border-top: 1px solid rgba(148, 163, 184, 0.12); padding: 12px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 9px; cursor: pointer; transition: 0.15s; }
.sidebar-user:hover { background: rgba(148, 163, 184, 0.1); }
.sidebar-user .meta { min-width: 0; flex: 1; }
.sidebar-user .meta b { display: block; font-size: 13px; color: #e2e8f0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .meta small { color: #7d8ca3; font-size: 11.5px; }
.sidebar-user > svg { color: #5b6b82; }

.sidebar-mask { display: none; }
.main { flex: 1; min-width: 0; margin-left: 232px; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.top-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.burger { display: none; width: 36px; height: 36px; border-radius: 8px; place-items: center; color: var(--text-2); }
.burger:hover { background: var(--bg); }
.crumb { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.crumb b { color: var(--text); font-weight: 500; }
.crumb .sep { color: #cbd5e1; }
.top-right { display: flex; align-items: center; gap: 10px; }
.scope-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
  border-radius: 20px; background: var(--primary-soft); color: var(--primary);
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.scope-chip svg { flex: none; }
.icon-btn {
  position: relative; width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; color: var(--text-2); transition: 0.15s;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 1.5px solid #fff; }
.user-trigger { display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; border-radius: 22px; transition: 0.15s; }
.user-trigger:hover { background: var(--bg); }
.user-trigger .un { font-size: 13px; font-weight: 500; }
.user-trigger .ur { font-size: 11px; color: var(--muted); }
.user-trigger > svg { color: var(--muted); }
.user-menu {
  position: absolute; right: 20px; top: 56px; width: 200px; z-index: 50;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 16px 40px -12px rgba(16, 24, 40, 0.28); padding: 6px; display: none;
}
.user-menu.show { display: block; animation: pop 0.14s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
.user-menu-head { padding: 10px 11px 11px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.user-menu-head b { display: block; font-size: 13.5px; }
.user-menu-head small { color: var(--muted); font-size: 11.5px; }
.user-menu button {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 11px;
  border-radius: 7px; font-size: 13px; color: var(--text-2); text-align: left;
}
.user-menu button:hover { background: var(--bg); color: var(--text); }
.user-menu button.danger { color: var(--danger); }
.user-menu button.danger:hover { background: var(--danger-soft); }

.page { padding: 22px 24px 44px; max-width: 1600px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h1 { font-size: 21px; font-weight: 600; letter-spacing: 0.3px; }
.page-head p { margin-top: 6px; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

/* ============ 通用组件 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 8px; font-size: 13px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--text-2);
  transition: 0.15s; white-space: nowrap;
}
.btn:hover { border-color: #b9c7dc; color: var(--text); background: #fbfcff; }
.btn svg { flex: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px -6px rgba(37, 99, 235, 0.8); }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #128a3f; border-color: #128a3f; color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-ghost-danger { color: var(--danger); border-color: #f3c6c6; background: #fff; }
.btn-ghost-danger:hover { background: var(--danger-soft); border-color: #eb9d9d; color: var(--danger); }
.btn-sm { height: 29px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-link { color: var(--primary); padding: 0 6px; font-size: 12.5px; height: 26px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px; }
.btn-link:hover { background: var(--primary-soft); }
.btn-link.danger { color: var(--danger); }
.btn-link.danger:hover { background: var(--danger-soft); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-head h3 .tag { font-size: 11px; font-weight: 400; color: var(--muted); background: var(--bg); padding: 2px 7px; border-radius: 10px; }
.card-head .tools { display: flex; align-items: center; gap: 8px; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }

.seg { display: inline-flex; background: var(--bg); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { height: 27px; padding: 0 11px; border-radius: 6px; font-size: 12.5px; color: var(--text-2); transition: 0.15s; }
.seg button.on { background: #fff; color: var(--primary); font-weight: 500; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.1); }

.select, .input {
  height: 34px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: #fff; font-size: 13px; color: var(--text); transition: 0.15s; min-width: 0;
}
.select:focus, .input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.input::placeholder { color: #aab4c3; }
select.select { padding-right: 28px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238794a5' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
textarea.input { height: auto; padding: 10px 11px; resize: vertical; line-height: 1.7; }

.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.filter-bar .fld { display: flex; align-items: center; gap: 7px; }
.filter-bar .fld > span { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.filter-bar .spacer { flex: 1; }
.date-sep { color: var(--muted); font-size: 12px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; right: -22px; top: -28px; width: 92px; height: 92px; border-radius: 50%; background: var(--tint, #eef4ff); opacity: 0.55; }
.stat-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.stat-top .label { font-size: 12.5px; color: var(--muted); }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--tint, #eef4ff); color: var(--tone, var(--primary)); }
.stat-value { margin-top: 10px; font-size: 27px; font-weight: 600; letter-spacing: 0.3px; position: relative; z-index: 1; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.stat-foot { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; position: relative; z-index: 1; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 500; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--muted); }

.chip-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 8px; background: #fff; border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); }
.chip b { font-size: 13.5px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 12px;
  padding: 11px 14px; background: #f8fafd; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid #f1f4f9; color: var(--text-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: #f8fbff; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .center { text-align: center; }
.table .ops { text-align: right; white-space: nowrap; }
.table th.num { text-align: right; }
.table .strong { color: var(--text); font-weight: 500; }
.table .sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.row-click { cursor: pointer; }

.who { display: flex; align-items: center; gap: 9px; }
.who .info { line-height: 1.35; }
.who b { font-size: 13px; color: var(--text); font-weight: 500; }
.who small { display: block; color: var(--muted); font-size: 11.5px; }

.avatar {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 600;
  color: #fff; letter-spacing: 0.5px; user-select: none;
}
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.avatar.xl { width: 72px; height: 72px; font-size: 26px; }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 5px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.badge .bd { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-blue { background: #e8f1ff; color: #1d4ed8; }
.badge-purple { background: #f3e8ff; color: #7c3aed; }
.badge-cyan { background: #e0f5fa; color: #0891b2; }
.badge-gray { background: #eef2f7; color: #64748b; }
.badge-green { background: var(--success-soft); color: #15803d; }
.badge-orange { background: var(--warning-soft); color: #b45309; }
.badge-red { background: var(--danger-soft); color: var(--danger); }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.on { color: var(--success); }
.status.off { color: #94a3b8; }

.rank-no { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: #f1f5f9; color: #64748b; }
.rank-no.r1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; box-shadow: 0 4px 10px -4px rgba(245, 158, 11, 0.8); }
.rank-no.r2 { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; }
.rank-no.r3 { background: linear-gradient(135deg, #fda4af, #fb7185); color: #fff; }

.bar-track { height: 6px; border-radius: 4px; background: #eef2f9; overflow: hidden; min-width: 80px; }
.bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.money { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--text); }
.money.pos { color: var(--success); }
.money.neg { color: var(--danger); }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pagination .info { font-size: 12.5px; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 5px; }
.pager button { min-width: 30px; height: 30px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; color: var(--text-2); display: grid; place-items: center; }
.pager button:hover:not(:disabled) { border-color: #bcd0f7; color: var(--primary); }
.pager button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager button:disabled { opacity: 0.45; cursor: not-allowed; }
.pager .ellipsis { color: var(--muted); padding: 0 2px; }

.empty { padding: 58px 20px; text-align: center; color: var(--muted); }
.empty .art { width: 74px; height: 74px; margin: 0 auto 14px; border-radius: 22px; background: linear-gradient(140deg, #eef4ff, #f6f9ff); display: grid; place-items: center; color: #b7c6dd; }
.empty b { display: block; color: var(--text-2); font-weight: 500; margin-bottom: 5px; font-size: 13.5px; }
.empty p { font-size: 12.5px; }

/* ============ 弹窗 / 提示 ============ */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center;
  padding: 7vh 18px 30px; background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(3px);
  overflow-y: auto; animation: fade 0.16s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; background: #fff; border-radius: 13px;
  box-shadow: 0 30px 70px -20px rgba(15, 23, 42, 0.5);
  animation: rise 0.2s cubic-bezier(0.2, 0.9, 0.3, 1); overflow: hidden; margin-bottom: 30px;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(0.985); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 19px 22px 15px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16.5px; font-weight: 600; }
.modal-head p { margin-top: 5px; font-size: 12.5px; color: var(--muted); }
.modal-x { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); flex: none; }
.modal-x:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 20px 22px; }
.modal-body.tight { padding: 16px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 22px 18px; border-top: 1px solid var(--line); background: #fcfdff; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-item label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 7px; font-weight: 500; }
.form-item label i { color: var(--danger); font-style: normal; margin-left: 2px; }
.form-item .input, .form-item .select { width: 100%; height: 38px; }
.form-item textarea.input { height: auto; min-height: 92px; }
.form-item .hint { margin-top: 6px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.form-item .err { margin-top: 5px; font-size: 11.5px; color: var(--danger); display: none; }
.form-item.invalid .err { display: block; }
.form-item.invalid .input, .form-item.invalid .select { border-color: var(--danger); background: #fffafa; }
.form-section { margin: 18px 0 10px; padding-top: 16px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.form-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }

.calc-box { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; background: #f8faff; border: 1px solid #e4edfb; border-radius: 9px; padding: 13px; }
.calc-box .c { text-align: center; }
.calc-box small { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.calc-box b { font-size: 17px; font-weight: 600; color: var(--primary); font-variant-numeric: tabular-nums; }

.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--line); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.detail-grid > div { background: #fff; padding: 11px 13px; }
.detail-grid small { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.detail-grid b { font-size: 13.5px; font-weight: 500; }

.toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px; padding: 10px 16px; border-radius: 9px;
  background: #fff; box-shadow: 0 12px 34px -10px rgba(15, 23, 42, 0.35);
  border: 1px solid var(--line); font-size: 13px; color: var(--text);
  animation: toastIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1); max-width: 90vw;
}
.toast.out { animation: toastOut 0.2s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }
.toast .ti { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; }
.toast.success .ti { background: var(--success); }
.toast.error .ti { background: var(--danger); }
.toast.warning .ti { background: var(--warning); }
.toast.info .ti { background: var(--primary); }

/* ============ 图表 ============ */
.chart-card .card-body { padding: 14px 16px 8px; }
.chart-legend { display: flex; gap: 16px; align-items: center; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.chart-legend i { width: 9px; height: 9px; border-radius: 2px; }
.chart-wrap { width: 100%; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-empty { padding: 46px 0; text-align: center; color: var(--muted); font-size: 12.5px; }
.donut-wrap { display: flex; align-items: center; gap: 20px; padding: 6px 0 10px; flex-wrap: wrap; }
.donut-list { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 9px; }
.donut-list .dl { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.donut-list .dl i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.donut-list .dl b { margin-left: auto; color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.donut-list .dl span.pct { width: 44px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.dash-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 16px; margin-top: 16px; }
.dash-side { display: flex; flex-direction: column; gap: 16px; }
.mini-list { display: flex; flex-direction: column; }
.mini-item { display: flex; align-items: center; gap: 10px; padding: 11px 17px; border-bottom: 1px solid #f2f5fa; }
.mini-item:last-child { border-bottom: none; }
.mini-item .meta { flex: 1; min-width: 0; }
.mini-item .meta b { font-size: 13px; font-weight: 500; color: var(--text); }
.mini-item .meta small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-item .val { text-align: right; font-variant-numeric: tabular-nums; }
.mini-item .val b { font-size: 13px; color: var(--text); }
.mini-item .val small { display: block; color: var(--muted); font-size: 11px; }
.notice-item { display: flex; gap: 11px; padding: 12px 17px; border-bottom: 1px solid #f2f5fa; cursor: pointer; transition: 0.12s; }
.notice-item:last-child { border-bottom: none; }
.notice-item:hover { background: #f8fbff; }
.notice-item .ni { width: 30px; height: 30px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.notice-item .meta { min-width: 0; }
.notice-item .meta b { display: block; font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notice-item .meta small { color: var(--muted); font-size: 11.5px; }

/* ============ 页面局部 ============ */
.page-tip { display: flex; align-items: flex-start; gap: 9px; padding: 11px 14px; border-radius: 9px; background: #f0f6ff; border: 1px solid #dbe8fd; color: #315ea8; font-size: 12.5px; line-height: 1.7; margin-bottom: 16px; }
.page-tip svg { flex: none; margin-top: 2px; }
.info-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.role-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.role-card .rt { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.role-card .rt b { font-size: 13.5px; }
.role-card p { font-size: 12px; color: var(--muted); line-height: 1.7; }
.role-card p b { color: var(--text-2); font-weight: 500; }

.perm-wrap { overflow-x: auto; }
.perm-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 640px; }
.perm-table th, .perm-table td { padding: 11px 13px; border-bottom: 1px solid #f1f4f9; text-align: center; }
.perm-table th { background: #f8fafd; font-size: 12px; color: var(--muted); font-weight: 500; }
.perm-table th:first-child, .perm-table td:first-child { text-align: left; }
.perm-table td .pg { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.perm-table td .pg svg { color: var(--muted); }
.perm-table .locked { display: inline-flex; align-items: center; gap: 5px; color: #9aa7b8; font-size: 12px; }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d5dce7; border-radius: 20px; transition: 0.18s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.18s; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.25); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(16px); }
.switch input:disabled + span { opacity: 0.5; cursor: not-allowed; }
.switch input:disabled:checked + span { opacity: 0.75; }

.org-tree { padding: 6px 18px 18px; }
.org-node { position: relative; }
.org-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; transition: 0.12s; }
.org-row:hover { background: #f7faff; }
.org-row .line { width: 1px; height: 18px; background: var(--line-strong); margin-left: 15px; }
.org-row .meta { flex: 1; min-width: 0; }
.org-row .meta b { font-size: 13px; font-weight: 500; }
.org-row .meta small { color: var(--muted); font-size: 11.5px; margin-left: 7px; }
.org-row .cnt { font-size: 11.5px; color: var(--muted); background: var(--bg); padding: 2px 8px; border-radius: 9px; }
.org-children { margin-left: 26px; border-left: 1px dashed #dfe6f1; padding-left: 10px; }

.profile-grid { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.profile-hero { text-align: center; padding: 28px 20px 22px; }
.profile-hero .avatar { margin: 0 auto 12px; }
.profile-hero h2 { font-size: 18px; font-weight: 600; }
.profile-hero .role { margin: 8px 0 16px; }
.profile-meta { display: flex; flex-direction: column; gap: 11px; padding: 16px 18px; border-top: 1px solid var(--line); text-align: left; }
.profile-meta .row { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.profile-meta .row span { color: var(--muted); }
.profile-meta .row b { font-weight: 500; text-align: right; }

.file-icon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: #fff; flex: none; letter-spacing: 0.3px; }
.file-csv { background: #16a34a; }
.file-xlsx { background: #0f9d58; }
.file-doc { background: #2563eb; }
.file-pdf { background: #dc2626; }
.file-zip { background: #7c3aed; }
.file-other { background: #64748b; }
.file-cell { display: flex; align-items: center; gap: 10px; }
.file-cell b { font-size: 13px; font-weight: 500; color: var(--text); }
.file-cell small { display: block; color: var(--muted); font-size: 11.5px; }

.announce-list { display: flex; flex-direction: column; gap: 12px; }
.announce-card { display: flex; gap: 14px; padding: 17px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: 0.15s; cursor: pointer; }
.announce-card:hover { border-color: #c8d8f5; box-shadow: 0 10px 26px -18px rgba(37, 99, 235, 0.5); transform: translateY(-1px); }
.announce-card .ai { width: 40px; height: 40px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.announce-card .meta { flex: 1; min-width: 0; }
.announce-card .meta h4 { font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.announce-card .meta p { font-size: 12.5px; color: var(--muted); line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.announce-card .meta .foot { display: flex; gap: 14px; margin-top: 8px; font-size: 11.5px; color: #9aa7b8; }
.announce-body { font-size: 13.5px; line-height: 2; color: var(--text-2); }
.announce-body p { margin-bottom: 10px; }
.announce-body p:last-child { margin-bottom: 0; }
.announce-body strong { color: var(--text); }

.legend-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }

/* ============ 数据录入弹窗：步进器 / 项目列表 / 交单详情 ============ */
.input[readonly] { background: #f7f9fc; color: var(--text-2); }
.stepper {
  display: inline-flex; align-items: center; height: 36px; width: 136px;
  border: 1px solid var(--line-strong); border-radius: 7px; overflow: hidden; background: #fff;
}
.stepper button {
  width: 34px; height: 100%; flex: none; display: grid; place-items: center;
  background: #f8fafd; color: var(--text-2); font-size: 16px; line-height: 1;
}
.stepper button:hover { background: var(--primary-soft); color: var(--primary); }
.stepper input {
  flex: 1; min-width: 0; height: 100%; border: none; outline: none; background: #fff;
  text-align: center; font-size: 13px; font-variant-numeric: tabular-nums;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input[type="number"] { -moz-appearance: textfield; }
.project-box { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.project-head, .proj-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 132px 92px 88px 100px; column-gap: 8px; align-items: center; }
.project-head { padding: 9px 14px; background: #f8fafd; font-size: 12px; color: var(--muted); white-space: nowrap; }
.project-head .r, .proj-row .r { text-align: right; }
.project-body { max-height: 236px; overflow-y: auto; }
.proj-row { padding: 8px 14px; border-top: 1px solid #f4f7fb; font-size: 13px; color: var(--text-2); }
.proj-row:nth-child(even) { background: #fbfcfe; }
.proj-row .idx { color: var(--muted); font-size: 12px; }
.proj-row .r { white-space: nowrap; }
.proj-row .money { color: #d97706; }
.proj-row .stepper { justify-self: end; }
.proj-empty { padding: 26px 14px; text-align: center; color: #9aa7b8; font-size: 12.5px; }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.kv { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.kv label { width: 96px; flex: none; text-align: right; color: var(--muted); white-space: nowrap; }
.kv span {
  flex: 1; min-width: 0; padding: 8px 11px; border: 1px solid var(--line);
  border-radius: 7px; background: #fbfcfe; color: var(--text-2); word-break: break-all;
}
.kv span.amt { color: #ea580c; font-weight: 600; }
@media (max-width: 720px) {
  .kv-grid { grid-template-columns: 1fr; }
  .project-box { overflow-x: auto; }
  .project-head, .proj-row { grid-template-columns: 34px minmax(88px, 1fr) 108px 62px 62px 76px; column-gap: 6px; min-width: 468px; }
  .stepper { width: 108px; }
}

@media (max-width: 1240px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .info-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 60px rgba(0, 0, 0, 0.4); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .burger { display: grid; }
  .profile-grid { grid-template-columns: 1fr; }
  .sidebar-mask { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); z-index: 55; }
  .sidebar-mask.show { display: block; }
}
@media (max-width: 720px) {
  .page { padding: 16px 14px 36px; }
  .topbar { padding: 0 14px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 21px; }
  .stat-card { padding: 13px 14px; }
  .info-cards { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .filter-bar { gap: 8px; }
  .filter-bar .fld { flex: 1 1 100%; }
  .filter-bar .fld .input, .filter-bar .fld .select { flex: 1; width: 100%; }
  .page-actions .btn span { display: none; }
  .scope-chip { display: none; }
  .user-trigger .un, .user-trigger .ur { display: none; }
  .calc-box { grid-template-columns: 1fr; gap: 8px; }
  .demo-list { grid-template-columns: 1fr; }
}
