/* ============================================================================
 * 客户管理系统 - 自定义样式
 * ============================================================================
 * 
 * 设计理念：简洁现代，层次分明，看着不累
 * 配色方案：以 Bootstrap 5 默认色系为基础，做适度定制
 * ============================================================================ */

/* ==================================================================== */
/* 全局基础样式                                                           */
/* ==================================================================== */

:root {
    /* 自定义颜色变量 */
    --crm-primary: #4361ee;
    --crm-bg: #f5f7fa;
    --crm-card-radius: 0.625rem;
    --crm-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --crm-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.1);
}

body {
    background-color: var(--crm-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", 
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: #333;
}

/* 主内容区域，为固定顶部导航留出空间 */
.main-content {
    min-height: calc(100vh - 120px);
    padding-top: 70px;
}

/* ==================================================================== */
/* 导航栏样式                                                             */
/* ==================================================================== */

.navbar-dark.bg-primary {
    background-color: var(--crm-primary) !important;
}

.navbar .nav-link {
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border-radius: 0.375rem;
    padding: 0.5rem 0.875rem !important;
    margin: 0 0.125rem;
}

.navbar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    font-weight: 600;
}

/* ==================================================================== */
/* 卡片样式                                                               */
/* ==================================================================== */

.card {
    border-radius: var(--crm-card-radius);
    transition: box-shadow 0.2s ease;
}

.card.shadow-sm:hover {
    box-shadow: var(--crm-shadow-hover) !important;
}

.card-header {
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
}

/* ==================================================================== */
/* 统计卡片样式                                                           */
/* ==================================================================== */

.stat-card {
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* ==================================================================== */
/* 登录页面样式                                                           */
/* ==================================================================== */

.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-card {
    background: white;
    border-radius: 1rem;
    padding: 2.5rem 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.login-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.login-footer {
    border-top: 1px solid #f0f0f0;
    padding-top: 1rem;
}

/* ==================================================================== */
/* 时间线样式（跟进记录）                                                   */
/* ==================================================================== */

.timeline {
    position: relative;
}

.timeline-item {
    position: relative;
    padding-left: 1.75rem;
    padding-bottom: 1rem;
    border-left: 2px solid #e9ecef;
    margin-left: 0.5rem;
}

.timeline-item:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -7px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--crm-primary);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--crm-primary);
}

.timeline-content {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

/* ==================================================================== */
/* 提醒区域样式                                                           */
/* ==================================================================== */

.reminder-block {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
}

.reminder-item {
    padding: 0.5rem 0;
    border-bottom: 1px dashed #e9ecef;
}

.reminder-item:last-child {
    border-bottom: none;
}

/* ==================================================================== */
/* 报价单打印样式                                                         */
/* ==================================================================== */

.quote-document {
    max-width: 800px;
    margin: 0 auto;
}

.quote-paper {
    background: white;
    padding: 2rem;
    box-shadow: var(--crm-shadow);
    border-radius: 0.5rem;
}

.quote-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.quote-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.quote-footer {
    color: #999;
}

/* 打印样式 */
@media print {
    .navbar, .footer, .d-print-none {
        display: none !important;
    }
    
    .main-content {
        padding-top: 0;
    }
    
    body {
        background: white;
    }
    
    .quote-paper {
        box-shadow: none;
        padding: 0;
    }
    
    .quote-table {
        font-size: 12px;
    }
    
    @page {
        margin: 2cm;
    }
}

/* ==================================================================== */
/* 书签卡片样式                                                           */
/* ==================================================================== */

.bookmark-card {
    transition: all 0.2s ease;
    cursor: pointer;
}

.bookmark-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--crm-shadow-hover) !important;
}

.bookmark-card a {
    color: #333;
}

.bookmark-card a:hover {
    color: var(--crm-primary);
}

/* ==================================================================== */
/* 记事本卡片样式                                                         */
/* ==================================================================== */

.note-card {
    transition: all 0.2s ease;
    border-width: 1px !important;
    border-style: solid !important;
}

.note-card:hover {
    transform: translateY(-3px) rotate(1deg);
    box-shadow: var(--crm-shadow-hover) !important;
}

.note-card .card-text {
    max-height: 150px;
    overflow: hidden;
}

/* ==================================================================== */
/* 表格样式优化                                                           */
/* ==================================================================== */

.table > :not(caption) > * > * {
    padding: 0.625rem 0.75rem;
}

.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
}

.table td {
    vertical-align: middle;
}

/* ==================================================================== */
/* 按钮样式优化                                                           */
/* ==================================================================== */

.btn-primary {
    background-color: var(--crm-primary);
    border-color: var(--crm-primary);
}

.btn-primary:hover {
    background-color: #3a56d4;
    border-color: #3a56d4;
}

.btn-sm {
    font-size: 0.8rem;
}

/* ==================================================================== */
/* 分页样式                                                               */
/* ==================================================================== */

.pagination .page-link {
    color: var(--crm-primary);
    border-radius: 0.375rem;
    margin: 0 2px;
}

.pagination .page-item.active .page-link {
    background-color: var(--crm-primary);
    border-color: var(--crm-primary);
}

/* ==================================================================== */
/* 页脚样式                                                               */
/* ==================================================================== */

.footer {
    font-size: 0.8rem;
}

/* ==================================================================== */
/* 响应式调整                                                             */
/* ==================================================================== */

@media (max-width: 768px) {
    .main-content {
        padding-top: 60px;
    }
    
    .navbar .nav-link {
        padding: 0.375rem 0.5rem !important;
    }
    
    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }
    
    .quote-paper {
        padding: 1rem;
    }
}

/* ==================================================================== */
/* 工具类                                                                 */
/* ==================================================================== */

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
