/* ==========================================================
   一成科技 · CRM 高级视觉体系 v2
   深色渐变侧边栏 + 毛玻璃 + 靛蓝紫渐变主色 + 精致微交互
   ========================================================== */

/* ==================== 阿里巴巴普惠体（免费可商用） ==================== */
@font-face {
    font-family: "Alibaba PuHuiTi";
    font-weight: 400;
    src: url("../fonts/Alibaba-PuHuiTi-Regular.otf") format("opentype");
    font-display: swap;
}
@font-face {
    font-family: "Alibaba PuHuiTi";
    font-weight: 500 600;
    src: url("../fonts/Alibaba-PuHuiTi-Medium.otf") format("opentype");
    font-display: swap;
}
@font-face {
    font-family: "Alibaba PuHuiTi";
    font-weight: 700 900;
    src: url("../fonts/Alibaba-PuHuiTi-Bold.otf") format("opentype");
    font-display: swap;
}

/* ==================== 基础重置与变量 ==================== */
:root {
    /* 主色系（靛蓝 → 紫 渐变） */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-deep: #4f46e5;
    --accent: #8b5cf6;
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-primary-soft: linear-gradient(135deg, rgba(99,102,241,.12), rgba(139,92,246,.08));

    /* 侧边栏（深色渐变） */
    --sidebar-bg-1: #141e33;
    --sidebar-bg-2: #0d1526;
    --sidebar-gradient: linear-gradient(180deg, #151f36 0%, #0c1424 100%);
    --sidebar-text: rgba(226,232,240,.62);
    --sidebar-text-hover: #ffffff;
    --sidebar-border: rgba(255,255,255,.07);

    /* 文本 */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    /* 边框与背景 */
    --border-color: #e6eaf2;
    --card-bg: #ffffff;
    --body-bg-1: #f5f7fc;
    --body-bg-2: #eef1f9;
    --body-gradient: linear-gradient(160deg, #f6f8fd 0%, #edf0f8 100%);
    --row-hover: #f5f6ff;

    /* 语义色 */
    --success: #10b981;
    --success-bg: #d1fae5;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --info: #3b82f6;
    --info-bg: #dbeafe;

    /* 阴影体系 */
    --shadow-xs: 0 1px 2px rgba(15,23,42,.05);
    --shadow-sm: 0 1px 3px rgba(15,23,42,.05), 0 4px 14px rgba(15,23,42,.05);
    --shadow: 0 2px 6px rgba(15,23,42,.05), 0 10px 28px rgba(15,23,42,.06);
    --shadow-lg: 0 8px 20px rgba(15,23,42,.08), 0 18px 48px rgba(15,23,42,.10);
    --shadow-glow: 0 4px 16px rgba(99,102,241,.35);

    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 8px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: "Alibaba PuHuiTi", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--body-gradient);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== 自定义滚动条 ==================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #c7d0dd;
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #94a3b8; border: 2px solid transparent; background-clip: content-box; }
* { scrollbar-width: thin; scrollbar-color: #c7d0dd transparent; }

/* ==================== 布局 ==================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ==================== 左侧导航栏（深色渐变） ==================== */
.sidebar {
    width: 240px;
    background: var(--sidebar-gradient);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(10,16,32,.10);
}

.sidebar-header {
    padding: 24px 20px 14px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    width: 160px;
    height: 80px;
    object-fit: contain;
    display: block;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .5px;
}

.company-name {
    padding: 0 20px 16px;
    font-size: 11.5px;
    color: rgba(148,163,184,.55);
    border-bottom: 1px solid var(--sidebar-border);
    margin-bottom: 10px;
    letter-spacing: .3px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 0;
}
.sidebar-nav ul { list-style: none; padding: 4px 12px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 11px;
    cursor: pointer;
    transition: all .22s ease;
    color: var(--sidebar-text);
    font-size: 14px;
    margin-bottom: 3px;
    position: relative;
    border: 1px solid transparent;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 15px;
    transition: transform .22s ease;
}

.nav-item:hover {
    background: rgba(255,255,255,.07);
    color: var(--sidebar-text-hover);
    transform: translateX(3px);
}
.nav-item:hover i { transform: scale(1.12); }

.nav-item.active {
    background: linear-gradient(90deg, rgba(99,102,241,.35) 0%, rgba(139,92,246,.18) 100%);
    color: #fff;
    font-weight: 600;
    border: 1px solid rgba(129,140,248,.25);
    box-shadow: 0 4px 14px rgba(99,102,241,.15);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -13px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 22px;
    background: var(--gradient-primary);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 12px rgba(99,102,241,.6);
}

/* ==================== 主内容区 ==================== */
.main-content {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

/* ==================== 顶部Header（毛玻璃） ==================== */
.top-header {
    background: rgba(255,255,255,.72);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-bottom: 1px solid rgba(226,232,240,.65);
    padding: 15px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: baseline;
    gap: 14px;
}

.page-title {
    font-size: 21px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    background: linear-gradient(120deg, #1e293b 20%, #4f46e5 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.header-view-scope {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #ffffff 0%, #f7f8ff 100%);
    padding: 5px 16px 5px 5px;
    border-radius: 30px;
    border: 1px solid rgba(226,232,240,.7);
    box-shadow: var(--shadow-xs);
    cursor: pointer;
    transition: all .2s ease;
}
.user-info:hover {
    box-shadow: var(--shadow-sm);
    border-color: rgba(99,102,241,.3);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(99,102,241,.35);
}

.user-name {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 600;
}

/* ==================== 页面容器 ==================== */
.page-container {
    padding: 24px 28px 32px;
    flex: 1;
}

.page { display: none; }
.page.active {
    display: block;
    animation: pageFadeIn .35s ease;
}
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.page-actions { display: flex; gap: 10px; }

/* ==================== 统计卡片 ==================== */
/* 看板工具条（数据概览 + 添加卡片） */
.stats-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.stats-toolbar-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.stats-toolbar-title i { color: #8b5cf6; }
.stats-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* ==================== 管理看板（资源分配 · 报备审批） ==================== */
.manage-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    align-items: start;
}
.manage-grid .data-section { height: 100%; display: flex; flex-direction: column; }
.manage-alloc, .manage-approve { min-width: 0; }

/* 分配 tab 切换 */
.mng-tabs {
    display: flex;
    gap: 8px;
    padding: 4px 20px;
    border-bottom: 1px solid var(--border-color);
}
.mng-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s ease;
}
.mng-tab-btn:hover { background: #f1f5f9; color: #334155; }
.mng-tab-btn.active {
    background: #f3efff;
    color: #7c3aed;
    border-color: #ddd6fe;
    font-weight: 600;
}
.mng-count {
    display: inline-block;
    min-width: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #eef2f7;
    color: #64748b;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
}
.mng-tab-btn.active .mng-count { background: #ddd6fe; color: #7c3aed; }

/* 分配工具栏 */
.mng-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 20px 4px;
}
.mng-search { width: 220px; }
.mng-select-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
}
.mng-select-all input { cursor: pointer; }

/* 分配/审批表格单元格 */
.mng-name { font-weight: 600; color: #334155; }
.mng-detail { color: #64748b; font-size: 13px; }
.mng-time { color: #94a3b8; font-size: 12px; white-space: nowrap; }
.mng-remark {
    color: #94a3b8; font-size: 12px;
    max-width: 180px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mng-remark .mng-link { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
/* 审批卡片：审核内容可点击查看 */
.mng-link { color: var(--primary); cursor: pointer; text-decoration: none; }
.mng-link:hover { text-decoration: underline; }
.mng-view-grid { display: flex; flex-direction: column; gap: 8px; }
.mng-view-row { display: grid; grid-template-columns: 84px 1fr; gap: 10px; font-size: 13px; line-height: 1.6; }
.mng-view-label { color: #94a3b8; text-align: right; white-space: nowrap; }
.mng-view-value { color: #334155; word-break: break-all; }
.mng-tag {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}
.mng-tag-purple { background: #f3efff; color: #7c3aed; }
.mng-tag-blue-light { background: #e8f4fd; color: #0ea5e9; }
.mng-tag-green { background: #e6f9f0; color: #10b981; }

/* 底部批量分配栏 */
.mng-apply-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}
.mng-selected { font-size: 13px; color: #64748b; }
.mng-selected b { color: #7c3aed; font-size: 15px; }
.mng-apply-right { display: flex; align-items: center; gap: 8px; }
.mng-user-select { min-width: 150px; }

/* 审批操作按钮 */
.mng-ops { white-space: nowrap; }
.mng-ops .btn-xs { margin-right: 4px; }

/* 无管理权限提示 */
.manage-locked {
    padding: 60px 20px;
    text-align: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}
.manage-locked i { font-size: 34px; color: #cbd5e1; margin-bottom: 12px; }
.manage-locked p { color: #64748b; font-size: 14px; margin: 4px 0; }
@media (max-width: 1200px) {
    .manage-grid { grid-template-columns: 1fr; }
    .mng-search { width: 140px; }
}
.trend-switch {
    display: flex;
    align-items: center;
    background: #eef2f7;
    border-radius: 9px;
    padding: 3px;
    gap: 2px;
}
.trend-switch .btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.trend-switch .btn:hover {
    transform: none;
}
.trend-switch .btn.active {
    background: #fff;
    color: #8b5cf6;
    box-shadow: 0 1px 3px rgba(15,23,42,.12);
}

/* 卡片内迷你趋势切换器 */
.stat-header .trend-switch {
    margin-left: auto;
    flex-shrink: 0;
}
/* 卡片头部切换器区：时间范围 + 分类切换器垂直排列，整体右对齐 */
.stat-header-switches {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}
.stat-header-switches .trend-switch {
    margin-left: 0;
}
.trend-switch-mini {
    padding: 2px;
    gap: 1px;
    border-radius: 7px;
}
.trend-switch-mini .btn {
    padding: 3px 5px;
    font-size: 10px;
    border-radius: 6px;
}
/* 跟进记录分类切换器（有效/无效/全部）：与时间范围切换同款，激活色与图表一致 */
.metric-switch-mini {
    margin: 0;
}
.metric-switch-mini .btn.active {
    color: #10b981;
}
/* 联系人卡片分类切换器激活色与图表蓝色一致 */
.metric-switch-blue .btn.active {
    color: #3b82f6;
}

/* 自定义卡片 */
.custom-card { position: relative; }
.card-del-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(148,163,184,.16);
    color: #64748b;
    font-size: 11px;
    cursor: pointer;
    display: grid;
    place-items: center;
    opacity: 0;
    transition: all .2s ease;
    z-index: 2;
}
.stat-card:hover .card-del-btn { opacity: 1; }
.card-del-btn:hover { background: #ef4444; color: #fff; }

/* 自定义卡片颜色选择器 */
.color-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 4px;
}
.color-swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: 0 2px 6px rgba(15,23,42,.15);
    transition: all .2s ease;
}
.color-swatch:hover { transform: scale(1.12); }
.color-swatch.active {
    border-color: #fff;
    box-shadow: 0 0 0 3px #334155, 0 2px 6px rgba(15,23,42,.25);
    transform: scale(1.12);
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px 20px 18px;
    box-shadow: var(--shadow-sm);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(226,232,240,.55);
}

/* 顶部渐变装饰条 */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: .85;
    transition: opacity .25s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(99,102,241,.25);
}

/* 可点击卡片：进入提示（除跟进记录、联系人外） */
.stat-card[data-action="goto-page"] { cursor: pointer; }
.stat-card[data-action="goto-page"]:not(.no-enter)::after {
    content: '进入 →';
    position: absolute;
    right: 14px;
    bottom: 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
    z-index: 1;
}
.stat-card[data-action="goto-page"]:not(.no-enter):hover::after {
    opacity: 1;
    transform: translateX(0);
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid !important;
    place-items: center;
    font-size: 17px;
    line-height: 1;
    color: #fff;
    box-shadow: 0 5px 14px rgba(15,23,42,.14);
    flex-shrink: 0;
}
.stat-icon::before {
    display: block;
    line-height: 1;
}
.stat-icon.blue { background: linear-gradient(135deg, #4f8df9, #6366f1); }
.stat-icon.orange { background: linear-gradient(135deg, #fbbf24, #f97316); }
.stat-icon.pink { background: linear-gradient(135deg, #f472b6, #ec4899); }
.stat-icon.red { background: linear-gradient(135deg, #fb7185, #ef4444); }
.stat-icon.blue-light { background: linear-gradient(135deg, #22d3ee, #3b82f6); }
.stat-icon.purple { background: linear-gradient(135deg, #a78bfa, #8b5cf6); }
.stat-icon.green { background: linear-gradient(135deg, #34d399, #10b981); }

.stat-label {
    font-size: 12.5px;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: .2px;
    white-space: nowrap;
    flex-shrink: 0;
}

.stat-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}
.stat-trend.up { background: var(--success-bg); color: #047857; }

.stat-badge {
    display: inline-block;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
}
.stat-badge.warning { background: var(--warning-bg); color: #b45309; }
.stat-badge.danger { background: var(--danger-bg); color: #b91c1c; }
.stat-badge.info { background: var(--info-bg); color: #1d4ed8; }

/* ==================== 统计卡片迷你曲线图 ==================== */
.stat-card-chart { padding-bottom: 16px; }

.stat-sub {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.stat-sub-item {
    font-size: 12px;
    color: var(--text-secondary);
    background: #f1f5f9;
    border-radius: 8px;
    padding: 4px 10px;
    font-weight: 500;
}
.stat-sub-item b {
    color: var(--text-primary);
    font-size: 14px;
    margin-right: 2px;
    font-variant-numeric: tabular-nums;
}

.stat-value-row {
    display: flex;
    gap: 26px;
    margin-bottom: 8px;
}
.stat-value-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.stat-mini-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: .5px;
}
.stat-value.sm {
    font-size: 26px;
    margin-bottom: 0;
}

.mini-legend {
    display: flex;
    gap: 12px;
    margin-bottom: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}
.mini-legend .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: 0;
}
.dot.eff { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
.dot.inv { background: #94a3b8; box-shadow: 0 0 0 3px rgba(148,163,184,.12); }

/* ============ 通用柱状图（带横纵坐标） ============ */
.bar-chart {
    display: grid;
    grid-template-columns: 28px 1fr;
    grid-template-rows: 84px 15px;
    margin-top: 10px;
    animation: fadeUp .5s ease both;
}
/* 金额刻度更宽 */
.bar-chart.money {
    grid-template-columns: 40px 1fr;
}
.bar-yaxis {
    position: relative;
    border-right: 1px solid rgba(148,163,184,.25);
}
.bar-yaxis span {
    position: absolute;
    right: 3px;
    transform: translateY(-50%);
    font-size: 9px;
    color: #94a3b8;
    font-weight: 500;
}
.bar-yaxis span:first-child { transform: translateY(-20%); }
.bar-yaxis span:last-child { transform: translateY(-80%); }
.bar-plot {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    padding: 0 2px;
}
.bar-gridlines {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    pointer-events: none;
}
.bar-gridlines i {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 1px dashed rgba(148,163,184,.3);
}
.bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    transition: opacity .15s ease;
}
.bar-col[data-action] { cursor: pointer; }
.bar-col[data-action]:hover { opacity: .82; }
.bar-val {
    font-size: 9px;
    line-height: 1;
    margin-bottom: 2px;
    color: #475569;
    font-weight: 600;
}
.bar-stack {
    width: 66%;
    max-width: 20px;
    height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border-radius: 3px 3px 0 0;
    overflow: hidden;
}
.bar-seg { width: 100%; }
.bar-xaxis {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    padding: 0 2px;
}
.bar-xaxis span {
    flex: 1;
    text-align: center;
    font-size: 9px;
    color: #94a3b8;
    line-height: 15px;
    white-space: nowrap;
    overflow: hidden;
}

/* ============ 通用折线图（带横纵坐标） ============ */
.line-chart {
    display: grid;
    grid-template-columns: 28px 1fr;
    grid-template-rows: 84px 15px;
    margin-top: 10px;
    animation: fadeUp .5s ease both;
}
/* 金额刻度更宽 */
.line-chart.money {
    grid-template-columns: 40px 1fr;
}
.line-yaxis {
    position: relative;
    border-right: 1px solid rgba(148,163,184,.25);
}
.line-yaxis span {
    position: absolute;
    right: 3px;
    transform: translateY(-50%);
    font-size: 9px;
    color: #94a3b8;
    font-weight: 500;
}
.line-yaxis span:first-child { transform: translateY(-20%); }
.line-yaxis span:last-child { transform: translateY(-80%); }
.line-plot {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    padding: 0 2px;
}
.line-svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}
.line-grid {
    stroke: rgba(148,163,184,.28);
    stroke-width: 1;
    stroke-dasharray: 2 4;
    shape-rendering: crispEdges;
}
.line-line {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}
.line-area {
    stroke: none;
}
.line-xaxis {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    padding: 0 2px;
}
.line-xaxis span {
    flex: 1;
    text-align: center;
    font-size: 9px;
    color: #94a3b8;
    line-height: 15px;
    white-space: nowrap;
    overflow: hidden;
}

/* 跟进记录某天明细弹窗 */
.follow-day-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 46vh;
    overflow-y: auto;
    padding-right: 2px;
}
.follow-day-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
}
.follow-day-head {
    display: flex;
    align-items: center;
    gap: 8px;
}
.follow-day-cust {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}
.follow-day-tag {
    font-size: 10px;
    padding: 1px 7px;
    border-radius: 99px;
    font-weight: 600;
    flex-shrink: 0;
}
.follow-day-tag.ok { background: rgba(16,185,129,.12); color: #10b981; }
.follow-day-tag.no { background: rgba(148,163,184,.15); color: #64748b; }
.follow-day-meta {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.follow-day-content {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    word-break: break-all;
    white-space: pre-wrap;
}
.follow-day-line {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    word-break: break-all;
}
.follow-day-line.muted {
    color: var(--text-muted);
}
.follow-day-foot {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--border);
    font-size: 11px;
    color: var(--text-muted);
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== 数据区块 ==================== */
.data-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(226,232,240,.55);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.1px;
}

/* 标题左侧装饰竖条 */
.section-title::before {
    content: '';
    width: 4px;
    height: 16px;
    border-radius: 4px;
    background: var(--gradient-primary);
}

.section-title i {
    color: var(--primary);
    font-size: 14px;
}

.view-all {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    transition: color .2s;
}
.view-all:hover { color: var(--primary-deep); text-decoration: none; }

/* ==================== 表格 ==================== */
.table-container {
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-sm);
    /* 内置横向滚动条（列数过多时出现） */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.table-container::-webkit-scrollbar { height: 8px; }
.table-container::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.table-container::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.table-container::-webkit-scrollbar-track { background: transparent; }

/* 权限管理综合权限表：列较多，容器内横向滚动 */
.perm-table {
    min-width: 1380px;
}

/* 列数较多的列表：单元格不换行，由容器提供左右滑动条 */
.data-table tbody td {
    white-space: nowrap;
}
/* 各列表最小宽度兜底：列多时始终出现横向滚动条 */
.sea-table { min-width: 1500px; }
.opp-table { min-width: 1480px; }
.order-table { min-width: 1320px; }
.proj-table { min-width: 1260px; }
.fu-table { min-width: 1320px; }
.fin-table { min-width: 1280px; }
.audit-table { min-width: 1120px; }
/* 与报备表格完全一致：单元格不换行，由容器提供左右滑动条 */
.sea-table th, .sea-table td,
.opp-table th, .opp-table td,
.order-table th, .order-table td,
.proj-table th, .proj-table td,
.fu-table th, .fu-table td,
.fin-table th, .fin-table td,
.audit-table th, .audit-table td { white-space: nowrap; }

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

/* 列表列宽拖拽调整 */
body.crm-col-resizing,
body.crm-col-resizing .data-table {
    user-select: none;
    -webkit-user-select: none;
    cursor: col-resize;
}
.data-table thead th {
    cursor: default;
}
.data-table thead th:last-child {
    cursor: default !important;
}
.data-table thead th.crm-col-hover {
    cursor: col-resize;
    box-shadow: inset -3px 0 0 rgba(24, 144, 255, 0.55);
}
.data-table thead th.crm-col-hover:last-child {
    cursor: default !important;
    box-shadow: none;
}

.data-table thead th {
    text-align: left;
    padding: 13px 16px;
    color: #64748b;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .4px;
    text-transform: uppercase;
    background: #f6f8fc;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    position: sticky;
    top: 0;
}
.data-table thead th:first-child { border-radius: 10px 0 0 10px; }
.data-table thead th:last-child { border-radius: 0 10px 10px 0; }

/* 操作列固定在最右侧：横向滚动时操作按钮始终可见、不移动 */
.data-table th.action-cell,
.data-table td.action-cell {
    position: sticky;
    right: 0;
}
.data-table thead th.action-cell {
    background: #f6f8fc;
    z-index: 2;
}
.data-table tbody td.action-cell {
    background: var(--card-bg);
    z-index: 1;
    box-shadow: -6px 0 10px -6px rgba(15, 23, 42, .12);
}
.data-table tbody tr:hover td.action-cell {
    background: var(--row-hover);
}

/* 我的客户表格：基本信息全字段展示，与公海客户列间距保持一致 */
.cust-table { min-width: 1500px; }
.cust-table th,
.cust-table td { white-space: nowrap; }
.cust-table .mono-cell {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-variant-numeric: tabular-nums;
    color: #475569;
}
.cust-table .num-cell {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-variant-numeric: tabular-nums;
}
.cust-table .cust-text-cell {
    display: inline-block;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}
.cust-table .text-cell {
    display: inline-block;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

/* 我的报备表格：列较多，强制横向滚动 */
.reg-table { min-width: 1200px; }
.reg-table th,
.reg-table td { white-space: nowrap; }
.reg-table td.name-cell { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.reg-table .mono-cell {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-variant-numeric: tabular-nums;
    color: #475569;
}
.reg-table .text-cell { display: inline-block; max-width: 120px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.reg-table .action-cell { width: 120px; white-space: nowrap; }

.data-table tbody tr {
    border-bottom: 1px solid #f1f4f9;
    transition: background .15s ease, transform .15s ease;
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--row-hover); }
/* 整行可点击（公海客户表格） */
.data-table tbody tr.row-click { cursor: pointer; }
/* 公海客户"已领取"徽标 */
.claimed-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #d97706;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 999px;
    vertical-align: middle;
}
.claimed-tip {
    font-size: 12px;
    color: #94a3b8;
    margin-right: 8px;
}
.abandoned-tip {
    font-size: 12px;
    color: #dc2626;
    margin-right: 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 999px;
    padding: 1px 8px;
    font-weight: 500;
}

.pending-tip {
    font-size: 12px;
    color: #d97706;
    margin-right: 8px;
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 999px;
    padding: 1px 8px;
    font-weight: 500;
}

.data-table tbody td {
    padding: 14px 16px;
    color: var(--text-primary);
    vertical-align: middle;
    border-bottom: 1px solid #f1f4f9;
}
.data-table tbody tr:last-child td { border-bottom: none; }

.name-cell {
    font-weight: 600;
    color: var(--text-primary);
}

/* 标签 */
.tag {
    display: inline-block;
    background: #f1f5f9;
    color: var(--text-secondary);
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* 状态徽章 */
.status-badge {
    display: inline-block;
    padding: 4px 13px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .2px;
}
.status-badge.pending { background: var(--warning-bg); color: #b45309; }
.status-badge.assigned { background: var(--info-bg); color: #1d4ed8; }
.status-badge.abandoned { background: #f3f4f6; color: var(--text-muted); }
.status-badge.success { background: var(--success-bg); color: #047857; }
.status-badge.info { background: var(--info-bg); color: #1d4ed8; }
.status-badge.warning { background: var(--warning-bg); color: #b45309; }
.status-badge.danger { background: var(--danger-bg); color: #b91c1c; }
.status-badge.muted { background: #f3f4f6; color: #64748b; }
.status-badge.blue { background: #dbeafe; color: #2563eb; }
.status-badge.purple { background: #ede9fe; color: #7c3aed; }
.status-badge.orange { background: #ffedd5; color: #c2410c; }

/* 意向标签 */
.intention {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.intention.high { background: var(--danger-bg); color: #b91c1c; }
.intention.medium { background: var(--warning-bg); color: #b45309; }
.intention.low { background: #f3f4f6; color: var(--text-muted); }

/* 阶段标签 */
.stage {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    background: var(--gradient-primary-soft);
    color: var(--primary-deep);
    font-weight: 600;
}

/* 操作按钮 */
.action-cell {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: flex-end;
}
.data-table thead th.action-cell {
    padding-right: 0;
    text-align: right;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    font-weight: 500;
    transition: color .2s;
}
.btn-text:hover { color: var(--primary); }
.btn-text.primary { color: var(--primary); font-weight: 600; }
.btn-text.warning { color: #d97706; }
.btn-text.warning:hover { color: #b45309; }
.btn-text.danger { color: var(--danger); }
.btn-text.danger:hover { color: #b91c1c; }

/* 多选下拉 */
.multi-select { position: relative; }
.multi-select-trigger { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; font-size: 13px; color: var(--text-primary); cursor: pointer; }
.multi-select-trigger .placeholder { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-select-dropdown { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.1); max-height: 240px; overflow-y: auto; z-index: 20; padding: 6px 0; }
.multi-select.open .multi-select-dropdown { display: block; }
.multi-option { display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 13px; cursor: pointer; transition: background .15s; }
.multi-option:hover { background: #f1f5f9; }
.multi-option input { margin: 0; }
/* 筛选面板中的多选下拉：窄容器下保证下拉有足够宽度展示选项 */
.filter-panel .filter-multi-select .multi-select-dropdown,
.reg-filter-panel .filter-multi-select .multi-select-dropdown,
.public-filter-grid .filter-multi-select .multi-select-dropdown {
    min-width: 200px;
}
/* 项目成员标签 */
.member-tag { display: inline-block; padding: 2px 8px; margin: 1px 4px 1px 0; background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; border-radius: 4px; font-size: 12px; line-height: 18px; white-space: nowrap; }

/* 报备状态：未报备（红）/ 报备中（黄）/ 已报备（绿） */
.btn-text.report-none { color: #dc2626; font-weight: 600; }
.btn-text.report-none:hover { color: #b91c1c; }
.report-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: default; }
.report-tag i { font-size: 12px; }
.report-pending { color: #d97706; }
.report-success { color: #16a34a; }
.report-none-tag { color: #dc2626; }

/* ==================== 按钮 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .22s ease;
    letter-spacing: .2px;
    box-shadow: var(--shadow-xs);
}
.btn:active { transform: scale(.97); }

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 14px rgba(99,102,241,.35);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #5254f0 0%, #7c4ef0 100%);
    box-shadow: 0 6px 20px rgba(99,102,241,.45);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #fff;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: none;
}
.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-danger { background: linear-gradient(135deg, #f87171, #ef4444); color: #fff; box-shadow: 0 4px 14px rgba(239,68,68,.3); }
.btn-danger:hover { background: linear-gradient(135deg, #f06060, #dc2626); box-shadow: 0 6px 20px rgba(239,68,68,.4); }
.btn-success { background: linear-gradient(135deg, #34d399, #10b981); color: #fff; box-shadow: 0 4px 14px rgba(16,185,129,.3); }
.btn-success:hover { background: linear-gradient(135deg, #2ec98d, #059669); }
.btn-sm { padding: 7px 13px; font-size: 12px; border-radius: 9px; }

/* ==================== 筛选栏 ==================== */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    align-items: center;
    flex-wrap: wrap;
    /* 与公海客户筛选面板颜色一致 */
    background: #fff;
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(226,232,240,.55);
}

.search-input {
    padding: 9px 14px;
    border: 1px solid var(--border-color);
    border-radius: 11px;
    font-size: 13px;
    width: 240px;
    outline: none;
    background: #fff;
    transition: all .2s ease;
    box-shadow: var(--shadow-xs);
}
.search-input::placeholder { color: #a8b3c4; }
.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99,102,241,.12);
}

.filter-select {
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 11px;
    font-size: 13px;
    background: #fff;
    outline: none;
    cursor: pointer;
    color: var(--text-primary);
    transition: all .2s ease;
    box-shadow: var(--shadow-xs);
}
.filter-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99,102,241,.12);
}

/* ==================== 公海筛选面板 ==================== */
.filter-panel {
    background: #fff;
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(226,232,240,.55);
    margin-bottom: 18px;
}

.filter-row {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.filter-row + .filter-row {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #e2e8f0;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 120px;
    flex: 1;
}
.filter-item label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.filter-item .search-input,
.filter-item .filter-select {
    width: 100%;
    min-width: 120px;
}
.filter-item-wide {
    flex: 2;
    min-width: 280px;
}

.filter-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.filter-pills .pill {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all .15s;
    font-weight: 500;
}
.filter-pills .pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.filter-pills .pill.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(99,102,241,.25);
}

/* ==================== 数据区块头部 ==================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}
.section-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-actions .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: var(--primary);
    cursor: pointer;
    transition: all .15s ease;
    font-size: 13px;
}
.section-actions .btn-icon:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
}
.toolbar-divider {
    width: 1px;
    height: 18px;
    background: #e2e8f0;
    margin: 0 4px;
}

/* ==================== 用户选择器（销售筛选） ==================== */
.user-select {
    position: relative;
    display: inline-block;
    width: 100%;
}
.user-select-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all .2s;
}
.user-select-trigger:hover {
    border-color: #cbd5e1;
}
.user-select-trigger .user-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}
.user-select-trigger .user-name {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-select-trigger .fa-chevron-down {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
}
.user-select-placeholder {
    color: var(--text-muted);
    flex: 1;
    text-align: left;
}
.user-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15,23,42,.12);
    z-index: 100;
    display: none;
    overflow: hidden;
    padding: 4px;
}
.user-select.open .user-select-dropdown {
    display: block;
}
/* 表格「列」自定义下拉面板 */
.col-dropdown-wrap {
    position: relative;
    display: inline-block;
}
.col-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 210px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15,23,42,.12);
    z-index: 100;
    display: none;
    padding: 8px;
    max-height: 340px;
    overflow-y: auto;
}
.col-dropdown-wrap.open .col-dropdown {
    display: block;
}

/* ============ 分页条 ============ */
.pager-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 0;
    border-top: 1px solid #1e293b;
    margin-top: 4px;
}
.pager-info {
    color: #94a3b8;
    font-size: 12px;
    margin-right: 8px;
}
.pager-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #334155;
    border-radius: 6px;
    background: #0f172a;
    color: #cbd5e1;
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
}
.pager-btn:hover:not(:disabled) {
    background: #1e293b;
    border-color: #475569;
}
.pager-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
    font-weight: 600;
}
.pager-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}
.pager-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 32px;
    color: #94a3b8;
    font-size: 14px;
    user-select: none;
}
/* 公海客户「按列筛选」下拉面板：两列网格、内部滚动 */
.col-dropdown.filter-dropdown {
    width: 460px;
    max-height: 480px;
    padding: 12px;
}
.public-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 4px;
}
.public-filter-grid .filter-item,
.public-filter-grid .public-filter-item {
    min-width: 0;
}
.public-filter-grid .public-filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.public-filter-grid .public-filter-item label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.public-filter-grid .public-filter-item select {
    width: 100%;
    min-width: 0;
}
.col-dropdown-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px solid #f1f5f9;
}
.col-dropdown-header {
    padding: 4px 6px 8px;
    font-size: 12px;
    color: #94a3b8;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 6px;
}
.col-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #334155;
    transition: background .15s;
}
.col-opt:hover {
    background: #f1f5f9;
}
.col-opt input {
    accent-color: #3b82f6;
}
/* "选择销售"按钮（我的客户标题后，仅销售总监可见） */
.sales-picker-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 12px;
    padding: 4px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    vertical-align: middle;
    transition: all .2s;
}
.sales-picker-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.sales-picker-btn i { font-size: 12px; }
/* 工具栏按钮上的状态角标（分组/排序/列） */
.active-mark {
    color: var(--primary);
    font-size: 11px;
    margin-left: 2px;
}
/* 分组表头行 */
.data-table tbody tr.group-row td {
    background: #f8fafc;
    border-bottom: 1px solid #eef2f7;
    padding: 8px 14px;
    font-size: 12px;
}
.group-label {
    font-weight: 600;
    color: #334155;
}
.group-count {
    margin-left: 8px;
    color: #94a3b8;
    font-size: 11px;
}
.text-muted {
    color: #94a3b8;
    font-size: 12px;
}
.user-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: background .15s;
}
.user-option:hover {
    background: #f1f5f9;
}
.user-option .user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}
.user-option .user-name {
    color: var(--text-primary);
}

/* 红点通知 */
.badge-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #3b82f6;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    margin-left: 4px;
}

/* ==================== 设置页面 ==================== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
}
.settings-tip {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--gradient-primary-soft);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}
.settings-tip i {
    font-size: 15px;
}

.settings-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(226,232,240,.55);
    transition: box-shadow .25s ease;
}
.settings-card:hover { box-shadow: var(--shadow); }

.settings-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}
.settings-card h3 i {
    color: var(--primary);
    width: 30px; height: 30px;
    background: var(--gradient-primary-soft);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
}

/* ==================== 表单组件 ==================== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .span-2 { grid-column: span 2; }

/* 省市区级联下拉 */
.region-cascade-row { display: flex; gap: 10px; }
.region-cascade-item { flex: 1; min-width: 0; }

.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 7px;
    font-weight: 500;
}
.form-group label.required::before { content: '*'; color: #dc2626; margin-right: 3px; }

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--border-color);
    border-radius: 11px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s;
    box-sizing: border-box;
    box-shadow: var(--shadow-xs);
}
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover { border-color: #cbd5e1; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99,102,241,.12);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group select { cursor: pointer; }

.form-group.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-group.checkbox label { margin-bottom: 0; cursor: pointer; }
.form-group.checkbox input {
    width: 17px; height: 17px;
    accent-color: var(--primary);
    cursor: pointer;
}

.readonly-text {
    padding: 10px 13px;
    background: #f6f8fc;
    border: 1px dashed var(--border-color);
    border-radius: 11px;
    font-size: 13px;
    color: var(--text-primary);
}
.readonly-input { background: #f8fafc !important; color: var(--text-muted) !important; }

.form-section-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 13px;
    border-bottom: 1px solid #f1f4f9;
    padding-bottom: 8px;
    margin-bottom: 4px !important;
}

.import-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: var(--gradient-primary-soft);
    color: var(--primary-deep);
    padding: 11px 15px;
    border-radius: 11px;
    font-size: 12px;
    margin-bottom: 14px;
    line-height: 1.7;
    border: 1px solid rgba(99,102,241,.15);
}
.import-tip i { margin-top: 2px; }

/* ==================== 占位内容 ==================== */
.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-muted);
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px dashed var(--border-color);
}
.placeholder-content i {
    font-size: 52px;
    margin-bottom: 18px;
    color: #cbd5e1;
}
.placeholder-content p { font-size: 15px; color: var(--text-secondary); }

/* ==================== 表格链接 / 杂项 ==================== */
.cell-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sale-follower {
    color: var(--primary);
    font-weight: 500;
}
.public-check-all,
.public-check,
.opp-check-all,
.opp-check,
.proj-check-all,
.proj-check,
.order-check-all,
.order-check,
.my-check-all,
.my-check {
    width: 15px;
    height: 15px;
    cursor: pointer;
    vertical-align: middle;
}
.check-cell {
    text-align: center;
}
.link-cell {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color .15s;
}
.link-cell:hover { text-decoration: underline; color: var(--primary-deep); }
.mono-cell { font-family: "SF Mono", Consolas, monospace; font-size: 12px; color: var(--text-secondary); }
.filter-count { font-size: 13px; color: var(--text-muted); margin-left: auto; }

/* ==================== 客户表格跟进记录列 ==================== */
.follow-cell-inner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 220px;
    cursor: default;
}
.follow-brief {
    display: inline-block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: var(--text-secondary);
}
.follow-count {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 11px;
    white-space: nowrap;
}

/* ==================== 逾期 / 紧急 ==================== */
.overdue-tag {
    display: inline-block;
    background: var(--danger-bg);
    color: #b91c1c;
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 10px;
    font-weight: 600;
}
.urgent-text { color: #dc2626; font-weight: 700; }
.normal-text { color: var(--text-secondary); }

/* ==================== 通信类型徽章 ==================== */
.comm-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.comm-badge.phone { background: var(--info-bg); color: #1d4ed8; }
.comm-badge.visit { background: #ede9fe; color: #7c3aed; }
.comm-badge.wechat { background: #d1fae5; color: #047857; }
.comm-badge.email { background: #fef3c7; color: #b45309; }
.comm-badge.system { background: #f3f4f6; color: #64748b; }
.comm-badge.muted { background: #f3f4f6; color: #64748b; }

/* ==================== 工作看板网格 ==================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, 340px);
    gap: 22px;
    align-items: stretch;
}
.dashboard-grid > * { min-width: 0; }
/* 图表卡片：图表填满剩余高度，减少下部空白 */
.dashboard-grid .stat-card-chart {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.dashboard-grid .stat-card-chart .bar-chart,
.dashboard-grid .stat-card-chart .line-chart {
    flex: 1;
    min-height: 96px;
    grid-template-rows: minmax(72px, 1fr) 15px;
}
/* 6 框网格中的图表卡片：与 data-section 视觉统一 */
.dashboard-grid .grid-chart {
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(226,232,240,.55);
    height: 100%;
}
/* data-section 在 grid 中拉伸 */
.dashboard-grid > .data-section {
    height: 100%;
    display: flex;
    flex-direction: column;
}
/* 网格内列表区域填满卡片剩余高度，保证三卡一致 */
.dashboard-grid > .data-section .todo-list.scroll-3 {
    height: auto;
    flex: 1;
    min-height: 0;
}
.dashboard-grid > .data-section .announcement-list {
    height: auto;
    flex: 1;
    min-height: 0;
    max-height: none;
}
/* 中下：第一张数据卡片（与跟进记录/联系人同样大小，完全占据） */
/* 无卡片时显示空态占位 */
.data-cards-section { position: relative; }
.data-cards-section .cards-empty {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #94a3b8;
    padding: 20px 16px;
    text-align: center;
}
.data-cards-section .cards-empty i { font-size: 30px; color: #cbd5e1; }
.data-cards-section .cards-empty p { font-size: 14px; font-weight: 600; color: #64748b; margin: 0; }
.data-cards-section .cards-empty span { font-size: 12px; line-height: 1.7; color: #94a3b8; max-width: 340px; }

/* ==================== 我的数据（左下：客户 / 商机 / 项目 / 订单 / 业绩） ==================== */
.my-data-section .my-data-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.my-data-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: #f8fafc;
    border: 1px solid rgba(226,232,240,.6);
    border-radius: 12px;
    padding: 12px 6px;
    cursor: pointer;
    transition: box-shadow .2s, transform .2s, border-color .2s;
}
.my-data-cell:hover { box-shadow: 0 4px 12px rgba(15,23,42,.06); transform: translateY(-1px); border-color: rgba(14,165,233,.4); }
.my-data-ico { font-size: 15px; }
.my-data-ico.blue { color: #2563eb; }
.my-data-ico.violet { color: #8b5cf6; }
.my-data-ico.green { color: #16a34a; }
.my-data-ico.amber { color: #d97706; }
.my-data-ico.orange { color: #f97316; }
.my-data-cell b { font-size: 22px; font-weight: 700; color: #0f172a; line-height: 1.2; }
.my-data-cell span { font-size: 11px; color: #64748b; }
.my-data-perf {
    margin-top: 8px;
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 55%, #ffffff 100%);
    border: 1px solid rgba(251,146,60,.22);
    border-radius: 14px;
    padding: 8px 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform .25s, box-shadow .25s;
    box-shadow: 0 2px 8px rgba(249,115,22,.08);
    display: flex;
    align-items: center;
}
.my-data-perf::before {
    content: '';
    position: absolute;
    right: -20px;
    top: -20px;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(251,146,60,.16) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.my-data-perf:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(249,115,22,.14);
}
.my-data-perf-main { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.my-data-perf-icon-wrap {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 17px;
    box-shadow: 0 4px 10px rgba(249,115,22,.28);
}
.my-data-perf-info { flex: 1; min-width: 0; }
.my-data-perf-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #7c2d12; }
.my-data-perf-label .perf-badge {
    font-size: 9px;
    font-weight: 700;
    color: #c2410c;
    background: rgba(251,146,60,.18);
    padding: 1px 6px;
    border-radius: 999px;
}
/* 业绩年份切换 */
.perf-year-switch { display: inline-flex; align-items: center; gap: 2px; cursor: default; padding: 1px 4px; }
.perf-year-switch i {
    cursor: pointer;
    font-size: 8px;
    padding: 2px 3px;
    border-radius: 4px;
    transition: background .15s;
    color: #c2410c;
}
.perf-year-switch i:hover { background: rgba(194,65,12,.2); }
.perf-year-switch i:active { transform: scale(.9); }
.my-data-perf-num {
    font-size: 22px;
    font-weight: 800;
    color: #9a3412;
    margin-top: 1px;
    line-height: 1.2;
    letter-spacing: -0.3px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.my-data-perf-sub { font-size: 10px; color: #c2410c; opacity: .85; margin-top: 1px; }
.my-data-perf-arrow {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,.72);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ea580c;
    font-size: 10px;
    transition: transform .2s;
}
.my-data-perf:hover .my-data-perf-arrow { transform: translateX(3px); }
/* 中下第一张卡片使用 .grid-chart（由 dashboard-grid 作用域提供 border/shadow/height:100%） */

/* 第三行：扩展数据卡片（第 2 张起，与跟进记录/联系人同样大小，3 列网格） */
.dashboard-extra-cards {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}
.dashboard-extra-cards .custom-card {
    display: flex;
    flex-direction: column;
    height: 340px;
    margin: 0;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(226,232,240,.55);
}
.dashboard-extra-cards .custom-card .bar-chart,
.dashboard-extra-cards .custom-card .line-chart {
    flex: 1;
    min-height: 96px;
    grid-template-rows: minmax(72px, 1fr) 15px;
}

/* 报备审批（外部大卡片：报备审批 + 市场总监报备 左右并排，仅销售经理 / 管理员可见） */
.dashboard-approve-section { margin-top: 22px; }
.dashboard-approve-container .manage-approve {
    box-shadow: none;
    border: 1px solid rgba(226,232,240,.55);
}

/* 工作看板两个审批卡片：固定高度，表格区域内置上下滚动，表头吸顶 */
.dashboard-approve-container .manage-approve-grid {
    align-items: stretch;
}
.dashboard-approve-container .manage-approve {
    height: 430px;
    max-height: 70vh;
}
.dashboard-approve-container .manage-approve .table-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
}
.dashboard-approve-container .manage-approve .data-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f1f5f9;
}
.dashboard-approve-container .manage-approve .data-table .mng-ops .btn {
    white-space: nowrap;
}

/* 到期提醒：7-15天红 / 15-30天绿 */
.todo-item.reg-red {
    border-left: 3px solid #ef4444;
    background: rgba(239,68,68,.045);
}
.todo-item.reg-green {
    border-left: 3px solid #22c55e;
    background: rgba(34,197,94,.045);
}
.todo-icon.expiring.red { color: #ef4444; background: rgba(239,68,68,.12); }
.todo-icon.expiring.green { color: #16a34a; background: rgba(34,197,94,.12); }
.reg-days.red { color: #ef4444; font-weight: 600; }
.reg-days.green { color: #16a34a; font-weight: 600; }

/* ==================== 公司公告栏（工作看板右上角） ==================== */
.announcement-section {
    background: linear-gradient(180deg, #fff7f7 0%, #fff 40%) !important;
    border: 1px solid #fecaca !important;
}
.announcement-section .section-header {
    border-bottom: 1px dashed #fecaca;
}
.announcement-list {
    max-height: 260px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 0;
}
.announcement-list::-webkit-scrollbar {
    width: 5px;
}
.announcement-list::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 3px;
}
.ann-item {
    padding: 10px 12px;
    border: 1px solid #fee2e2;
    border-radius: 10px;
    background: #fff;
    transition: box-shadow .2s, border-color .2s;
}
.ann-item:hover {
    border-color: #fca5a5;
    box-shadow: 0 2px 8px rgba(239,68,68,.08);
}
.ann-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-weight: 700;
    font-size: 13.5px;
    color: #1e293b;
}
.ann-title::before {
    content: '📢';
    font-size: 13px;
    margin-right: 2px;
}
.ann-actions {
    display: inline-flex;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}
.ann-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}
.ann-btn:hover {
    color: #8b5cf6;
    border-color: #c4b5fd;
    background: #f5f3ff;
}
.ann-btn.danger:hover {
    color: #ef4444;
    border-color: #fecaca;
    background: #fef2f2;
}
.ann-content {
    margin-top: 6px;
    font-size: 12.5px;
    line-height: 1.7;
    color: #475569;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}
.ann-content.full {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    white-space: pre-wrap;
}
.ann-meta {
    margin-top: 6px;
    font-size: 11.5px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 5px;
}
/* 公告弹窗（查看全部） */
.ann-list-modal {
    max-height: 55vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ann-modal-item {
    padding: 14px 16px;
    border: 1px solid #fee2e2;
    border-radius: 12px;
    background: #fffaf5;
}
.ann-modal-item .ann-title {
    font-size: 14.5px;
}
.ann-modal-item .ann-content {
    margin-top: 8px;
    font-size: 13px;
    color: #334155;
}
.section-count {
    background: var(--gradient-primary-soft);
    color: var(--primary-deep);
    font-size: 12px;
    padding: 3px 12px;
    border-radius: 20px;
    font-weight: 700;
}

/* ==================== 待办列表 ==================== */
/* 待办手动添加行 */
.todo-add-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    flex-shrink: 0;
}
.todo-add-input {
    flex: 1;
    min-width: 0;
    height: 28px;
    padding: 0 9px;
    font-size: 11px;
    color: var(--text);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.todo-add-input:focus { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.12); }
.todo-add-input::placeholder { color: #9ca3af; }
.todo-add-btn { flex: none; height: 28px; }
.todo-list { display: flex; flex-direction: column; gap: 4px; }
.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px;
    border-radius: 12px;
    transition: all .2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    flex-shrink: 0; /* 禁止压缩，保证内容超出时触发滚动 */
    overflow: hidden; /* 禁止水平溢出 */
}
.todo-item:hover {
    background: var(--row-hover);
    border-color: rgba(99,102,241,.14);
    transform: translateX(3px);
}
/* 待办勾选框：点击标记完成，已完成项沉底置灰 */
.todo-check {
    flex-shrink: 0;
    width: 18px; height: 18px;
    margin-left: 2px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: transparent;
    font-size: 9px;
    line-height: 1;
    transition: all .2s;
}
.todo-check:hover { border-color: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.14); }
.todo-item.done .todo-check {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}
.todo-item.done .todo-title { color: #94a3b8; text-decoration: line-through; }
.todo-item.done .todo-icon { filter: grayscale(1) opacity(.55); box-shadow: none; }
.todo-item.done .todo-meta, .todo-item.done .todo-meta span { color: #cbd5e1; }
.todo-item.done .btn-text { opacity: .5; pointer-events: none; }
.todo-item.done { background: rgba(148,163,184,.07); }
.todo-item.done:hover { transform: none; }
/* 已完成分隔提示：未完成在前，已完成沉底 */
.todo-done-divider {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 2px 2px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #10b981;
    background: rgba(16,185,129,.08);
    border-radius: 8px;
    flex-shrink: 0;
}
/* 工作标签：来自工作日报计划的待办 */
.todo-tag {
    display: inline-block;
    margin-right: 6px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    color: #7c3aed;
    background: rgba(124,58,237,.1);
    border: 1px solid rgba(124,58,237,.25);
    border-radius: 20px;
    vertical-align: 1px;
    flex-shrink: 0;
}
.todo-item.done .todo-tag {
    color: #a78bfa;
    background: rgba(124,58,237,.05);
    border-color: rgba(124,58,237,.15);
}
.todo-icon {
    width: 38px; height: 38px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(15,23,42,.08);
}
.todo-icon.overdue { background: linear-gradient(135deg, #fda4af, #ef4444); color: #fff; }
.todo-icon.expiring { background: linear-gradient(135deg, #fcd34d, #f59e0b); color: #fff; }
.todo-icon.followup { background: linear-gradient(135deg, #fcd34d, #f59e0b); color: #fff; }
.todo-icon.reg-expiring { background: linear-gradient(135deg, #93c5fd, #3b82f6); color: #fff; }
.todo-icon.confirm-order { background: linear-gradient(135deg, #6ee7b7, #10b981); color: #fff; }
.todo-icon.info-supplement { background: linear-gradient(135deg, #a5b4fc, #6366f1); color: #fff; }
.todo-icon.daily-plan { background: linear-gradient(135deg, #c4b5fd, #7c3aed); color: #fff; }
.todo-content { flex: 1; min-width: 0; }
.todo-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.todo-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; display: flex; align-items: center; min-width: 0; gap: 4px; }
.todo-meta > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 待办/报备固定高度，内置下滑 */
.todo-list.scroll-7 { height: 460px; overflow-y: auto; overflow-x: hidden; padding-right: 2px; }
.todo-list.scroll-3 { height: 200px; overflow-y: auto; overflow-x: hidden; padding-right: 2px; }
.todo-list.scroll-7::-webkit-scrollbar,
.todo-list.scroll-3::-webkit-scrollbar { width: 5px; }
.todo-list.scroll-7::-webkit-scrollbar-thumb,
.todo-list.scroll-3::-webkit-scrollbar-thumb { background: rgba(99,102,241,.35); border-radius: 3px; }
.todo-list.scroll-7::-webkit-scrollbar-track,
.todo-list.scroll-3::-webkit-scrollbar-track { background: transparent; }
/* 每条待办的负责人标签 */
.todo-owner {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    background: rgba(99,102,241,.12);
    color: #6366f1;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 8px;
    white-space: nowrap;
}

.empty-tip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 28px;
    color: var(--text-muted);
    font-size: 13px;
    justify-content: center;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px dashed var(--border-color);
}
.empty-tip i { color: var(--success); font-size: 16px; }

/* ==================== 模态框 ==================== */
.crm-modal-mask {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 5vh 16px 20px;
    overflow-y: auto;
    animation: crmFadeIn .2s ease;
}
@keyframes crmFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* 底部备案号 */
.beian-bar {
    width: 100%;
    text-align: center;
    padding: 12px 16px;
    font-size: 12px;
    color: #94a3b8;
    background: transparent;
    letter-spacing: .3px;
    line-height: 1.6;
    font-family: "Alibaba PuHuiTi", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.login-page .beian-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    color: rgba(255,255,255,.55);
}

/* 用户管理表格：明文密码徽章 */
.pwd-badge {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
    font-weight: 700;
    font-size: 12px;
    color: #4338ca;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    padding: 3px 10px;
    letter-spacing: .5px;
}

/* 查看数据范围徽章（权限管理-用户账号管理） */
.scope-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
    padding: 3px 10px;
    white-space: nowrap;
}
.scope-badge.all {
    color: #0f766e;
    background: #f0fdfa;
    border: 1px solid #99f6e4;
}
.scope-badge.self {
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}
.scope-badge.target {
    color: #7c3aed;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
}
/* 数据权限：页面指定人员授权徽章 */
.scope-badge.people {
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
}
/* 数据权限配置弹窗：按页面分组 */
.data-scope-page-block {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 10px;
}
.data-scope-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.data-scope-page-head strong {
    font-size: 14px;
    color: #334155;
}
.data-scope-all-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #0f766e;
    cursor: pointer;
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    border-radius: 12px;
    padding: 2px 10px;
}
.data-scope-all-item input {
    width: auto;
}
.data-scope-people-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.data-scope-people-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 3px 10px;
}
.data-scope-people-item input {
    width: auto;
}
.data-scope-people-item.disabled {
    opacity: .5;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* 查看某些人的数据：查看对象多选复选框列表 */
.scope-target-list {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
}
.scope-target-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 8px;
    transition: background .15s;
}
.scope-target-item:hover {
    background: #f8fafc;
}
.scope-target-item input[type=checkbox] {
    accent-color: #8b5cf6;
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* 数据视角切换控件（工作看板/我的商机/我的客户/我的项目/我的订单/我的报备页左上角） */
.view-scope-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    vertical-align: middle;
    color: #8b5cf6;
}
.view-scope-box i {
    font-size: 13px;
}
.view-scope-select {
    height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    font-size: 12.5px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
    max-width: 190px;
}
.view-scope-select:hover {
    border-color: #c4b5fd;
}
.view-scope-select:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139,92,246,.12);
}
/* 数据视角多选下拉 */
.view-scope-multi {
    width: 200px;
}
.view-scope-multi .multi-select-trigger {
    height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    border-color: #e2e8f0;
    font-size: 13px;
    color: var(--text-primary);
}
.view-scope-multi .multi-select-trigger:hover {
    border-color: #c4b5fd;
}
.view-scope-multi.open .multi-select-trigger {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139,92,246,.12);
}
.view-scope-multi .multi-select-dropdown {
    max-height: 280px;
    min-width: 200px;
}
.view-scope-multi .multi-option {
    padding: 7px 12px;
}

.crm-modal {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    box-shadow: 0 24px 80px rgba(15,23,42,.28);
    animation: crmSlideUp .3s cubic-bezier(.16,1,.3,1);
    border: 1px solid rgba(226,232,240,.6);
    overflow: hidden;
}
@keyframes crmSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

.crm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #fafbff 0%, #ffffff 100%);
}
.crm-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 9px;
}
.crm-modal-title::before {
    content: '';
    width: 4px;
    height: 16px;
    border-radius: 4px;
    background: var(--gradient-primary);
}
.crm-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all .15s ease;
}
.crm-modal-close:hover {
    background: var(--danger-bg);
    color: var(--danger);
    transform: rotate(90deg);
}
.crm-modal-body { padding: 22px 24px; max-height: 65vh; overflow-y: auto; }

/* ==================== 添加今日计划弹窗（美化版） ==================== */
.todo-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-left: -5px; /* 与 ::before 4px 竖条视觉对齐 */
}
.todo-modal-title .todo-modal-title-bar {
    width: 4px;
    height: 16px;
    border-radius: 4px;
    background: var(--gradient-primary);
}
.todo-modal-title i {
    color: #f59e0b;
    font-size: 15px;
}
.todo-modal-title em {
    font-style: normal;
    font-weight: 500;
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 2px;
}

.todo-modal-body { padding: 4px 2px; }

.todo-modal-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    border-radius: 10px;
    color: #92400e;
    font-size: 13px;
    line-height: 1.65;
}
.todo-modal-tip i { color: #f59e0b; margin-top: 3px; flex-shrink: 0; }
.todo-modal-tip em { font-style: normal; color: #1e293b; background: #ffffff; padding: 1px 6px; border-radius: 4px; }

.todo-modal-field { margin-bottom: 16px; }
.todo-modal-field:last-child { margin-bottom: 0; }

.todo-modal-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.todo-modal-label i { color: #6366f1; font-size: 12px; }
.todo-modal-label .required { color: #ef4444; }

.todo-modal-textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    outline: none;
    resize: vertical;
    min-height: 96px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.todo-modal-textarea::placeholder { color: #cbd5e1; }
.todo-modal-textarea:hover { border-color: #cbd5e1; }
.todo-modal-textarea:focus {
    border-color: #6366f1;
    background: #fafbff;
    box-shadow: 0 0 0 4px rgba(99,102,241,.12);
}

.todo-modal-foot {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}
.todo-modal-count {
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.todo-modal-count b { color: #6366f1; font-weight: 700; }

.todo-modal-priority {
    display: flex;
    gap: 10px;
}
.todo-prio-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all .15s ease;
}
.todo-prio-item input { display: none; }
.todo-prio-item i { font-size: 9px; }
.todo-prio-item.todo-prio-high i { color: #e2e8f0; transition: color .15s ease; }
.todo-prio-item.todo-prio-mid  i { color: #e2e8f0; transition: color .15s ease; }
.todo-prio-item.todo-prio-low  i { color: #e2e8f0; transition: color .15s ease; }
.todo-prio-item:hover { border-color: #cbd5e1; }
.todo-prio-item.active.todo-prio-high { border-color: #ef4444; background: #fef2f2; color: #b91c1c; }
.todo-prio-item.active.todo-prio-high i { color: #ef4444; }
.todo-prio-item.active.todo-prio-mid  { border-color: #f59e0b; background: #fffbeb; color: #b45309; }
.todo-prio-item.active.todo-prio-mid  i { color: #f59e0b; }
.todo-prio-item.active.todo-prio-low  { border-color: #10b981; background: #ecfdf5; color: #047857; }
.todo-prio-item.active.todo-prio-low  i { color: #10b981; }
.crm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 24px;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
    border-radius: 0 0 20px 20px;
}

/* ==================== 备份模块选择弹窗 ==================== */
.backup-modal-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
}
.backup-modal-tip i { margin-top: 2px; }
.backup-modal-tip strong { color: #075985; }
.backup-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.backup-selected-tip { font-size: 12px; color: var(--text-muted); }
.backup-module-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.backup-module-item {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all .15s ease;
    background: #fff;
}
.backup-module-item:hover { border-color: var(--primary); background: #f8fafc; }
.backup-module-item:has(input:checked) {
    border-color: var(--primary);
    background: #f0f6ff;
}
.backup-module-item input[type=checkbox] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}
.backup-module-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-bg);
    color: var(--primary);
    flex-shrink: 0;
}
.backup-module-info { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.backup-module-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.backup-module-count { font-size: 12px; color: var(--text-muted); }

/* ==================== 详情弹窗 ==================== */
.detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 18px;
}
.detail-title { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; letter-spacing: -0.2px; }
.detail-meta { font-size: 12px; color: var(--text-muted); }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f5f6ff 100%);
    border-radius: 12px;
    padding: 18px;
    border: 1px solid rgba(226,232,240,.5);
}
.detail-item label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}
.detail-item span {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 600;
}
.detail-block { margin-top: 18px; }
.detail-block-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    margin-top: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.detail-block-title::before {
    content: '';
    width: 4px;
    height: 14px;
    border-radius: 4px;
    background: var(--gradient-primary);
}
.detail-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
    background: #f8fafc;
    border-radius: 11px;
    padding: 14px 16px;
    border: 1px solid #f1f4f9;
}
.detail-empty {
    text-align: center;
    padding: 36px 0;
    color: var(--text-muted);
    font-size: 13px;
}

/* Tab 切换 */
.detail-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.detail-tab {
    padding: 9px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 10px 10px 0 0;
    transition: all .2s ease;
    border: none;
    background: none;
    font-weight: 600;
    position: relative;
}
.detail-tab:hover { color: var(--primary); background: var(--gradient-primary-soft); }
.detail-tab.active {
    color: var(--primary-deep);
    border-bottom: 2px solid var(--primary);
    margin-bottom: -2px;
    background: var(--gradient-primary-soft);
}
.detail-tab-panel { display: none; }
.detail-tab-panel.active { display: block; animation: crmFadeIn .25s ease; }

/* ==================== 联系人 ==================== */
.contact-list { display: flex; flex-direction: column; gap: 10px; }
.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all .2s ease;
    background: #fff;
}
.contact-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: rgba(99,102,241,.25);
    transform: translateX(2px);
}
.contact-item[data-action="edit-contact"] {
    cursor: pointer;
}
.contact-avatar {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: var(--gradient-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(99,102,241,.3);
}
.contact-info { flex: 1; min-width: 0; cursor: pointer; border-radius: 8px; padding: 2px 4px; margin: -2px -4px; transition: background .2s ease; }
.contact-info:hover { background: rgba(99,102,241,.06); }
.contact-tel-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    padding: 1px 8px;
    background: var(--gray-50, #f8fafc);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 11px;
}
.contact-tel-inline i { font-size: 10px; color: var(--text-muted); }
.contact-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.contact-pos { font-size: 12px; color: var(--text-muted); margin-left: 6px; }
.primary-tag {
    display: inline-block;
    background: var(--success-bg);
    color: #047857;
    font-size: 10px;
    padding: 2px 9px;
    border-radius: 8px;
    margin-left: 6px;
    font-weight: 700;
    vertical-align: 1px;
}
.contact-phone { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.contact-remark { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.contact-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; display: flex; gap: 12px; flex-wrap: wrap; }
.contact-sub span { display: inline-flex; align-items: center; gap: 4px; }
.contact-sub i { font-size: 11px; color: var(--text-muted); }
.phone-tag {
    display: inline-block;
    font-size: 10px;
    padding: 2px 9px;
    border-radius: 8px;
    margin-left: 6px;
    font-weight: 700;
    vertical-align: 1px;
}
.phone-tag.valid { background: var(--success-bg); color: #047857; }
.phone-tag.invalid { background: #f3f4f6; color: #64748b; }
.contact-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}
.contact-actions .btn-text { font-size: 12px; padding: 2px 0; }
.contact-actions .btn-text i { margin-right: 3px; font-size: 11px; }

/* ==================== 时间线 ==================== */
.timeline { position: relative; padding-left: 0; }
.timeline::before { content: none; }
.timeline-item { position: relative; margin-bottom: 18px; }
.timeline-dot { display: none; }
.timeline-content {
    background: linear-gradient(135deg, #f8fafc 0%, #f6f7ff 100%);
    border-radius: 12px;
    padding: 13px 15px;
    border: 1px solid rgba(226,232,240,.5);
    transition: box-shadow .2s ease;
}
.timeline-content:hover { box-shadow: var(--shadow-sm); }
/* 跟进记录卡片可点击编辑：整张卡片可点击 */
.timeline-item-clickable { cursor: pointer; transition: transform .15s ease; }
.timeline-item-clickable:hover .timeline-content { box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.timeline-item-clickable:active { transform: scale(.995); }
.timeline-item-clickable:hover .timeline-edit-hint { color: var(--primary) !important; }
.timeline-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.timeline-time { font-size: 12px; color: var(--text-muted); }
.timeline-user { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.timeline-contact {
    font-size: 11px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 9px;
    border-radius: 10px;
    font-weight: 600;
}
.timeline-text { font-size: 13px; color: var(--text-primary); line-height: 1.7; }
.timeline-footer { margin-top: 8px; display: flex; align-items: center; gap: 8px; font-size: 12px; }

/* 跟进记录分页 */
.comm-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 0 2px;
    margin-top: 6px;
    border-top: 1px dashed #eef1f6;
}
.comm-pager .btn { min-width: 78px; }
.comm-pager .btn[disabled] { opacity: .45; cursor: not-allowed; }
.comm-pager-info { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ==================== 关联数据 ==================== */
.related-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    border-bottom: 1px solid #f1f4f9;
    font-size: 13px;
    border-radius: 8px;
    transition: background .15s;
}
.related-item:last-child { border-bottom: none; }
.related-item:hover { background: #f8fafc; }
.related-name { flex: 1; font-weight: 600; color: var(--text-primary); }

/* ==================== 侧边栏底部用户 ==================== */
.sidebar-footer {
    margin-top: auto;
    padding: 14px;
    border-top: 1px solid var(--sidebar-border);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.06);
    transition: all .2s ease;
}
.sidebar-user:hover {
    background: rgba(255,255,255,.09);
    border-color: rgba(129,140,248,.3);
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: #fff; }
.sidebar-user-role { font-size: 11px; color: rgba(148,163,184,.65); }

/* ==================== 顶部图标按钮 ==================== */
.icon-btn {
    width: 38px; height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(226,232,240,.7);
    background: rgba(255,255,255,.8);
    color: var(--text-secondary);
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .25s ease;
}
.icon-btn:hover {
    color: var(--primary);
    border-color: rgba(99,102,241,.3);
    box-shadow: var(--shadow-sm);
    transform: rotate(180deg);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
}

/* ==================== 用户切换面板 ==================== */
.user-switch-panel {
    position: fixed;
    top: 66px;
    right: 28px;
    z-index: 9998;
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 270px;
    padding: 12px;
    animation: crmSlideUp .2s ease;
    border: 1px solid rgba(226,232,240,.6);
}
.user-switch-title { font-size: 12px; color: var(--text-muted); padding: 4px 8px 10px; font-weight: 600; }
.user-switch-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 11px;
    cursor: pointer;
    transition: all .15s ease;
    font-size: 13px;
}
.user-switch-item:hover { background: #f8fafc; }
.user-switch-item.active { background: var(--gradient-primary-soft); }
.user-switch-info { flex: 1; font-weight: 600; color: var(--text-primary); }

/* ==================== 数据统计 ==================== */
.data-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.data-stat-box {
    background: linear-gradient(135deg, #f8fafc 0%, #f5f6ff 100%);
    border-radius: 12px;
    text-align: center;
    padding: 14px 6px;
    border: 1px solid rgba(226,232,240,.5);
    transition: all .2s ease;
}
.data-stat-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: rgba(99,102,241,.25);
}
.data-stat-box b {
    display: block;
    font-size: 22px;
    color: var(--primary-deep);
    font-variant-numeric: tabular-nums;
}
.data-stat-box span { font-size: 12px; color: var(--text-muted); }

/* ==================== 侧边栏折叠 ==================== */
.sidebar-collapsed .sidebar { width: 64px; }
.sidebar-collapsed .logo-text,
.sidebar-collapsed .company-name,
.sidebar-collapsed .nav-item span,
.sidebar-collapsed .sidebar-user-info { display: none; }
.sidebar-collapsed .logo { justify-content: center; }
.sidebar-collapsed .nav-item { justify-content: center; padding: 12px; }
.sidebar-collapsed .main-content { margin-left: 64px; }
.sidebar-collapsed .nav-item.active::before { display: none; }
.sidebar-collapsed .sidebar-user { justify-content: center; }
.sidebar-collapsed .sidebar-header { padding: 20px 12px 12px; }

/* ==================== 响应式 ==================== */
@media (max-width: 1200px) {
    .stats-cards { grid-template-columns: repeat(3, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 992px) {
    .detail-grid { grid-template-columns: 1fr 1fr; }
}

/* ==================== 报备管理页面 ==================== */
.reg-page-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}
.reg-page-grid--full {
    grid-template-columns: 1fr;
}
/* 页面权限表：可访问页面勾选 */
.page-perm-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 560px;
}
.page-perm-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    color: #475569;
    background: #f8fafc;
    cursor: pointer;
    white-space: nowrap;
}
.page-perm-item input {
    width: auto;
    margin: 0;
}
.page-perm-item .lock-tip {
    color: #f59e0b;
    font-size: 10px;
    margin-left: 2px;
}
.page-perm-item.disabled {
    opacity: .55;
    cursor: not-allowed;
}
.reg-main { min-width: 0; }
.reg-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.reg-filter-wrap {
    display: flex;
    gap: 14px;
    align-items: stretch;
    margin-bottom: 18px;
}
.reg-filter-wrap .filter-panel {
    flex: 1;
    margin-bottom: 0;
}
.reg-expire-box {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%);
    border: 1px solid rgba(248,113,113,.2);
    border-radius: var(--radius);
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
}
.reg-expire-box .expire-label {
    margin-bottom: 6px;
}
.reg-expire-box .expire-value {
    font-size: 34px;
}
.reg-expire-box .expire-hint {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}
.reg-filter-panel {
    /* 与公海客户筛选面板颜色一致 */
    background: #fff;
    border-radius: var(--radius);
    padding: 18px 20px;
    border: 1px solid rgba(226,232,240,.55);
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}
.reg-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 14px;
}
.reg-filter-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.reg-filter-item label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}
.reg-filter-item .search-input,
.reg-filter-item .filter-select {
    width: 100%;
    min-width: 0;
}
.data-invalid-tip {
    width: 100%;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.reg-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(15,23,42,.04);
}
.reg-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.reg-card-title i { color: var(--primary); font-size: 12px; }
.memo-edit-btn { margin-left: auto; font-size: 12px; }
.memo-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.memo-list li {
    position: relative;
    padding-left: 14px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}
.memo-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
}
.expire-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.expire-value {
    font-size: 48px;
    font-weight: 800;
    color: #e11d48;
    line-height: 1;
    letter-spacing: -1px;
}
.expire-value span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: 4px;
}
.reg-chart-wrap { overflow-x: auto; }
.reg-chart { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; padding-right: 2px; }
.reg-chart-row {
    display: grid;
    grid-template-columns: 70px 1fr 24px;
    align-items: center;
    gap: 8px;
}
.reg-chart-label {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}
.reg-chart-bar-wrap {
    height: 14px;
    background: #f1f5f9;
    border-radius: 7px;
    overflow: hidden;
}
.reg-chart-bar {
    height: 100%;
    border-radius: 7px;
    transition: width .4s ease;
}
.reg-chart-val {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: right;
}
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-primary { background: #e0e7ff; color: #4338ca; }

/* ============ 工作报告（日报） ============ */
.workreport-wrap {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 22px;
}
.workreport-card { padding-bottom: 6px; }
.workreport-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.workreport-form .tip {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 400;
    margin-left: 6px;
}
.workreport-form textarea {
    resize: vertical;
    min-height: 76px;
    line-height: 1.6;
}
/* 工作日报：逐条添加列表（复用首页 todo-item 风格） */
.wr-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 44px;
    margin-bottom: 6px;
}
.wr-empty {
    padding: 12px;
    font-size: 13px;
    color: #94a3b8;
    text-align: center;
    background: rgba(148,163,184,.06);
    border-radius: 10px;
}
.wr-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(148,163,184,.04);
    transition: all .2s ease;
    flex-shrink: 0;
}
.wr-item:hover {
    background: var(--row-hover);
    border-color: rgba(99,102,241,.12);
    transform: translateX(2px);
}
.wr-item .wr-item-text {
    flex: 1;
    font-size: 13.5px;
    color: var(--text-primary);
    line-height: 1.45;
    word-break: break-all;
}
/* 已完成项：复用 todo-item.done 样式 */
.wr-item.done .wr-item-text {
    color: #94a3b8;
    text-decoration: line-through;
}
.wr-item.done .todo-check {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}
.wr-item.done { background: rgba(148,163,184,.07); }
.wr-item.done:hover { transform: none; }
/* 示例条目：虚线边框 + 浅灰背景，提示用户可替换 */
.wr-item.demo {
    background: rgba(99,102,241,.04);
    border: 1px dashed #c4b5fd;
}
.wr-item.demo:hover {
    background: rgba(99,102,241,.08);
    border-color: #a78bfa;
}
.wr-item.demo .wr-item-text {
    color: #64748b;
    font-style: italic;
}
.wr-item.demo.done .wr-item-text {
    color: #94a3b8;
}
/* 删除按钮 */
.wr-item .btn-text {
    padding: 4px 6px;
    font-size: 12px;
    color: #94a3b8;
    border-radius: 6px;
}
.wr-item .btn-text:hover { color: #ef4444; background: rgba(239,68,68,.08); }
/* 添加行 */
.wr-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.wr-add-row input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    color: var(--text-primary);
    outline: none;
    transition: border-color .2s;
}
.wr-add-row input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.wr-add-row .btn-sm {
    padding: 8px 14px;
    font-size: 12.5px;
    border-radius: 8px;
    flex-shrink: 0;
}
/* 历史日报：已完成项加删除线 */
.hist-list li.done { color: #94a3b8; text-decoration: line-through; }
.workreport-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}
.workreport-history {
    display: flex;
    flex-direction: column;
    gap: 14px;
    /* 内置滑动下拉：超出固定高度后自动出现滚动条 */
    max-height: 560px;
    overflow-y: auto;
    padding-right: 6px;
    scroll-behavior: smooth;
}
.workreport-hist-item {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: var(--shadow-xs);
}
.hist-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}
.hist-date {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.hist-body { display: flex; flex-direction: column; gap: 10px; }
.hist-row { display: flex; gap: 10px; }
.hist-label {
    flex-shrink: 0;
    width: 64px;
    font-size: 12px;
    color: var(--text-secondary);
    padding-top: 1px;
}
.hist-list {
    margin: 0;
    padding-left: 16px;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--text-primary);
}
.hist-text {
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
}
/* 工作报告布局：左栏=今日日报+历史日报，右栏=日报数据分析 */
/* 左栏：今日日报卡片正下方紧接历史日报（间距小于栅格间距，视觉紧贴） */
.wr-left-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}
.wr-right-col {
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-width: 0;
}
.wr-history-section { min-width: 0; }

/* 日报数据分析 */
.wr-analysis { display: flex; flex-direction: column; gap: 14px; }
.wr-analysis-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wr-stat {
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    border: 1px solid rgba(226, 232, 240, .6);
    border-radius: 12px;
    padding: 14px 16px;
}
.wr-stat-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.wr-stat-label { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.wr-stat-value { font-size: 24px; font-weight: 800; color: var(--primary); }
.wr-bar { height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.wr-bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #6366f1, #818cf8); }
.wr-stat-hint { margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.wr-mini-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.wr-mini {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.wr-mini-icon {
    width: 32px; height: 32px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 9px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 14px;
}
.wr-mini-num { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.wr-mini-label { font-size: 11px; color: var(--text-muted); }
.wr-sub-line { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; line-height: 1.6; }
.wr-peruser { margin-top: 2px; }
.wr-peruser-title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
/* 全员日报提交日历 */
.wr-cal { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border-color); }
.wr-cal-scroll { overflow-x: auto; }
.wr-cal-table { min-width: max-content; }
.wr-cal-table th,
.wr-cal-table td { padding: 3px 5px; text-align: center; white-space: nowrap; }
.wr-cal-table thead th { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.wr-cal-table thead th.wk { color: #f59e0b; }
.wr-cal-table thead th.today { color: var(--primary); box-shadow: inset 0 -2px 0 var(--primary); }
.wr-cal-cell { width: 24px; height: 24px; border-radius: 6px; font-size: 11px; }
.wr-cal-cell.on { background: #dcfce7; color: #16a34a; }
.wr-cal-cell.miss { background: #fee2e2; color: #ef4444; }
.wr-cal-cell.rest { background: #f1f5f9; }
.wr-cal-cell.future { background: #f8fafc; }
.wr-cal-user { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12px; white-space: nowrap; min-width: 110px; }
.wr-rate { font-weight: 700; font-size: 13px; padding: 2px 8px; border-radius: 99px; }
.wr-rate.good { background: #dcfce7; color: #16a34a; }
.wr-rate.mid  { background: #fef3c7; color: #d97706; }
.wr-rate.low  { background: #fee2e2; color: #dc2626; }
.hist-user { background: #f1f5f9; color: #475569; font-weight: 600; }

@media (max-width: 640px) {
    .wr-mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wr-analysis-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
    .workreport-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 1200px) {
    .reg-page-grid { grid-template-columns: 1fr; }
    .reg-sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .reg-filter-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .sidebar { width: 64px; }
    .sidebar .logo-text,
    .sidebar .company-name,
    .nav-item span,
    .sidebar-user-info { display: none; }
    .logo { justify-content: center; }
    .nav-item { justify-content: center; padding: 12px; }
    .nav-item.active::before { display: none; }
    .main-content { margin-left: 64px; }
    .stats-cards { grid-template-columns: repeat(2, 1fr); }
    .settings-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: span 1; }
    .page-container { padding: 18px 16px 24px; }
    .reg-filter-grid { grid-template-columns: 1fr 1fr; }
    .reg-sidebar { grid-template-columns: 1fr; }
    .reg-filter-wrap {
        flex-direction: column;
    }
    .reg-expire-box {
        flex: 1 1 auto;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        padding: 14px 18px;
    }
    .reg-expire-box .expire-label {
        margin-bottom: 0;
    }
    .reg-expire-box .expire-value {
        font-size: 26px;
    }
}

@media (max-width: 480px) {
    .stats-cards { grid-template-columns: 1fr; }
    .top-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .filter-bar { flex-wrap: wrap; }
    .search-input { width: 100%; }
    .detail-grid { grid-template-columns: 1fr; }
    .crm-modal-body { padding: 16px; }
    .crm-modal-footer { flex-wrap: wrap; }
    .data-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ================= 订单页面 ================= */
/* 订单筛选面板与统计卡片一行排列 */
.order-filter-wrap {
    display: flex;
    gap: 14px;
    align-items: stretch;
    margin-bottom: 18px;
}
.order-filter-wrap .filter-panel {
    flex: 1;
    margin-bottom: 0;
}
.order-filter-wrap .order-stats-grid {
    flex: 0 0 480px;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 0;
}
.order-filter-wrap .order-stat-card {
    padding: 14px 12px;
}
.order-filter-wrap .order-stat-label {
    font-size: 12px;
    margin-bottom: 8px;
}
.order-filter-wrap .order-stat-amount {
    font-size: 22px;
}
.order-filter-wrap .order-stat-date,
.order-filter-wrap .order-stat-countdown {
    font-size: 17px;
}
.order-filter-wrap .order-stat-license-hint {
    font-size: 12px;
    margin-top: 6px;
}

.order-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.order-stat-card {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(226,232,240,.6);
    border-radius: var(--radius);
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 124px;
    box-shadow: var(--shadow-sm);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.order-stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: var(--gradient-primary);
}
.order-stat-card:nth-child(2)::before {
    background: linear-gradient(90deg, #f59e0b, #f97316);
}
.order-stat-card:nth-child(3)::before {
    background: linear-gradient(90deg, #ef4444, #f97316);
}
.order-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: rgba(99,102,241,.25);
}

.order-stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    font-weight: 500;
}

.order-stat-value-box {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.order-stat-big-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: #fff;
    font-size: 30px;
    font-weight: 800;
    width: 58px;
    height: 58px;
    border-radius: 16px;
    line-height: 1;
    box-shadow: var(--shadow-glow);
    font-variant-numeric: tabular-nums;
}

.order-stat-unit {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 600;
}

.order-stat-amount {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(120deg, #1e293b 20%, #4f46e5 90%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.order-stat-license {
    padding-top: 2px;
}

/* 许可到期倒计时（实时跳动：天/时/分/秒） */
.order-stat-countdown {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(120deg, #b91c1c 20%, #ef4444 90%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
    letter-spacing: .3px;
}

.order-stat-date {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(120deg, #0f766e 20%, #06b6d4 90%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
}

.order-stat-license-hint {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.order-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.order-page-title {
    position: relative;
    padding-left: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}
.order-page-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    border-radius: 2px;
    background: var(--gradient-primary);
}

.order-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.order-toolbar .btn-icon-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .2s ease;
    box-shadow: var(--shadow-xs);
}
.order-toolbar .btn-icon-text:hover {
    color: var(--primary);
    border-color: rgba(99,102,241,.4);
    background: #f5f6ff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.order-toolbar .btn-icon-text i { color: var(--primary); font-size: 12px; }

.order-toolbar .toolbar-search {
    position: relative;
    display: flex;
    align-items: center;
}
.order-toolbar .toolbar-search i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
}
.order-toolbar .toolbar-search input {
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    width: 150px;
    outline: none;
    background: #fff;
    color: var(--text-primary);
    transition: all .2s ease;
    box-shadow: var(--shadow-xs);
}
.order-toolbar .toolbar-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
    width: 190px;
}

@media (max-width: 768px) {
    .order-filter-wrap {
        flex-direction: column;
    }
    .order-filter-wrap .order-stats-grid {
        flex: none;
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .order-stats-grid {
        grid-template-columns: 1fr;
    }
    .order-page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .order-toolbar {
        width: 100%;
    }
}

/* ================= 财务报告页面 ================= */
.fin-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.fin-card {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(226,232,240,.6);
    border-radius: var(--radius);
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.fin-card::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient-primary);
    opacity: .85;
}
.fin-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: rgba(99,102,241,.25);
}
.fin-card-blue::after { background: linear-gradient(180deg, #3b82f6, #60a5fa); }
.fin-card-green::after { background: linear-gradient(180deg, #10b981, #34d399); }
.fin-card-orange::after { background: linear-gradient(180deg, #f59e0b, #fb923c); }
.fin-card-purple::after { background: linear-gradient(180deg, #8b5cf6, #a78bfa); }

.fin-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    color: #fff;
    flex-shrink: 0;
}
.fin-card-blue .fin-card-icon { background: linear-gradient(135deg, #3b82f6, #60a5fa); box-shadow: 0 6px 16px rgba(59,130,246,.3); }
.fin-card-green .fin-card-icon { background: linear-gradient(135deg, #10b981, #34d399); box-shadow: 0 6px 16px rgba(16,185,129,.3); }
.fin-card-orange .fin-card-icon { background: linear-gradient(135deg, #f59e0b, #fb923c); box-shadow: 0 6px 16px rgba(245,158,11,.3); }
.fin-card-purple .fin-card-icon { background: linear-gradient(135deg, #8b5cf6, #a78bfa); box-shadow: 0 6px 16px rgba(139,92,246,.3); }

.fin-card-body { min-width: 0; }
.fin-card-label {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}
.fin-card-value {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(120deg, #1e293b 20%, #4f46e5 90%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}

.fin-main-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 16px;
    align-items: start;
}

.fin-col-main, .fin-col-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.fin-card-block {
    background: #fff;
    border: 1px solid rgba(226,232,240,.6);
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
}

.fin-block-header {
    margin-bottom: 16px;
}

.fin-block-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}
.fin-block-title i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: var(--gradient-primary-soft);
    color: var(--primary);
    font-size: 14px;
}

/* 趋势图 */
.fin-chart-wrap {
    overflow-x: auto;
}

.fin-chart-svg {
    width: 100%;
    min-width: 600px;
    height: auto;
}

.fin-grid-line {
    stroke: #eef1f7;
    stroke-width: 1;
}

.fin-axis-label {
    font-size: 11px;
    fill: #94a3b8;
}

.fin-bar {
    fill: url(#crmBarGradient);
    transition: opacity .2s, filter .2s;
    cursor: pointer;
}

.fin-bar:hover { opacity: .9; filter: brightness(1.06); }

.fin-bar-val {
    font-size: 11px;
    fill: #64748b;
    font-weight: 600;
}

.fin-bar-label {
    font-size: 12px;
    fill: #64748b;
}

/* 漏斗 */
.fin-funnel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 4px 0;
}

.fin-funnel-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fin-funnel-label {
    width: 72px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: right;
    flex-shrink: 0;
}

.fin-funnel-track {
    flex: 1;
    background: #f1f5f9;
    border-radius: 10px;
    height: 32px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(15,23,42,.05);
}

.fin-funnel-bar {
    height: 100%;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    min-width: 40px;
    transition: width .3s;
}

.fin-funnel-val {
    font-size: 11px;
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,.18);
}

.fin-funnel-rate {
    width: 44px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: left;
    flex-shrink: 0;
}

/* 表格 */
.fin-table th { font-size: 12px; }
.fin-table td { font-size: 13px; }

.rank-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.rank-badge.rank-top {
    border: none;
    color: #fff;
}
.rank-badge.rank-1 {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 3px 8px rgba(245,158,11,.4);
}
.rank-badge.rank-2 {
    background: linear-gradient(135deg, #e8edf5, #c7d2e0);
    color: #475569;
    box-shadow: 0 3px 8px rgba(148,163,184,.35);
}
.rank-badge.rank-3 {
    background: linear-gradient(135deg, #fdba74, #f97316);
    box-shadow: 0 3px 8px rgba(249,115,22,.35);
}

.rank-role {
    font-size: 12px;
    color: var(--text-muted);
}

@media (max-width: 1400px) {
    .fin-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1100px) {
    .fin-main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .fin-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* ================= 用户与权限管理 ================= */
.settings-card.wide { grid-column: 1 / -1; }
.card-tip {
    font-size: 11px;
    font-weight: 400;
    color: #94a3b8;
    background: #f1f5f9;
    border-radius: 20px;
    padding: 2px 10px;
    margin-left: 4px;
    white-space: nowrap;
}
.card-desc {
    font-size: 13px;
    color: #64748b;
    margin: -8px 0 16px;
    line-height: 1.7;
}
.card-desc strong { color: #dc2626; font-weight: 600; }
.user-mgmt-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
    white-space: nowrap;
}
.role-badge.role-admin { background: #fef2f2; color: #dc2626; }
.role-badge.role-sales_director { background: #f5f3ff; color: #7c3aed; }
.role-badge.role-manager { background: #eff6ff; color: #2563eb; }
.role-badge.role-market_director { background: #ecfeff; color: #0891b2; }
.role-badge.role-marketer { background: #f0fdfa; color: #0d9488; }
.role-badge.role-opp_assistant { background: #fffbeb; color: #d97706; }
.role-badge.role-none { background: #fff7ed; color: #ea580c; }
.role-badge.role-none i { font-size: 10px; }

/* ================= 操作日志 ================= */
.audit-clear-btn { margin-left: auto; }
.audit-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.audit-filter-bar select,
.audit-filter-bar input[type=text] {
    height: 34px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 0 10px;
    font-size: 13px;
    color: var(--text, #1e293b);
    background: #fff;
    outline: none;
}
.audit-filter-bar select:focus,
.audit-filter-bar input[type=text]:focus { border-color: var(--primary, #3b82f6); }
.audit-filter-bar input[type=date] {
    height: 34px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 0 8px;
    font-size: 13px;
    color: var(--text, #1e293b);
    background: #fff;
    outline: none;
}
.audit-filter-bar #auditKeyword { width: 200px; }
.audit-date-sep { font-size: 12px; color: #94a3b8; }
.audit-table td { vertical-align: middle; }
.audit-time { color: #64748b; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.audit-user { font-weight: 600; color: var(--text, #1e293b); }
.audit-role {
    font-size: 11px;
    color: #94a3b8;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 1px 8px;
    margin-left: 6px;
}
.audit-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    padding: 2px 10px;
    white-space: nowrap;
}
.audit-badge.login { background: #ecfdf5; color: #059669; }
.audit-badge.logout { background: #f1f5f9; color: #64748b; }
.audit-badge.action { background: #eff6ff; color: #2563eb; }
.audit-detail { color: #64748b; font-size: 13px; max-width: 280px; }
.audit-pager {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 14px;
}
.audit-count { font-size: 13px; color: #94a3b8; margin-right: auto; }
.audit-page-info { font-size: 13px; color: var(--text, #1e293b); font-variant-numeric: tabular-nums; }

/* ================= 角色权限说明 ================= */
.role-perm-summary {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px dashed var(--border-color, #e2e8f0);
}
.role-perm-summary h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--text, #1e293b);
}
.role-perm-summary h4 .card-tip { font-size: 11px; }

/* ================= 未分配角色拦截页 ================= */
.page-container { position: relative; }
.no-access-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f6f7ff 0%, #eef2ff 100%);
    animation: crmFadeIn .25s ease;
}
.no-access-box {
    text-align: center;
    background: #fff;
    border: 1px solid rgba(226,232,240,.6);
    border-radius: 20px;
    padding: 44px 52px;
    box-shadow: var(--shadow);
    max-width: 440px;
}
.no-access-icon {
    width: 74px;
    height: 74px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: var(--gradient-primary-soft);
    color: var(--primary);
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.no-access-box h2 {
    font-size: 19px;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.no-access-box p {
    font-size: 13px;
    color: #64748b;
    line-height: 1.8;
    margin-bottom: 4px;
}
.no-access-box .btn { margin-top: 18px; }

/* ================= 用户切换面板 ================= */
.user-no-role-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    color: #ea580c;
    background: #fff7ed;
    vertical-align: middle;
}
.user-switch-item.no-role { cursor: not-allowed; opacity: .75; }
.user-switch-item.no-role:hover { background: transparent; }

/* ================= 统一客户详情页 ================= */
.detail-page { display: flex; flex-direction: column; gap: 14px; }
.detail-top-card { padding: 0; overflow: hidden; }
.detail-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 14px;
}
.detail-top-left { display: flex; align-items: flex-start; gap: 14px; }
.detail-back-btn { flex-shrink: 0; }
.detail-title-group { min-width: 0; }
.detail-company-name {
    font-size: 21px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
    line-height: 1.3;
    word-break: break-all;
}
.detail-created { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.detail-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px 16px;
}
.detail-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e8edf5;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    color: #475569;
}
.detail-chip b { color: #94a3b8; font-weight: 500; }

.detail-layout {
    display: grid;
    grid-template-columns: 1.9fr 1fr;
    gap: 20px;
    align-items: start;
}
.detail-left, .detail-right { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.detail-card { background: #fff; border-radius: 12px; border: 1px solid rgba(226,232,240,.55); box-shadow: 0 1px 3px rgba(15,23,42,.03); overflow: hidden; }
.detail-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}
.detail-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}
.detail-card-head .detail-card-title { padding: 0; border-bottom: none; }
.follow-time { font-size: 12px; color: #94a3b8; }
.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 16px;
    padding: 14px 16px;
}
.detail-field { min-width: 0; }
.detail-field label { display: block; font-size: 11px; color: #94a3b8; margin-bottom: 3px; }
.detail-field .detail-value { font-size: 13px; color: #1e293b; word-break: break-all; line-height: 1.5; }
/* 客户详情双击编辑 */
[data-edit] { cursor: text; transition: background .15s; border-radius: 4px; }
[data-edit]:hover { background: #f1f5f9; }
.inline-edit-input {
    width: 100%; min-width: 80px; box-sizing: border-box;
    padding: 4px 8px; font-size: 13px; color: #1e293b;
    border: 1px solid #2563eb; border-radius: 4px; outline: none;
    background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.detail-value .inline-edit-input, .detail-text .inline-edit-input { width: 100%; }
.detail-field.wide { grid-column: 1 / -1; }
.detail-subtitle {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    padding: 14px 16px 0;
}
.detail-subtitle + .detail-grid { padding-top: 8px; }

.follow-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px 16px;
}
.follow-box {
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 10px;
    padding: 10px 12px;
    min-width: 0;
}
.follow-box label { display: block; font-size: 11px; color: #94a3b8; margin-bottom: 5px; }
.follow-box p { margin: 0; font-size: 13px; color: #334155; line-height: 1.7; word-break: break-all; }
.contact-list { display: flex; flex-direction: column; gap: 8px; }
.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}
.contact-item b { color: #1e293b; font-weight: 600; }
.contact-primary { color: #f59e0b; font-size: 11px; }
.contact-pos { color: #94a3b8; white-space: nowrap; }
.contact-phone { color: #475569; white-space: nowrap; }
.contact-add-btn { flex-shrink: 0; padding: 3px 10px; font-size: 12px; }
.muted-text { color: #94a3b8; font-size: 12px; }

.detail-tabs {
    display: flex;
    gap: 2px;
    padding: 10px 16px 0;
    border-bottom: 1px solid #f1f5f9;
    overflow-x: auto;
}
.detail-tab {
    padding: 8px 14px;
    font-size: 13px;
    color: #64748b;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    transition: color .15s;
}
.detail-tab:hover { color: var(--primary); }
.detail-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.detail-panel { padding: 6px 16px 16px; }
.detail-record {
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    margin-top: 10px;
    background: #fbfcfe;
    transition: box-shadow .2s, border-color .2s;
}
.detail-record.hl { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(99,102,241,.14); }
.detail-record-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border-bottom: 1px dashed #e2e8f0;
}
.detail-record-head b { font-size: 13px; color: #1e293b; word-break: break-all; }
.detail-record-time { font-size: 11px; color: #94a3b8; white-space: nowrap; }
.detail-record .detail-grid { padding: 10px 12px; gap: 10px 14px; }
.detail-record .detail-grid .detail-field label { font-size: 10px; }
.detail-record .detail-grid .detail-field .detail-value { font-size: 12px; }
/* 记录卡片右下角编辑按钮区 */
.detail-record-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding: 2px 12px 10px;
}
.detail-record-actions .btn {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 7px;
}
.detail-record.editing .detail-record-actions { border-top: 1px dashed #e2e8f0; padding-top: 10px; }

/* 客户详情页 - 历史记录时间线 */
.hist-list { padding: 4px 2px; }
.hist-item {
    display: flex;
    gap: 10px;
    padding: 9px 4px;
    border-bottom: 1px dashed #eef2f7;
}
.hist-item:last-child { border-bottom: none; }
.hist-ico {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    color: #fff;
}
.hist-ico.blue { background: #3b82f6; }
.hist-ico.green { background: #10b981; }
.hist-ico.amber { background: #f59e0b; }
.hist-ico.purple { background: #8b5cf6; }
.hist-ico.gray { background: #94a3b8; }
.hist-body { flex: 1; min-width: 0; }
.hist-text { font-size: 13px; color: #1e293b; line-height: 1.5; word-break: break-all; }
.hist-meta { font-size: 11px; color: #94a3b8; margin-top: 3px; }

/* 商机记录：展示全部记录，固定高度内置滑动（内置滚动条查看不同记录） */
.opp-panel {
    height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
    padding: 4px 6px 4px 0;
}
.opp-panel::-webkit-scrollbar { width: 6px; }

/* 报备/项目/订单记录：固定高度内置上下滑动（内置滚动条查看不同记录） */
.module-panel {
    height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
    padding: 4px 6px 4px 0;
}
.module-panel::-webkit-scrollbar { width: 6px; }

/* Tab 栏：隐藏横向滚动条 */
.detail-tabs {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.detail-tabs::-webkit-scrollbar { display: none; }
.detail-empty {
    padding: 34px 10px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}
.detail-empty i { font-size: 26px; opacity: .4; display: block; margin-bottom: 8px; }
.detail-empty p { margin: 0; }

@media (max-width: 1100px) {
    .detail-layout { grid-template-columns: 1fr; }
    .follow-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-field.wide { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .detail-top { flex-direction: column; }
    .detail-company-name { font-size: 17px; }
}

/* 客户详情 工商信息 两行排布 */
.detail-grid.gx-grid { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) {
    .detail-grid.gx-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    .detail-grid.gx-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .detail-grid.gx-grid { grid-template-columns: 1fr; }
}

/* 客户信息 四列排布 */
.detail-grid.gx-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) {
    .detail-grid.gx-grid-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    .detail-grid.gx-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .detail-grid.gx-grid-4 { grid-template-columns: 1fr; }
}

/* 跟进信息卡片左右排布 */
.follow-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 14px 16px;
    min-height: 0;
}
.follow-left { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.follow-right { min-width: 0; display: flex; }
.follow-right .follow-contact-box {
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.contact-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.contact-head label { margin-bottom: 0; }
/* 联系人列表固定 3 个联系人高度，超出内置滚动 */
.follow-contact-box .contact-list {
    height: 92px;
    overflow-y: auto;
    padding-right: 4px;
}
.follow-contact-box .contact-add-btn { flex-shrink: 0; }
@media (max-width: 992px) {
    .follow-split { grid-template-columns: 1fr; }
}

/* 拆分后的跟进信息卡片 / 联系人卡片（独立两个 card） */
.follow-list {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.follow-list .follow-box { min-width: 0; }
.contact-list-wrap {
    padding: 0 16px 14px;
}
.contact-list-wrap .contact-list {
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

/* 客户信息卡片左右排布 */
.detail-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-split.detail-split-wide-left { grid-template-columns: 1fr 1fr; }
.detail-col { min-width: 0; }
.detail-grid.gx-col-3 { grid-template-columns: repeat(3, 1fr); }
.detail-grid.gx-col-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) {
    .detail-split, .detail-split.detail-split-wide-left { grid-template-columns: 1fr; gap: 12px; }
    .detail-grid.gx-col-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    .detail-grid.gx-col-3, .detail-grid.gx-col-2 { grid-template-columns: 1fr; }
}

/* ================= 弹窗提示 ================= */
.form-tip {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.7;
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 6px;
}
.form-tip i { color: #64748b; margin-right: 4px; }
.required { color: #dc2626; margin-left: 2px; }

/* ================= 退出登录按钮 ================= */
.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding: 9px 12px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    background: rgba(255,255,255,.03);
    color: #cbd5e1;
    font-size: 12.5px;
    cursor: pointer;
    transition: all .2s ease;
}
.sidebar-logout:hover {
    background: rgba(239,68,68,.15);
    color: #fca5a5;
    border-color: rgba(239,68,68,.3);
}
.sidebar-collapsed .sidebar-logout span { display: none; }
.sidebar-collapsed .sidebar-logout { justify-content: center; }

/* ================= 登录页 ================= */
.login-page {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(1000px 600px at 10% 0%, rgba(99,102,241,.18), transparent 60%),
        radial-gradient(900px 500px at 100% 100%, rgba(139,92,246,.16), transparent 60%),
        linear-gradient(135deg, #f6f7ff 0%, #eef2ff 50%, #f5f3ff 100%);
}
.login-box {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 20px 60px rgba(30,41,59,.12), 0 4px 16px rgba(30,41,59,.06);
    padding: 38px 34px 30px;
    text-align: center;
    animation: crmFadeIn .35s ease;
}
.login-logo {
    width: 190px;
    height: 190px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}
.login-box h1 {
    font-size: 20px;
    color: #1e293b;
    margin: 0 0 4px;
    letter-spacing: .5px;
}
.login-sub {
    font-size: 13px;
    color: #94a3b8;
    margin: 0 0 22px;
}
.login-error {
    margin-bottom: 14px;
    padding: 9px 12px;
    border-radius: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    font-size: 12.5px;
    text-align: left;
}
.login-field {
    position: relative;
    margin-bottom: 14px;
}
.login-field i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
}
.login-field input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    color: #1e293b;
    outline: none;
    transition: all .2s ease;
    box-sizing: border-box;
    background: #f8fafc;
}
.login-field input:focus {
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.login-field input::placeholder { color: #b0b8c4; }
.login-btn {
    width: 100%;
    margin-top: 6px;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 6px;
    cursor: pointer;
    transition: all .2s ease;
    box-shadow: 0 8px 20px rgba(99,102,241,.3);
}
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(99,102,241,.4); }
.login-btn:active { transform: translateY(0); }
.login-tip {
    margin-top: 14px;
    font-size: 12px;
    color: #94a3b8;
}
.login-tip b { color: #6366f1; font-weight: 600; }

/* ==================== 全局高级感增强 ==================== */

/* 页面氛围光晕 */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(720px 480px at 12% -6%, rgba(99,102,241,.08), transparent 62%),
        radial-gradient(820px 560px at 108% 18%, rgba(139,92,246,.07), transparent 62%),
        radial-gradient(640px 460px at 50% 115%, rgba(59,130,246,.05), transparent 60%);
}

/* 卡片悬浮微交互（统一） */
.data-section,
.fin-card-block {
    transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
.data-section:hover,
.fin-card-block:hover {
    box-shadow: var(--shadow);
    border-color: rgba(99,102,241,.16);
}

/* 表格行 hover 左侧渐变指示条 */
.data-table tbody tr { position: relative; }

/* ============ 报备页工具栏：复用"我的订单"同款样式（.toolbar-divider / .col-dropdown-wrap / .col-dropdown / .col-opt / .public-filter-grid） ============ */


.data-table tbody tr:hover td:first-child {
    box-shadow: inset 3px 0 0 var(--primary);
}

/* 数字等宽对齐（金额/统计更整齐） */
.fin-card-value,
.order-stat-amount,
.order-stat-big-num,
.stat-value,
.data-table td {
    font-variant-numeric: tabular-nums;
}

/* 状态徽章 / 标签轻投影 */
.status-badge,
.intention,
.stage,
.tag {
    box-shadow: 0 1px 2px rgba(15,23,42,.05);
}

/* 键盘焦点可见性（无障碍 + 精致） */
.btn:focus-visible,
.btn-icon-text:focus-visible,
.toolbar-search input:focus-visible,
.login-field input:focus-visible {
    outline: 2px solid rgba(99,102,241,.55);
    outline-offset: 2px;
}

/* 滚动条 hover 加深 */
::-webkit-scrollbar-thumb:hover {
    background: #8b9bb4;
    border: 2px solid transparent;
    background-clip: content-box;
}

/* ================= 后台管理：页签 ================= */
.admin-tabs {
    display: inline-flex;
    gap: 4px;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 16px;
}
.admin-tab-btn {
    border: none;
    background: transparent;
    padding: 8px 18px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all .18s ease;
}
.admin-tab-btn:hover { color: var(--primary); }
.admin-tab-btn.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 1px 4px rgba(15,23,42,.1);
}

/* ================= 后台管理：智能导入 ================= */
.smart-import-list {
    max-height: 430px;
    overflow-y: auto;
    border: 1px solid #e8edf5;
    border-radius: 10px;
    padding: 4px 12px;
}
.smart-import-item {
    padding: 12px 2px;
    border-bottom: 1px dashed #eef2f7;
}
.smart-import-item:last-child { border-bottom: none; }
.smart-import-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.smart-import-head-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    min-width: 0;
}
.smart-import-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.smart-import-analyze {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.analyze-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
}
.analyze-badge.add { color: #16a34a; background: #f0fdf4; border: 1px solid #dcfce7; }
.analyze-badge.update { color: #d97706; background: #fffbeb; border: 1px solid #fef3c7; }
.analyze-badge.same { color: #64748b; background: #f8fafc; border: 1px solid #e8edf5; }
.smart-import-strategy {
    margin: 10px 0 0 26px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.smart-import-strategy .strategy-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    flex-shrink: 0;
}
.smart-import-strategy select {
    height: 30px;
    font-size: 12px;
    border: 1px solid #d7dff0;
    border-radius: 7px;
    padding: 0 8px;
    background: #fff;
    color: var(--text-primary);
}
.smart-import-fields {
    flex-basis: 100%;
    background: #f8fafc;
    border: 1px solid #e8edf5;
    border-radius: 8px;
    padding: 10px 12px;
}
.smart-import-fields-title {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
}
.smart-import-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 6px 14px;
}
.field-chk {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
}
.smart-import-settings-tip {
    margin: 8px 0 0 26px;
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ================= 后台管理：条件编辑器（条件导出 / 条件删除） ================= */
.cond-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 14px 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cond-mod-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e8edf5;
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 4px;
}
.cond-mod-block { padding: 6px 0; }
.cond-mod-title {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cond-editor { display: flex; flex-direction: column; gap: 6px; }
.cond-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cond-row select {
    height: 32px;
    min-width: 130px;
    flex-shrink: 0;
    border: 1px solid #d7dff0;
    border-radius: 8px;
    padding: 0 8px;
    font-size: 13px;
    background: #fff;
    color: var(--text-primary);
}
.cond-row input {
    flex: 1;
    height: 32px;
    border: 1px solid #d7dff0;
    border-radius: 8px;
    padding: 0 10px;
    font-size: 13px;
    background: #fff;
    color: var(--text-primary);
}
.cond-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.cond-row .btn-text { flex-shrink: 0; }
.cond-count-tip {
    margin-top: 12px;
    font-size: 13px;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e8edf5;
    border-radius: 8px;
    padding: 10px 12px;
    line-height: 1.6;
}
.cond-count-tip b {
    color: #dc2626;
    font-size: 15px;
}
.cond-danger-tip {
    margin-top: 10px;
    font-size: 12px;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 8px 12px;
    line-height: 1.6;
}

