/* CRM 数据看板 - 自定义样式 */

body {
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

/* KPI 卡片 */
.kpi-card {
    transition: transform 0.15s, box-shadow 0.15s;
}
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.1) !important;
}

.kpi-label {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}
.kpi-unit {
    font-size: 0.8rem;
    font-weight: 400;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* 钻石特殊样式 */
.kpi-value.diamond {
    color: #8b5cf6;
}
.diamond-icon {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* 表格底部分页：居中 */
.pagination-footer {
    text-align: center;
    padding: 1rem 0 0.5rem;
}
.pagination-footer .page-meta {
    display: block;
    margin-bottom: 0.5rem;
    color: #6c757d;
    font-size: 0.875rem;
}
.pagination-footer .pagination {
    justify-content: center;
}

.kpi-vip-list {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}
.vip-item {
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}
.vip-item.diamond { color: #8b5cf6; }
.vip-item.platinum { color: #a78bfa; }
.vip-item.gold { color: #f59e0b; }
.vip-item i { font-size: 0.75rem; margin-right: 2px; }

/* 紫色图标 */
.bg-purple { background-color: #8b5cf6 !important; }
.text-purple { color: #8b5cf6 !important; }

/* 卡片头部 */
.card-header .card-title {
    font-weight: 600;
    font-size: 0.95rem;
}

/* 表格 */
.table th {
    font-weight: 600;
    font-size: 0.85rem;
    color: #6c757d;
    white-space: nowrap;
}
.table td {
    font-size: 0.9rem;
    vertical-align: middle;
}
.table code {
    font-size: 0.8rem;
    color: #495057;
}

/* 等级颜色 */
.level-diamond { color: #8b5cf6; font-weight: 600; }
.level-platinum { color: #a78bfa; font-weight: 600; }
.level-gold { color: #f59e0b; font-weight: 600; }
.level-normal { color: #94a3b8; }

/* 响应式调整 */
@media (max-width: 768px) {
    .kpi-value {
        font-size: 1.3rem;
    }
    .kpi-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

/* ========== 标签样式 ========== */
.tag-badge {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.tag-badge .btn-close {
    font-size: 0.55rem;
    padding: 0;
    margin-left: 2px;
    filter: none;
    opacity: 0.6;
}
.tag-badge .btn-close:hover {
    opacity: 1;
}

/* ========== 客户列表 ========== */
.table td a code {
    color: #4e79a7;
}
.table td a code:hover {
    text-decoration: underline;
}

/* 等级颜色扩展 */
.level-diamond { color: #8b5cf6; font-weight: 600; }
.level-platinum { color: #a78bfa; font-weight: 600; }
.level-gold { color: #f59e0b; font-weight: 600; }
.level-normal { color: #94a3b8; }

/* ========== 分群筛选器 ========== */
#filterBuilder .form-select,
#filterBuilder .form-control {
    font-size: 0.85rem;
}

/* ========== 客户详情 ========== */
.customer-info td {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
}
.customer-info td:first-child {
    color: #6c757d;
    white-space: nowrap;
}

/* ========== 卡片可点击 ========== */
a .kpi-card {
    transition: transform 0.15s, box-shadow 0.15s;
}
a .kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.12) !important;
}
a .kpi-value {
    color: inherit;
}
