/* CRM页面专用样式 */

/* 子导航样式 */
.sub-nav {
    background-color: #2196F3;
    padding: 0.5rem 0;
}

.sub-nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    flex-wrap: wrap;
}

.sub-nav ul li {
    margin: 0 0.5rem;
}

.sub-nav ul li a {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
}

.sub-nav ul li a:hover {
    text-decoration: underline;
}

/* 客户列表样式 */
#customer-list .filter-controls,
#prospect-list .filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    align-items: end;
}

#customer-list .filter-controls label,
#prospect-list .filter-controls label {
    font-weight: bold;
    margin-right: 0.5rem;
}

#customer-list .filter-controls input,
#customer-list .filter-controls select,
#prospect-list .filter-controls input,
#prospect-list .filter-controls select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 1rem;
}

#customer-list .filter-controls button,
#prospect-list .filter-controls button {
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

#customer-list .filter-controls button:hover,
#prospect-list .filter-controls button:hover {
    background-color: #1976D2;
}

#customer-list .filter-controls button#reset-filters,
#prospect-list .filter-controls button#reset-prospect-filters {
    background-color: #6c757d;
}

#customer-list .filter-controls button#reset-filters:hover,
#prospect-list .filter-controls button#reset-prospect-filters:hover {
    background-color: #5a6268;
}

.table-container {
    overflow-x: auto;
}

#customer-list table,
#prospect-list table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

#customer-list th, 
#customer-list td,
#prospect-list th, 
#prospect-list td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

#customer-list th,
#prospect-list th {
    background-color: #2196F3;
    color: white;
    position: sticky;
    top: 0;
}

#customer-list tr:nth-child(even),
#prospect-list tr:nth-child(even) {
    background-color: #f2f2f2;
}

#customer-list tr:hover,
#prospect-list tr:hover {
    background-color: #e3f2fd;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: bold;
    text-align: center;
}

.status-new {
    background-color: #fff3cd;
    color: #856404;
}

.status-contacted {
    background-color: #cce5ff;
    color: #004085;
}

.status-converted {
    background-color: #d4edda;
    color: #155724;
}

.status-closed {
    background-color: #f8d7da;
    color: #721c24;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-buttons button {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-edit {
    background-color: #17a2b8;
    color: white;
}

.btn-delete {
    background-color: #dc3545;
    color: white;
}

.btn-view {
    background-color: #28a745;
    color: white;
}

.btn-convert {
    background-color: #ffc107;
    color: black;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.pagination button {
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

.pagination button:hover {
    background-color: #1976D2;
}

.pagination button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* 表单样式 */
#add-customer form,
#add-prospect form {
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-actions button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.form-actions button[type="submit"] {
    background-color: #2196F3;
    color: white;
}

.form-actions button[type="submit"]:hover {
    background-color: #1976D2;
}

#cancel-edit,
#cancel-prospect-edit {
    background-color: #6c757d;
    color: white;
}

#cancel-edit:hover,
#cancel-prospect-edit:hover {
    background-color: #5a6268;
}

/* 分析部分样式 */
.analysis-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.analysis-card {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 4px solid #2196F3;
}

.analysis-card h3 {
    color: #666;
    margin-bottom: 1rem;
}

.analysis-number {
    font-size: 2rem;
    font-weight: bold;
    color: #2196F3;
    margin: 0.5rem 0;
}

.analysis-number span {
    font-size: 1rem;
    color: #999;
}

.chart-container {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.chart-placeholder {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    border-radius: 4px;
    border: 2px dashed #ddd;
}

.chart-placeholder p {
    color: #999;
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        min-width: 100%;
    }
    
    #customer-list .filter-controls,
    #prospect-list .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    #customer-list .filter-controls input,
    #customer-list .filter-controls select,
    #customer-list .filter-controls button,
    #prospect-list .filter-controls input,
    #prospect-list .filter-controls select,
    #prospect-list .filter-controls button {
        margin-bottom: 0.5rem;
        margin-right: 0;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .analysis-container {
        grid-template-columns: 1fr;
    }
    
    .sub-nav ul {
        flex-direction: column;
        align-items: center;
    }
    
    .sub-nav ul li {
        margin: 0.25rem 0;
    }
}