/* CRM系统主样式文件 */

/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

/* 应用容器 */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.app-title {
    font-size: 24px;
    font-weight: 600;
}

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

.user-role {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.user-name {
    font-size: 16px;
    font-weight: 500;
}

/* 今日统计 */
.today-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.15);
    padding: 15px;
    border-radius: 12px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 4px;
}

.stat-divider {
    font-size: 24px;
    opacity: 0.7;
}

/* 主内容区 */
.app-main {
    flex: 1;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* 导航标签 */
.app-tabs {
    display: flex;
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tab-btn {
    flex: 1;
    padding: 16px;
    background: white;
    border: none;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: #fafafa;
}

.tab-btn.active {
    color: #1890ff;
    border-bottom-color: #1890ff;
    font-weight: 600;
}

.tab-icon {
    font-size: 18px;
}

.tab-text {
    font-size: 15px;
}

/* 标签内容 */
.tab-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.tab-pane {
    display: none;
    padding: 0;
}

.tab-pane.active {
    display: block;
}

/* 区域头部 */
.section-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

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

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd6, #6a4198);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #d9d9d9;
}

.btn-success {
    background: #52c41a;
    color: white;
}

.btn-success:hover {
    background: #389e0d;
}

.btn-approve {
    background: #52c41a;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.btn-approve:hover {
    background: #389e0d;
}

.btn-reject {
    background: #ff4d4f;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.btn-reject:hover {
    background: #d9363e;
}

.btn-warning {
    background: #fa8c16;
    color: white;
}

.btn-warning:hover {
    background: #d46b08;
}

/* 客户列表 */
.customer-list {
    padding: 20px;
}

.customer-card {
    background: #fafafa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #1890ff;
    transition: all 0.2s ease;
}

.customer-card:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.customer-name {
    font-size: 18px;
    font-weight: 600;
    color: #1890ff;
}

.customer-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-sea {
    background: #e6f7ff;
    color: #1890ff;
}

.status-following {
    background: #f6ffed;
    color: #52c41a;
}

.status-wechat {
    background: #f0f7ff;
    color: #722ed1;
}

.status-visited {
    background: #fff7e6;
    color: #fa8c16;
}

.customer-info {
    margin-bottom: 15px;
}

.info-row {
    display: flex;
    margin-bottom: 6px;
    font-size: 14px;
}

.info-label {
    width: 80px;
    color: #666;
}

.info-value {
    flex: 1;
    color: #333;
}

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

/* 统计容器 */
.stats-container {
    padding: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    color: #1890ff;
    margin-bottom: 8px;
}

.stat-card .label {
    font-size: 14px;
    color: #666;
}

/* 加载状态 */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #1890ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* 弹窗样式 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 结果选项 */
.result-options {
    display: grid;
    gap: 10px;
}

.result-option {
    padding: 15px;
    border: 2px solid #f0f0f0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.result-option:hover {
    border-color: #1890ff;
    background: #f0f7ff;
}

.result-option.selected {
    border-color: #1890ff;
    background: #e6f7ff;
}

.result-icon {
    font-size: 20px;
    margin-right: 10px;
}

.result-text {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.result-desc {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .app-header {
        padding: 15px;
    }
    
    .app-title {
        font-size: 20px;
    }
    
    .today-stats {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .app-main {
        padding: 15px;
    }
    
    .tab-btn {
        padding: 12px;
        font-size: 14px;
    }
    
    .section-header {
        padding: 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .section-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .customer-card {
        padding: 15px;
    }
    
    .customer-actions {
        flex-direction: column;
    }
    
    .customer-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .app-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        padding: 15px;
        border-bottom: none;
        border-right: 3px solid transparent;
    }
    
    .tab-btn.active {
        border-bottom: none;
        border-right-color: #1890ff;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== 员工明细行内展开卡片 ===== */
.emp-detail-card {
    background: white;
    border-radius: 12px;
    margin: 10px 16px 14px 16px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
    border: none;
    overflow: hidden;
    animation: detailSlideDown 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes detailSlideDown {
    from { opacity: 0; transform: translateY(-12px) scaleY(0.95); max-height: 0; }
    to { opacity: 1; transform: translateY(0) scaleY(1); max-height: 300px; }
}

.emp-detail-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: 0.5px;
}

.btn-close-detail {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.btn-close-detail:hover {
    background: rgba(255,255,255,0.4);
    transform: rotate(90deg);
}

.emp-detail-body {
    padding: 16px 18px;
}

.emp-detail-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.eds-item {
    text-align: center;
    background: #f8f9ff;
    border-radius: 10px;
    padding: 14px 8px;
    border: 1px solid #eeeaff;
    transition: all 0.2s;
}

.eds-item:hover {
    background: #eef0ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.eds-value {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    line-height: 1.2;
}

.eds-label {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    font-weight: 500;
}

.emp-calls-section {
    margin-top: 14px;
    padding: 0 18px 16px 18px;
}

.emp-calls-section h4 {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
    padding-left: 2px;
    font-weight: 600;
}

.emp-detail-call-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #fafbff;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    border: 1px solid #f0f2ff;
    transition: all 0.2s;
}

.emp-detail-call-item:hover {
    background: #f0f3ff;
    border-color: #dde0ff;
}

.emp-detail-call-item:last-child {
    margin-bottom: 0;
}

.call-status-badge {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

/* 公司卡片表格美化 */
.company-card {
    background: white;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
    border: 1px solid #f0f0f0;
    transition: all 0.3s;
}

.company-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.company-card-header {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eeeaff;
}

.company-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #444;
}

.company-card-subtitle {
    font-size: 12px;
    color: #888;
    background: white;
    padding: 3px 12px;
    border-radius: 20px;
    border: 1px solid #e8e8ff;
}

.employee-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.employee-table thead th {
    background: #fafbfc;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: #666;
    font-size: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.employee-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid #f5f5f5;
    vertical-align: middle;
}

.employee-table tbody tr:last-child td {
    border-bottom: none;
}

.employee-table tbody tr:hover {
    background: #fafbff;
}

.role-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.role-badge.role-employee {
    background: #e6f7ff;
    color: #1890ff;
}