/* 商家/渠道跟进管理系统 - 自定义样式 */

/* 全局样式 */
body {
    font-family: 'Microsoft YaHei', 'SimHei', sans-serif;
    background-color: #f8f9fa;
}

/* 顶部导航栏 - 使用更柔和的蓝色 */
header {
    box-shadow: 0 2px 8px rgba(0,123,255,0.15);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 0.375rem;
}

/* 表格样式 */
.table {
    margin-bottom: 0;
}

.table thead {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 50%, #663399 100%);
}

/* 确保table-primary也有紫色背景 */
.table-primary thead {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 50%, #663399 100%) !important;
}

.table-primary th {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 50%, #663399 100%) !important;
    color: #ffffff !important;
    border-color: #663399 !important;
}

.table th {
    border-top: none;
    border-bottom: 2px solid #663399;
    font-weight: 600;
    font-size: 0.875rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 0.75rem;
}

.table td {
    vertical-align: middle;
    font-size: 0.875rem;
    padding: 0.75rem;
    border-bottom: 1px solid #f1f3f4;
}

/* 超期条目标黄 - 更柔和的警告色 */
.overdue-row {
    background: linear-gradient(90deg, #fff3cd 0%, #ffeaa7 100%) !important;
    animation: pulse 2s infinite;
    border-left: 4px solid #f39c12;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* 搜索框样式优化 */
.d-flex.position-relative input.form-control {
    padding-right: 35px; /* 为X按钮预留空间 */
}

.d-flex.position-relative .btn[style*="right:"] {
    z-index: 10;
    transition: color 0.2s;
}

.d-flex.position-relative .btn[style*="right:"]:hover {
    color: #dc3545 !important;
}

/* 响应式表格 */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.25rem 0.5rem;
    }
    
    .btn-group .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* 按钮样式 */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
}

/* 主要按钮渐变 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    border: none;
}

.btn-outline-primary {
    border-color: #667eea;
    color: #667eea;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: #fff;
}

/* 状态标签样式 */
.status-badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 成功状态 */
.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

/* 次要状态 */
.bg-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important;
}

/* 信息状态 */
.bg-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%) !important;
}

/* 危险状态 */
.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
}

/* Tab样式 */
.nav-tabs {
    border-bottom: 2px solid #e9ecef;
}

.nav-tabs .nav-link {
    border: 1px solid transparent;
    border-bottom: none;
    color: #6c757d;
    font-weight: 500;
    border-radius: 0.375rem 0.375rem 0 0;
    margin-bottom: -2px;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    border-color: #e9ecef #e9ecef transparent;
    background-color: #f8f9fa;
    color: #495057;
}

.nav-tabs .nav-link.active {
    color: #667eea;
    background-color: #fff;
    border-color: #667eea #667eea #fff;
    border-bottom: 2px solid #fff;
    margin-bottom: -2px;
    position: relative;
    z-index: 1;
}

.nav-pills .nav-link {
    border-radius: 0.25rem;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

/* 模态框样式 */
.modal-content {
    border: none;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border-radius: 0.5rem;
    backdrop-filter: blur(10px);
}

.modal-header {
    border-bottom: 2px solid #f1f3f4;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 0.5rem 0.5rem 0 0;
}

.modal-footer {
    border-top: 2px solid #f1f3f4;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 0 0 0.5rem 0.5rem;
}

.modal-body {
    padding: 2rem;
}

/* 表单样式 */
.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.form-control,
.form-select {
    border: 2px solid #e9ecef;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    padding: 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
    background-color: #fff;
}

/* 徽章样式 */
.badge {
    font-size: 0.7rem;
    font-weight: 500;
}

/* 警告框样式 */
.alert {
    border: none;
    border-radius: 0.375rem;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 空数据提示 */
.empty-data {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.empty-data i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 搜索框样式 */
.input-group .form-control {
    border-right: none;
}

.input-group .btn {
    border-left: none;
}

/* 响应式设计 */
@media (max-width: 576px) {
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .d-flex {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    .d-flex button {
        width: 100%;
    }
    
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .table-responsive {
        border-radius: 0.25rem;
        overflow: hidden;
    }
}

/* 打印样式 */
@media print {
    header,
    .btn,
    .modal,
    .alert {
        display: none !important;
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .container-fluid {
        max-width: 100%;
        padding: 0;
    }
}

/* 高亮搜索结果 */
.highlight {
    background-color: #ffeb3b;
    padding: 0.1rem 0.2rem;
    border-radius: 0.125rem;
}

/* 拖拽排序样式 */
.sortable-handle {
    cursor: move;
    color: #6c757d;
}

.sortable-handle:hover {
    color: #495057;
}

.ui-sortable-helper {
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* 工具提示样式 */
.tooltip {
    font-size: 0.75rem;
}

/* 进度条样式 */
.progress {
    height: 0.5rem;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

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

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