/* ==========================================================================
   律文管理系统 · 页面与业务组件
   ========================================================================== */

/* ---------- 启动屏 ---------- */
.boot {
  position: fixed; inset: 0; z-index: 200; background: #0b1220;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  transition: opacity .35s ease;
}
.boot-logo .brand-mark {
  width: 54px; height: 54px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #4a68ff, #2c49e0); color: #fff;
  box-shadow: 0 18px 40px -14px rgba(59, 91, 255, .9);
}
.boot-logo .icon { width: 28px; height: 28px; stroke-width: 1.6; }
.boot-name { color: #e8edf9; font-size: 14px; letter-spacing: .22em; font-weight: 500; }
.boot-bar { width: 120px; height: 2px; background: rgba(255, 255, 255, .1); border-radius: 2px; overflow: hidden; }
.boot-bar span { display: block; width: 40%; height: 100%; background: #5b7bff; animation: bootSlide 1s ease infinite; }
.boot.done { opacity: 0; pointer-events: none; }
@keyframes bootSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(320%); } }

/* ---------- 登录 ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.08fr .92fr; background: #fff; }
.login-visual {
  position: relative; overflow: hidden; background:
    radial-gradient(900px 520px at 8% 0%, rgba(64, 89, 245, .5), transparent 60%),
    radial-gradient(700px 500px at 95% 100%, rgba(18, 184, 134, .22), transparent 55%),
    linear-gradient(150deg, #0a1120 0%, #0f1a33 55%, #101d3c 100%);
  color: #fff; padding: 46px 54px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-visual::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 64px 64px; mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 78%);
}
.login-visual .orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; }
.login-visual .orb.a { width: 300px; height: 300px; background: #3b5bff; top: -80px; right: -40px; }
.login-visual .orb.b { width: 240px; height: 240px; background: #0ca678; bottom: -90px; left: 10%; opacity: .28; }
.login-brand { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; }
.login-brand .brand-mark {
  width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, #5b7bff, #3350e8);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 28px -10px rgba(59, 91, 255, .9);
}
.login-brand .brand-name { font-weight: 650; font-size: 15px; letter-spacing: .04em; }
.login-brand .brand-sub { font-size: 11px; color: rgba(226, 233, 248, .55); letter-spacing: .16em; }
.login-copy { position: relative; z-index: 2; max-width: 520px; margin-top: 30px; }
.login-copy .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12);
  font-size: 11.5px; letter-spacing: .1em; color: #c9d6f5;
}
.login-copy h1 { font-size: 38px; line-height: 1.28; letter-spacing: -.02em; font-weight: 650; margin-top: 20px; }
.login-copy h1 em { font-style: normal; color: #8fa5ff; }
.login-copy p { margin-top: 16px; color: rgba(214, 223, 242, .68); font-size: 14px; line-height: 1.8; max-width: 440px; }
.login-points { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 34px; max-width: 560px; }
.login-point { padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, .055); border: 1px solid rgba(255, 255, 255, .1); }
.login-point .icon { width: 18px; height: 18px; color: #9fb2ff; }
.login-point .t { font-size: 12.5px; font-weight: 600; margin-top: 8px; color: #e7edfb; }
.login-point .d { font-size: 11px; color: rgba(198, 210, 236, .55); margin-top: 3px; line-height: 1.5; }
.login-foot { position: relative; z-index: 2; font-size: 11.5px; color: rgba(198, 210, 236, .42); letter-spacing: .04em; }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: #fbfcff; }
.login-box { width: min(380px, 100%); }
.login-box .hello { font-size: 12px; letter-spacing: .18em; color: var(--muted-2); font-weight: 600; }
.login-box h2 { font-size: 26px; letter-spacing: -.02em; margin-top: 8px; font-weight: 680; }
.login-box .lead { color: var(--muted); font-size: 13px; margin-top: 6px; }
.login-form { margin-top: 26px; display: flex; flex-direction: column; gap: 15px; }
.login-form .input { height: 46px; border-radius: 12px; background: #fff; }
.login-form .input-group .icon { width: 17px; height: 17px; }
.login-submit { height: 46px; border-radius: 12px; font-size: 14px; margin-top: 4px; }
.login-extra { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.demo-card { margin-top: 26px; border: 1px dashed #dbe2f0; border-radius: 13px; padding: 13px 15px; background: #fff; }
.demo-card .hd { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.demo-card .list { margin-top: 9px; display: grid; gap: 5px; font-size: 11.5px; color: var(--muted); }
.demo-card .list code { background: var(--bg-soft); padding: 1px 6px; border-radius: 5px; font-size: 11px; color: var(--ink-3); }
.login-error {
  display: none; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px;
  background: var(--red-soft); color: #c92a2a; font-size: 12.5px;
}
.login-error.show { display: flex; }

/* ---------- 主框架 ---------- */
.shell { min-height: 100vh; display: flex; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar); z-index: 60;
  background: linear-gradient(180deg, #0b1220 0%, #0c1526 60%, #0d1830 100%);
  color: #c5d0e5; display: flex; flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, .04);
}
.sidebar::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: radial-gradient(420px 260px at 0% 0%, rgba(59, 91, 255, .16), transparent 70%);
}
.sidebar-inner { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 18px; }
.brand .brand-mark {
  width: 40px; height: 40px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #4a68ff, #2c49e0); color: #fff;
  box-shadow: 0 14px 30px -12px rgba(59, 91, 255, .8);
}
.brand .brand-mark .icon { width: 22px; height: 22px; }
.brand-text { min-width: 0; }
.brand-text .name { color: #f2f6ff; font-weight: 650; font-size: 15px; letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-text .sub { color: rgba(197, 208, 229, .42); font-size: 10.5px; letter-spacing: .12em; margin-top: 2px; }
.nav-scroll { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.nav-scroll::-webkit-scrollbar { width: 5px; }
.nav-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .08); }
.nav-section-label { font-size: 10px; letter-spacing: .16em; color: rgba(197, 208, 229, .32); padding: 16px 10px 7px; font-weight: 600; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 11px;
  border-radius: 10px; color: #9cabc6; font-size: 13px; font-weight: 500; margin-bottom: 2px;
  transition: all .16s ease; cursor: pointer; user-select: none;
}
.nav-item .icon { width: 18px; height: 18px; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .05); color: #e8eefc; }
.nav-item.active {
  color: #fff; background: linear-gradient(90deg, rgba(74, 104, 255, .3), rgba(74, 104, 255, .06));
  box-shadow: inset 0 0 0 1px rgba(122, 146, 255, .16);
}
.nav-item.active .icon { color: #93a7ff; opacity: 1; }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px;
  border-radius: 0 3px 3px 0; background: #5b7bff;
}
.nav-badge {
  margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 6px;
  background: rgba(255, 255, 255, .08); color: #b9c6e2; font-size: 10.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.nav-item.active .nav-badge { background: rgba(122, 146, 255, .25); color: #dfe6ff; }
.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .06); }
.user-card {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 11px;
  background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .06);
}
.user-card .meta { min-width: 0; flex: 1; }
.user-card .nm { color: #eef3ff; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .rl { color: rgba(197, 208, 229, .45); font-size: 10.5px; }
.user-card .icon-btn { color: #91a0bd; }
.user-card .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.main { margin-left: var(--sidebar); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar); position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 16px;
  padding: 0 28px; background: rgba(244, 246, 251, .84); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(230, 234, 242, .8);
}
.page-title h1 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.page-title .crumb { font-size: 11.5px; color: var(--muted-2); margin-top: 1px; display: flex; align-items: center; gap: 5px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.top-search { position: relative; }
.top-search input {
  width: 210px; height: 36px; padding: 0 12px 0 34px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .7); outline: none; font-size: 12.5px; transition: all .18s ease;
}
.top-search input:focus { width: 260px; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(59, 91, 255, .1); }
.top-search .icon { position: absolute; left: 11px; top: 9px; width: 16px; height: 16px; color: var(--muted-2); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent;
  color: var(--muted); display: inline-flex; align-items: center; justify-content: center; transition: all .16s ease; position: relative;
}
.icon-btn:hover { background: #fff; border-color: var(--line); color: var(--ink); box-shadow: var(--shadow-sm); }
.icon-btn .dot-badge {
  position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); border: 1.5px solid #fff;
}
.status-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 12.5px;
  color: var(--ink-2); font-weight: 550; transition: all .16s ease; box-shadow: var(--shadow-sm);
}
.status-btn:hover { border-color: #d3daeb; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); flex: none; position: relative; }
.status-dot.online { background: #12b886; }
.status-dot.online::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 1px solid rgba(18, 184, 134, .45);
  animation: pulseDot 2s infinite;
}
.status-dot.idle { background: #f59f00; }
.status-dot.break { background: #7048e8; }
.status-dot.offline { background: #adb5bd; }
.status-menu {
  position: absolute; top: 46px; right: 0; width: 168px; padding: 6px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); z-index: 50;
  animation: modalIn .16s ease;
}
.status-menu button {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: none;
  background: none; border-radius: 8px; font-size: 12.5px; color: var(--ink-2); text-align: left;
}
.status-menu button:hover { background: var(--bg-soft); }
.status-menu button .check { margin-left: auto; color: var(--primary); }
.topbar-avatar { margin-left: 4px; display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 3px 4px 3px 8px; border-radius: 999px; }
.topbar-avatar:hover { background: #fff; box-shadow: var(--shadow-sm); }
.topbar-avatar .nm { font-size: 12.5px; font-weight: 600; }
.topbar-avatar .icon { color: var(--muted-2); width: 14px; height: 14px; }

.content { padding: 24px 28px 64px; width: 100%; max-width: 1560px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 25px; font-weight: 680; letter-spacing: -.025em; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 5px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.page-actions { display: flex; align-items: center; gap: 9px; }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.kpi {
  position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 17px 18px 15px; box-shadow: var(--shadow-sm);
}
.kpi::after {
  content: ""; position: absolute; right: -34px; top: -46px; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 91, 255, .07), transparent 68%);
}
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.kpi-icon {
  width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary-2);
}
.kpi-icon.green { background: var(--green-soft); color: #087f5b; }
.kpi-icon.amber { background: var(--amber-soft); color: #b45309; }
.kpi-icon.purple { background: var(--purple-soft); color: #5f3dc4; }
.kpi-icon.red { background: var(--red-soft); color: #c92a2a; }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-top: 13px; position: relative; z-index: 1; }
.kpi-value { font-size: 27px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; margin-top: 1px; position: relative; z-index: 1; font-variant-numeric: tabular-nums; }
.kpi-value .unit { font-size: 13px; font-weight: 600; color: var(--muted-2); margin-left: 3px; letter-spacing: 0; }
.kpi-foot { display: flex; align-items: center; gap: 7px; margin-top: 9px; font-size: 11.5px; color: var(--muted-2); position: relative; z-index: 1; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 650; font-size: 11.5px; }
.delta .icon { width: 12px; height: 12px; stroke-width: 2.4; }
.delta.up { color: #0ca678; }
.delta.down { color: #e03131; }
.delta.flat { color: var(--muted-2); }
.kpi-spark { position: absolute; right: 12px; bottom: 10px; width: 96px; height: 38px; opacity: .55; z-index: 0; }

/* ---------- 工作台 ---------- */
.dash-greeting { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-greeting h1 { font-size: 25px; font-weight: 680; letter-spacing: -.025em; }
.dash-greeting .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-top: 16px; align-items: start; }
.dash-grid.even { grid-template-columns: 1fr 1fr; }
.dash-grid.three { grid-template-columns: 1.25fr 1fr 1fr; }
.chart-box { width: 100%; height: 258px; position: relative; }
.chart-box.sm { height: 210px; }
.chart-svg { width: 100%; height: 100%; display: block; }
.chart-grid-line { stroke: #eef1f7; stroke-width: 1; }
.chart-axis-text { fill: #94a3b8; font-size: 10.5px; font-family: var(--font); }
.chart-label { fill: #64748b; font-size: 11px; font-family: var(--font); }
.legend { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.legend-item .swatch { width: 9px; height: 9px; border-radius: 3px; }
.donut-wrap { display: flex; align-items: center; gap: 12px; }
.donut-svg { width: 170px; height: 170px; flex: none; }
.donut-center-value { font-size: 22px; font-weight: 700; fill: var(--ink); font-family: var(--font); }
.donut-center-label { font-size: 10.5px; fill: var(--muted-2); font-family: var(--font); }
.donut-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.donut-legend-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.donut-legend-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.donut-legend-row .pct { color: var(--muted-2); font-size: 11.5px; font-variant-numeric: tabular-nums; }

.list-stream { display: flex; flex-direction: column; }
.stream-item { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.stream-item:last-child { border-bottom: none; padding-bottom: 0; }
.stream-item .st-main { flex: 1; min-width: 0; }
.stream-item .st-title { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.stream-item .st-title strong { font-weight: 650; color: var(--ink); }
.stream-item .st-meta { font-size: 11px; color: var(--muted-2); margin-top: 3px; display: flex; align-items: center; gap: 8px; }
.followup-dot { width: 30px; height: 30px; border-radius: 9px; background: var(--primary-soft); color: var(--primary-2); display: flex; align-items: center; justify-content: center; flex: none; }
.followup-dot .icon { width: 15px; height: 15px; }

.upcoming-row {
  display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 12px;
  transition: background .15s ease; cursor: pointer;
}
.upcoming-row:hover { background: #f7f9ff; }
.upcoming-row .date-chip {
  width: 44px; flex: none; text-align: center; border-radius: 9px; background: var(--bg-soft); padding: 5px 0;
}
.upcoming-row .date-chip .d { font-size: 15px; font-weight: 700; color: var(--ink-2); line-height: 1.1; }
.upcoming-row .date-chip .m { font-size: 9.5px; color: var(--muted-2); }
.upcoming-row .u-main { flex: 1; min-width: 0; }
.upcoming-row .u-name { font-size: 12.5px; font-weight: 600; }
.upcoming-row .u-meta { font-size: 11px; color: var(--muted-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upcoming-row .u-time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.upcoming-row.overdue .date-chip { background: var(--red-soft); }
.upcoming-row.overdue .date-chip .d { color: #c92a2a; }

.team-strip { display: flex; align-items: center; gap: 0; }
.team-strip .ts-item { flex: 1; padding: 8px 10px; text-align: center; border-right: 1px solid var(--line-soft); }
.team-strip .ts-item:last-child { border-right: none; }
.team-strip .ts-value { font-size: 20px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.team-strip .ts-label { font-size: 10.5px; color: var(--muted-2); margin-top: 1px; }

.funnel { display: flex; flex-direction: column; gap: 9px; }
.funnel-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.funnel-row .fn-label { width: 52px; color: var(--muted); flex: none; }
.funnel-row .fn-track { flex: 1; height: 26px; background: #f6f8fc; border-radius: 7px; overflow: hidden; position: relative; }
.funnel-row .fn-fill {
  height: 100%; border-radius: 7px; background: linear-gradient(90deg, rgba(91, 123, 255, .85), rgba(59, 91, 255, .55));
  display: flex; align-items: center; padding-left: 9px; color: #fff; font-size: 10.5px; font-weight: 600;
  min-width: 2px; transition: width .6s ease;
}
.funnel-row .fn-count { width: 44px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; }

/* ---------- 通用页 ---------- */
.surface { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.filter-card { padding: 14px 16px; margin-bottom: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-card .field-inline { display: flex; align-items: center; gap: 7px; }
.filter-card .select, .filter-card .input { height: 36px; border-radius: 9px; font-size: 12.5px; background: #fff; }
.filter-card .select { min-width: 116px; width: auto; flex: 0 0 auto; }
.filter-card .input { width: 150px; }
.filter-card .search-box input { height: 36px; width: 220px; }
.filter-card > .btn { flex: 0 0 auto; }

.table-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.table-card .table-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.table-card .table-head .ttl { font-size: 14px; font-weight: 650; }
.table-card .table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--muted); }
.pagination { display: flex; align-items: center; gap: 4px; }
.page-btn {
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; font-size: 12px; color: var(--ink-3); display: inline-flex; align-items: center; justify-content: center;
}
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.page-btn:disabled { opacity: .45; cursor: not-allowed; }

.summary-pills { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.summary-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 9px; background: var(--bg-soft); font-size: 12px; color: var(--muted); }
.summary-chip strong { color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- 客资 ---------- */
.lead-name { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.lead-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 1px; }
.grade-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 650; }
.grade-tag .g { width: 22px; height: 22px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.grade-A { background: #e8f3ff; color: #1763c7; }
.grade-B { background: var(--amber-soft); color: #b45309; }
.grade-C { background: #f1f3f8; color: #64748b; }
.next-follow { font-size: 12px; color: var(--ink-2); }
.next-follow.overdue { color: #c92a2a; font-weight: 600; }
.next-follow .rel { font-size: 10.5px; color: var(--muted-2); display: block; }

.detail-hero { display: flex; align-items: flex-start; gap: 14px; }
.detail-hero .dh-meta { flex: 1; min-width: 0; }
.detail-hero h2 { font-size: 19px; font-weight: 680; letter-spacing: -.02em; }
.detail-hero .dh-sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 18px; }
.detail-item .dl { font-size: 11px; color: var(--muted-2); margin-bottom: 2px; }
.detail-item .dv { font-size: 13px; color: var(--ink-2); font-weight: 500; word-break: break-word; }
.section-block { margin-top: 22px; }
.section-block .sb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-block .sb-head h4 { font-size: 13px; font-weight: 650; display: flex; align-items: center; gap: 7px; }
.section-block .sb-head h4 .icon { width: 15px; height: 15px; color: var(--muted-2); }

.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 5px; bottom: 8px; width: 1.5px; background: var(--line); }
.timeline-item { position: relative; padding-bottom: 17px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: -19px; top: 5px; width: 9px; height: 9px; border-radius: 50%;
  background: #fff; border: 2px solid #c3cce0;
}
.timeline-item.latest::before { border-color: var(--primary); background: var(--primary); box-shadow: 0 0 0 3px rgba(59, 91, 255, .13); }
.timeline-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted-2); margin-bottom: 4px; flex-wrap: wrap; }
.timeline-content { font-size: 12.5px; color: var(--ink-3); line-height: 1.65; }
.timeline-card { background: #fafbfe; border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 12px; margin-top: 5px; }

.followup-box { background: #fbfcff; border: 1px solid var(--line); border-radius: 13px; padding: 13px; }
.followup-box textarea { min-height: 74px; background: #fff; }
.quick-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.quick-chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px;
  font-size: 11px; color: var(--muted); transition: all .15s ease;
}
.quick-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* ---------- 客户 / 录音 ---------- */
.stat-line { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.stat-line .sl-item .sl-label { font-size: 11px; color: var(--muted-2); }
.stat-line .sl-item .sl-value { font-size: 17px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pay-ratio { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.pay-ratio .bar { flex: 1; }
.pay-ratio .pr-text { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.recording-card { border: 1px solid var(--line); border-radius: 13px; padding: 13px; margin-bottom: 10px; background: #fff; }
.recording-top { display: flex; align-items: center; gap: 11px; }
.rec-icon { width: 38px; height: 38px; border-radius: 11px; background: var(--purple-soft); color: #5f3dc4; display: flex; align-items: center; justify-content: center; flex: none; }
.rec-main { flex: 1; min-width: 0; }
.rec-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-meta { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.recording-card audio { width: 100%; height: 34px; margin-top: 10px; filter: saturate(.85); }
.transcript-box {
  margin-top: 10px; background: #fafbfe; border: 1px solid var(--line-soft); border-radius: 10px;
  padding: 10px 12px; font-size: 12px; color: var(--ink-3); line-height: 1.7; max-height: 140px; overflow: auto; white-space: pre-wrap;
}
.summary-box { margin-top: 10px; border-radius: 10px; background: linear-gradient(135deg, #f4f6ff, #fbf8ff); border: 1px solid #e3e7ff; padding: 11px 12px; }
.summary-box .sum-head { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 650; color: var(--primary-2); margin-bottom: 5px; }
.summary-box .sum-text { font-size: 12px; color: var(--ink-3); line-height: 1.65; }
.summary-box ul { margin: 6px 0 0; padding-left: 16px; font-size: 11.5px; color: var(--ink-3); line-height: 1.7; }

/* ---------- 案件 ---------- */
.score-cell { display: flex; align-items: center; gap: 8px; min-width: 92px; }
.score-cell .bar { width: 52px; }
.score-cell .sc { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; width: 30px; }
.grade-优质 { background: linear-gradient(135deg, #fff4d6, #ffe8ad); color: #96620a; }
.grade-中等 { background: #e9f0ff; color: #2b4fd0; }
.grade-常规 { background: #f1f3f8; color: #5b6577; }
.grade-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 650; }
.grade-badge .icon { width: 13px; height: 13px; }

.case-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fact-card { border: 1px solid var(--line-soft); border-radius: 11px; padding: 10px 12px; background: #fbfcfe; }
.fact-card .fk { font-size: 10.5px; color: var(--muted-2); }
.fact-card .fv { font-size: 13px; font-weight: 600; margin-top: 2px; }

.rule-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.rule-row:last-child { border-bottom: none; }
.rule-row.disabled { opacity: .5; }
.rule-score { min-width: 42px; text-align: center; font-weight: 700; color: var(--green); font-size: 13px; }
.rule-main { flex: 1; min-width: 0; }
.rule-name { font-size: 12.5px; font-weight: 600; }
.rule-desc { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.rule-cond { font-size: 11px; color: var(--muted); background: var(--bg-soft); padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.threshold-box { display: flex; align-items: flex-end; gap: 14px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcff; }

/* ---------- 分析 ---------- */
.analytics-tabs { margin-bottom: 16px; }
.region-score { display: flex; align-items: center; gap: 9px; min-width: 130px; }
.region-score .bar { width: 60px; }
.level-badge { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 24px; border-radius: 7px; font-size: 11.5px; font-weight: 700; }
.level-强 { background: var(--green-soft); color: #087f5b; }
.level-中 { background: var(--amber-soft); color: #b45309; }
.level-弱 { background: #f1f3f8; color: #64748b; }
.rank-badge { width: 24px; height: 24px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; background: var(--bg-soft); color: var(--muted); }
.rank-badge.top1 { background: linear-gradient(135deg, #ffe9a8, #f7c948); color: #8a5a00; }
.rank-badge.top2 { background: linear-gradient(135deg, #e9eef7, #cfd8e8); color: #4b5a72; }
.rank-badge.top3 { background: linear-gradient(135deg, #ffe0c7, #f2b184); color: #8a4b16; }
.drill-head { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: 13px; background: linear-gradient(120deg, #f3f6ff, #fbf9ff); border: 1px solid #e4e9ff; margin-bottom: 14px; }
.conv-bar { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.conv-bar .bar { width: 58px; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- 团队 ---------- */
.team-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.team-summary .ts-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.team-summary .ts-dot { width: 10px; height: 10px; border-radius: 50%; }
.team-summary .ts-num { font-size: 21px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.team-summary .ts-lbl { font-size: 11px; color: var(--muted-2); }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 14px; }
.team-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; transition: all .18s ease; }
.team-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.team-card .tc-top { display: flex; align-items: center; gap: 11px; }
.team-card .tc-main { flex: 1; min-width: 0; }
.team-card .tc-name { font-size: 13.5px; font-weight: 650; display: flex; align-items: center; gap: 6px; }
.team-card .tc-role { font-size: 11px; color: var(--muted-2); margin-top: 1px; }
.team-card .tc-status { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; margin-top: 12px; padding: 7px 10px; border-radius: 9px; background: var(--bg-soft); }
.team-card .tc-status .status-dot { width: 7px; height: 7px; }
.team-card .tc-status.online { background: var(--green-soft); color: #087f5b; }
.team-card .tc-status.idle { background: var(--amber-soft); color: #b45309; }
.team-card .tc-status.break { background: var(--purple-soft); color: #5f3dc4; }
.team-card .tc-status.offline { background: #f1f3f8; color: #64748b; }
.team-card .tc-timer { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 11px; opacity: .8; }
.team-card .tc-stats { display: flex; margin-top: 11px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.team-card .tc-stat { flex: 1; text-align: center; border-right: 1px solid var(--line-soft); }
.team-card .tc-stat:last-child { border-right: none; }
.team-card .tc-stat .v { font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.team-card .tc-stat .l { font-size: 10px; color: var(--muted-2); }
.team-card .tc-actions { display: flex; gap: 6px; margin-top: 11px; }

/* ---------- 权限 / 设置 ---------- */
.settings-layout { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-nav { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 3px; }
.settings-nav button {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 9px; border: none;
  background: transparent; color: var(--muted); font-size: 12.5px; text-align: left; font-weight: 500;
}
.settings-nav button:hover { background: #fff; color: var(--ink); }
.settings-nav button.active { background: #fff; color: var(--ink); font-weight: 650; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.settings-nav .icon { width: 16px; height: 16px; }
.settings-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.settings-panel .sp-head { padding: 17px 20px; border-bottom: 1px solid var(--line-soft); }
.settings-panel .sp-head h3 { font-size: 15px; font-weight: 650; }
.settings-panel .sp-head p { font-size: 12px; color: var(--muted-2); margin-top: 3px; }
.settings-panel .sp-body { padding: 20px; }
.settings-panel .sp-body.flush { padding: 0; }

.perm-group { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.perm-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 13px; background: #fafbfe; border-bottom: 1px solid var(--line-soft); }
.perm-group-head .pg-name { font-size: 12.5px; font-weight: 650; display: flex; align-items: center; gap: 7px; }
.perm-group-head .pg-name .icon { width: 14px; height: 14px; color: var(--muted-2); }
.perm-group-head .pg-all { font-size: 11px; color: var(--muted); }
.perm-items { padding: 10px 13px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.perm-check { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); cursor: pointer; }
.perm-check input { width: 15px; height: 15px; accent-color: var(--primary); }
.perm-check.inherited { color: var(--muted); }

.role-card { border: 1px solid var(--line); border-radius: 13px; padding: 14px 15px; margin-bottom: 10px; display: flex; align-items: center; gap: 12px; }
.role-card .rc-main { flex: 1; min-width: 0; }
.role-card .rc-name { font-size: 13px; font-weight: 650; display: flex; align-items: center; gap: 7px; }
.role-card .rc-desc { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }
.role-card .rc-meta { font-size: 11px; color: var(--muted); margin-top: 5px; }

.ai-status-card { display: flex; align-items: center; gap: 14px; padding: 15px 16px; border-radius: 13px; background: linear-gradient(120deg, #f4f6ff, #fcf9ff); border: 1px solid #e4e8ff; }
.ai-status-card .ai-orb { width: 44px; height: 44px; border-radius: 13px; background: linear-gradient(135deg, #7048e8, #3b5bff); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; box-shadow: 0 10px 24px -10px rgba(112, 72, 232, .8); }
.ai-status-card .ai-main { flex: 1; }
.ai-status-card .ai-title { font-size: 13px; font-weight: 650; }
.ai-status-card .ai-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------- 弹窗内小组件 ---------- */
.modal-tabs { display: flex; gap: 3px; padding: 3px; background: var(--bg-soft); border-radius: 10px; margin-bottom: 16px; }
.modal-tabs button { flex: 1; padding: 7px 10px; border: none; background: transparent; border-radius: 8px; font-size: 12px; color: var(--muted); font-weight: 550; }
.modal-tabs button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 650; }
.inline-note { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 10px; background: #f7f9ff; border: 1px solid #e6ebff; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.inline-note .icon { width: 15px; height: 15px; color: var(--primary); flex: none; margin-top: 1px; }
.inline-note.warn { background: #fffbf2; border-color: #f6e6c8; }
.inline-note.warn .icon { color: var(--amber); }
.ai-result-box { border: 1px solid #e3e7ff; background: linear-gradient(135deg, #f6f8ff, #fdfaff); border-radius: 12px; padding: 12px 14px; }
.ai-result-box .arb-head { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 650; color: var(--primary-2); letter-spacing: .03em; }
.ai-result-box .arb-body { margin-top: 7px; font-size: 12.5px; color: var(--ink-3); line-height: 1.65; }

.crime-picker { position: relative; }
.crime-picker .cp-hint { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11px; color: var(--muted-2); }
.crime-picker .cp-hint .ok { color: var(--green); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.crime-picker .cp-hint .bad { color: var(--amber); display: inline-flex; align-items: center; gap: 4px; }
.suggest-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow); z-index: 30; max-height: 240px; overflow: auto; padding: 5px; }
.suggest-list button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: none; background: none; border-radius: 8px; font-size: 12px; }
.suggest-list button:hover, .suggest-list button.active { background: var(--primary-soft); color: var(--primary-2); }

/* ---------- AI 助手 ---------- */
.ai-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 70; width: 52px; height: 52px; border-radius: 16px;
  border: none; background: linear-gradient(135deg, #5b7bff, #7048e8); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 18px 36px -12px rgba(80, 80, 255, .8);
  transition: transform .2s ease;
}
.ai-fab:hover { transform: translateY(-2px) scale(1.03); }
.ai-fab .icon { width: 24px; height: 24px; }
.ai-panel {
  position: fixed; right: 24px; bottom: 88px; z-index: 71; width: 372px; height: min(560px, calc(100vh - 130px));
  background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden; animation: modalIn .2s ease;
}
.ai-panel-head { padding: 14px 16px; background: linear-gradient(120deg, #141f3b, #1a2b55); color: #fff; display: flex; align-items: center; gap: 10px; }
.ai-panel-head .ic { width: 32px; height: 32px; border-radius: 9px; background: rgba(255, 255, 255, .12); display: flex; align-items: center; justify-content: center; }
.ai-panel-head .t { font-size: 13px; font-weight: 650; }
.ai-panel-head .s { font-size: 10.5px; color: rgba(214, 225, 248, .6); }
.ai-panel-head .close-btn { margin-left: auto; background: transparent; border-color: rgba(255, 255, 255, .18); color: #dbe4f7; }
.ai-messages { flex: 1; overflow: auto; padding: 14px; background: #fafbfe; display: flex; flex-direction: column; gap: 10px; }
.ai-msg { max-width: 88%; padding: 9px 12px; border-radius: 13px; font-size: 12.5px; line-height: 1.65; white-space: pre-wrap; }
.ai-msg.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.ai-msg.assistant { align-self: flex-start; background: #fff; border: 1px solid var(--line); color: var(--ink-2); border-bottom-left-radius: 4px; }
.ai-msg.assistant .err { color: var(--red); font-size: 12px; }
.ai-quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 10px; background: #fafbfe; }
.ai-quick button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 10px; font-size: 11px; color: var(--muted); }
.ai-quick button:hover { border-color: var(--primary); color: var(--primary); }
.ai-input { padding: 10px 12px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; align-items: flex-end; background: #fff; }
.ai-input textarea { flex: 1; border: none; outline: none; resize: none; height: 38px; max-height: 100px; padding: 9px 4px; font-size: 12.5px; line-height: 1.5; background: transparent; }
.ai-input .send-btn { width: 38px; height: 38px; border-radius: 11px; border: none; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }

/* ---------- 通知 ---------- */
.notify-menu {
  position: absolute; top: 46px; right: 0; width: 350px; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  z-index: 60; overflow: hidden; animation: modalIn .16s ease;
}
.notify-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); font-size: 12px; font-weight: 650; color: var(--ink-2); }
.notify-head button { border: none; background: none; color: var(--primary); font-size: 11.5px; font-weight: 550; }
.notify-list { max-height: 370px; overflow: auto; }
.notify-item { position: relative; display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 11px 13px; border: none; background: #fff; text-align: left; border-bottom: 1px solid var(--line-soft); }
.notify-item:hover { background: #fafbff; }
.notify-item.unread { background: #f7f9ff; }
.notify-icon { width: 30px; height: 30px; border-radius: 9px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary-2); }
.notify-icon .icon { width: 15px; height: 15px; }
.notify-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-right: 10px; }
.notify-title { font-size: 12.5px; font-weight: 620; color: var(--ink-2); }
.notify-body { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.notify-time { font-size: 10.5px; color: var(--muted-2); }
.notify-dot { position: absolute; right: 10px; top: 15px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.notify-empty { padding: 26px; text-align: center; font-size: 12px; color: var(--muted-2); }
.notify-foot { padding: 9px 14px; border-top: 1px solid var(--line-soft); background: #fbfcff; }
.notify-foot a { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.notify-foot a:hover { color: var(--primary); }

/* ---------- 接待汇总 ---------- */
.reception-strip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 14px; border-radius: 14px;
  background: linear-gradient(120deg, #f4f7ff, #fbfaff); border: 1px solid #e4e9ff;
}
.reception-strip .rs-main { display: flex; align-items: baseline; gap: 8px; margin-right: 6px; }
.reception-strip .rs-total { font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--primary-2); font-variant-numeric: tabular-nums; }
.reception-strip .rs-label { font-size: 11.5px; color: var(--muted); }
.reception-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border-radius: 999px; background: #fff; border: 1px solid #e2e7f4; font-size: 11.5px; color: var(--muted);
}
.reception-chip b { color: var(--ink-2); font-weight: 650; font-variant-numeric: tabular-nums; }
.reception-chip.strong { border-color: #dfe6ff; background: #f4f7ff; }
.reception-chip:hover { border-color: var(--primary); color: var(--primary-2); cursor: pointer; }

/* ---------- 罪名 TOP ---------- */
.top-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; align-items: start; }
.top-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px; }
.top-card .top-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.top-card .top-head h3 { font-size: 14px; font-weight: 650; }
.top-card .top-head .sub { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.top-card .segmented button { padding: 4px 10px; font-size: 11px; }
.top-row { display: flex; align-items: center; gap: 9px; padding: 8px 4px; border-bottom: 1px dashed var(--line-soft); cursor: pointer; border-radius: 7px; }
.top-row:last-child { border-bottom: none; }
.top-row:hover { background: #f8faff; }
.top-rank { width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; background: var(--bg-soft); color: var(--muted); flex: none; }
.top-rank.r1 { background: linear-gradient(135deg, #ffe9a8, #f7c948); color: #8a5a00; }
.top-rank.r2 { background: #e9eef7; color: #4b5a72; }
.top-rank.r3 { background: #ffe0c7; color: #8a4b16; }
.top-name { flex: 1; min-width: 0; font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-count { font-size: 12.5px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.top-sub { font-size: 10.5px; color: var(--muted-2); width: 54px; text-align: right; }

/* ---------- 案例库 ---------- */
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.lib-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: all .18s ease; }
.lib-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.lib-top { display: flex; align-items: flex-start; gap: 11px; }
.lib-icon { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex: none; background: var(--purple-soft); color: #5f3dc4; }
.lib-icon.audio { background: var(--primary-soft); color: var(--primary-2); }
.lib-title { font-size: 13.5px; font-weight: 650; line-height: 1.4; }
.lib-meta { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.lib-desc { font-size: 12px; color: var(--muted); line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lib-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.lib-card audio { width: 100%; height: 32px; }
.lib-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.lib-uploader { font-size: 10.5px; color: var(--muted-2); }

/* ---------- 直属库 ---------- */
.knowledge-list { display: flex; flex-direction: column; gap: 10px; }
.knowledge-row { display: flex; align-items: center; gap: 13px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.knowledge-row:hover { border-color: #d8e0f2; box-shadow: var(--shadow-sm); }
.knowledge-row .ki { width: 38px; height: 38px; border-radius: 11px; background: var(--cyan-soft); color: #0b7285; display: flex; align-items: center; justify-content: center; flex: none; }
.knowledge-row .km { flex: 1; min-width: 0; }
.knowledge-row .kt { font-size: 13px; font-weight: 620; }
.knowledge-row .kd { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-row .kmeta { font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }

/* ---------- 业绩 ---------- */
.perf-hero { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.perf-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; }
.perf-card .pc-label { font-size: 11.5px; color: var(--muted-2); }
.perf-card .pc-value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.perf-card .pc-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.perf-card.primary { background: linear-gradient(135deg, #0f1a33, #17274d); border: none; color: #fff; }
.perf-card.primary .pc-label { color: #93a5c6; }
.perf-card.primary .pc-sub { color: #8fa3c8; }
.perf-card.primary .pc-value { color: #fff; }
.perf-detail { display: flex; gap: 18px; flex-wrap: wrap; }
.perf-detail .pd-item { font-size: 12px; color: var(--muted); }
.perf-detail .pd-item b { color: var(--ink); font-size: 14px; margin-left: 4px; }

/* ---------- 日统计 ---------- */
.daily-section { margin-top: 20px; }
.daily-table td, .daily-table th { font-size: 12px; }
.daily-cell { display: flex; flex-direction: column; gap: 2px; }
.daily-cell .sec { font-weight: 600; font-variant-numeric: tabular-nums; }
.daily-cell .cnt { font-size: 10px; color: var(--muted-2); }

@media (max-width: 900px) {
  .top-duo { grid-template-columns: 1fr; }
  .perf-hero { grid-template-columns: 1fr 1fr; }
}

.progress-ring { transform: rotate(-90deg); }
.progress-ring .ring-bg { stroke: #eef1f7; }
.progress-ring .ring-fill { stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.score-gauge { display: flex; align-items: center; gap: 14px; }
.score-gauge .gauge-value { font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.score-gauge .gauge-label { font-size: 11px; color: var(--muted-2); margin-top: 3px; }
.donut-labels { display: flex; gap: 14px; flex-wrap: wrap; }

.upload-zone {
  border: 1.5px dashed #d6deef; border-radius: 13px; padding: 18px; text-align: center; background: #fbfcff;
  transition: all .18s ease; cursor: pointer;
}
.upload-zone:hover { border-color: var(--primary); background: var(--primary-soft); }
.upload-zone .icon { width: 22px; height: 22px; color: var(--muted-2); }
.upload-zone .uz-t { font-size: 12.5px; color: var(--ink-2); font-weight: 550; margin-top: 6px; }
.upload-zone .uz-d { font-size: 11px; color: var(--muted-2); margin-top: 2px; }

.file-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 10px; margin-bottom: 7px; background: #fff; }
.file-row .fi { width: 30px; height: 30px; border-radius: 8px; background: var(--bg-soft); color: var(--muted); display: flex; align-items: center; justify-content: center; flex: none; }
.file-row .fm { flex: 1; min-width: 0; }
.file-row .fn { font-size: 12px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .fs { font-size: 10.5px; color: var(--muted-2); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stack-12 > * + * { margin-top: 12px; }
.stack-16 > * + * { margin-top: 16px; }

@media (max-width: 1360px) {
  .dash-grid.three { grid-template-columns: 1fr 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  :root { --sidebar: 78px; }
  .brand { justify-content: center; padding: 18px 10px; }
  .brand-text, .nav-section-label, .nav-item span, .nav-badge, .user-card .meta, .user-card .icon-btn { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item.active::before { left: -6px; }
  .sidebar-foot { padding: 10px 12px; }
  .user-card { justify-content: center; padding: 8px; }
  .dash-grid, .dash-grid.even, .dash-grid.three { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .settings-nav button { white-space: nowrap; border: 1px solid var(--line); background: #fff; }
}
@media (max-width: 860px) {
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .content { padding: 18px 16px 60px; }
  .topbar { padding: 0 16px; }
  .top-search { display: none; }
  .page-head h1 { font-size: 21px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .team-summary { grid-template-columns: repeat(2, 1fr); }
  .two-col, .three-col, .report-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .ai-panel { right: 12px; left: 12px; width: auto; bottom: 80px; }
  .ai-fab { right: 16px; bottom: 16px; }
  .drawer-head, .drawer-body { padding-left: 16px; padding-right: 16px; }
}

/* v1.2 接待评级、案件标签、业绩看板 */
.rs-grades { display: flex; align-items: center; gap: 5px; padding-left: 6px; border-left: 1px dashed var(--line); }
.grade-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 9px; font-size: 11px; color: var(--muted); cursor: pointer; }
.grade-chip b { color: var(--ink); margin-left: 3px; }
.grade-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grade-block { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fff; }
.grade-block.grade-a { border-color: rgba(34,139,230,.35); background: linear-gradient(160deg,#f4f9ff,#fff); }
.grade-block.grade-b { border-color: rgba(245,158,11,.3); background: linear-gradient(160deg,#fffbf2,#fff); }
.grade-block.grade-c { border-color: var(--line); background: linear-gradient(160deg,#fafbfc,#fff); }
.gb-top { display: flex; justify-content: space-between; align-items: baseline; }
.gb-letter { font-size: 22px; font-weight: 800; letter-spacing: -.04em; }
.gb-count { font-size: 11px; color: var(--muted); }
.gb-bar { height: 6px; border-radius: 999px; background: var(--line-soft); margin: 9px 0 6px; overflow: hidden; }
.gb-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg,var(--primary),var(--purple)); }
.grade-a .gb-bar span { background: linear-gradient(90deg,#3b82f6,#6d5efc); }
.grade-b .gb-bar span { background: linear-gradient(90deg,#f59e0b,#f97316); }
.grade-c .gb-bar span { background: linear-gradient(90deg,#94a3b8,#64748b); }
.gb-pct { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }

.tag-picker { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-check { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; font-size: 11px; cursor: pointer; background: #fff; }
.tag-check:has(input:checked) { border-color: var(--purple); background: var(--purple-soft); color: var(--purple); font-weight: 600; }
.tag-check input { width: 12px; height: 12px; accent-color: var(--purple); }

.perf-table .perf-total td { background: #f8fafc; border-top: 1px solid var(--line); }
.quick-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-chip { border: 1px dashed var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 11px; color: var(--muted); cursor: pointer; }
.quick-chip:hover { border-color: var(--primary); color: var(--primary); }
.nowrap { white-space: nowrap; }

.date-bar { display:flex; align-items:center; flex-wrap:wrap; gap:8px; background:#fff; border:1px solid var(--line); border-radius:14px; padding:9px 14px; margin-bottom:12px; }
.date-bar .input { width:140px; height:32px; font-size:12px; }
.date-bar .date-label { font-size:11px; color:var(--muted); font-weight:600; }
.date-bar .date-sep { font-size:11px; color:var(--muted-2); }
.date-bar .btn { margin-left:auto; }

/* v1.3 聊天截图识别 */
.chat-import { border:1px dashed var(--line); border-radius:14px; padding:12px 14px; background:linear-gradient(120deg,#f8faff,#fff); }
.chat-preview img { max-height:180px; max-width:100%; border-radius:10px; border:1px solid var(--line); margin-top:10px; display:block; }

/* v1.5 官方法律数据源 */
.source-grid { display:grid; grid-template-columns:1.35fr 1fr; gap:16px; margin-bottom:18px; }
.source-card { min-width:0; }
.npc-search { display:flex; gap:8px; align-items:center; }
.npc-search .input { flex:1; min-width:0; }
.npc-list { display:flex; flex-direction:column; gap:8px; max-height:300px; overflow:auto; padding-right:4px; }
.npc-item { display:block; border:1px solid var(--line); border-radius:12px; padding:10px 12px; text-decoration:none; color:inherit; background:#fff; transition:border-color .15s, box-shadow .15s; }
.npc-item:hover { border-color:var(--primary); box-shadow:0 4px 14px rgba(59,91,255,.08); }
.npc-title { font-size:13px; font-weight:600; line-height:1.55; color:var(--ink); }
.npc-meta { display:flex; flex-wrap:wrap; gap:6px 10px; align-items:center; margin-top:6px; font-size:11px; color:var(--muted); }
@media (max-width:900px) { .source-grid { grid-template-columns:1fr; } }

/* v1.6 批量勾选删除 */
.bulk-bar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; background:#fff; border:1px solid var(--line); border-radius:12px; padding:8px 12px; margin-bottom:10px; }
.bulk-bar .bulk-check { display:inline-flex; align-items:center; gap:6px; font-size:12px; color:var(--muted); cursor:pointer; }
.bulk-bar .bulk-count { font-size:12px; color:var(--muted); }
.bulk-bar .spacer { flex:1; }
.bulk-bar .btn { height:30px; }
.check-cell { width:34px; text-align:center; }
.check-cell input, .lib-check, .knowledge-row input[type=checkbox] { width:15px; height:15px; accent-color:var(--primary); cursor:pointer; }
.lib-check { position:absolute; top:12px; right:12px; z-index:2; }
.lib-card { position:relative; }

/* v1.7 部门、部长与权限申请 */
.perm-check.locked { opacity:.55; cursor:not-allowed; background:#f8fafc; }
.perm-check.locked input { cursor:not-allowed; }
.perm-request-list { display:flex; flex-direction:column; gap:8px; }
.perm-request-row { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; border:1px solid var(--line); border-radius:12px; padding:10px 12px; background:#fff; }
.perm-request-row .strong { line-height:1.6; }

/* 客资接待按天/按月明细 */
.reception-controls { display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:var(--bg-soft); margin-bottom:12px; }
.rc-field { display:flex; align-items:center; gap:7px; }
.rc-field span { font-size:12px; color:var(--muted); white-space:nowrap; }
.rc-field .input { height:34px; width:145px; }
.rec-bar { height:6px; width:92px; background:#e8edf7; border-radius:999px; overflow:hidden; margin-top:5px; }
.rec-bar span { display:block; height:100%; border-radius:999px; background:var(--primary); }
.rec-stat-line { display:flex; align-items:center; gap:8px; margin-top:8px; }
.rec-stat-line .rec-bar { flex:1; width:auto; margin-top:0; }
.rec-stat-line b { white-space:nowrap; font-weight:600; }
.rec-grade { display:inline-flex; min-width:24px; justify-content:center; padding:2px 6px; border-radius:6px; font-size:11px; font-weight:700; }
.rec-grade.rec-a { color:#0b7285; background:#e6fcf5; }
.rec-grade.rec-b { color:#b45309; background:#fff4e6; }
.rec-grade.rec-c { color:#64748b; background:#f1f5f9; }
.reception-table tr.clickable { cursor:pointer; }
.reception-table tr.clickable:hover { background:#f8faff; }

.reception-table th, .reception-table td { padding:8px 7px; font-size:11.5px; }
.reception-table th { white-space:nowrap; }
.reception-table td:nth-child(11) { max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.reception-table .rec-bar { width:72px; }
