/* ============================================================
   deals-v2.css — 成交转化2.0 样式
   ============================================================ */

/* ========== 通用卡片布局 ========== */
.deals-page {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

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

.deals-page-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a2e;
}

.deals-page-header .header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ========== 统计卡片 ========== */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stats-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
}

.stats-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stats-card-icon.blue { background: #e8f0fe; color: #4285f4; }
.stats-card-icon.green { background: #e6f4ea; color: #34a853; }
.stats-card-icon.orange { background: #fef3e0; color: #f9ab00; }
.stats-card-icon.red { background: #fce8e6; color: #ea4335; }
.stats-card-icon.purple { background: #f3e8fd; color: #9334e6; }
.stats-card-icon.teal { background: #e0f7fa; color: #00acc1; }

.stats-card-body {
    flex: 1;
    min-width: 0;
}

.stats-card-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.stats-card-value {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
}

.stats-card-value.small {
    font-size: 16px;
}

/* ========== 筛选栏 ========== */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    background: #fff;
    padding: 14px 18px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 16px;
}

.filter-bar input,
.filter-bar select {
    height: 36px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.filter-bar input:focus,
.filter-bar select:focus {
    border-color: #4285f4;
}

.filter-bar input {
    min-width: 180px;
}

.filter-bar select {
    min-width: 130px;
}

.filter-bar .btn {
    height: 36px;
    padding: 0 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: #4285f4;
    color: #fff;
}

.btn-primary:hover { background: #3367d6; }

.btn-success {
    background: #34a853;
    color: #fff;
}

.btn-success:hover { background: #2d9249; }

.btn-outline {
    background: #fff;
    color: #4285f4;
    border: 1px solid #4285f4;
}

.btn-outline:hover { background: #e8f0fe; }

.btn-sm {
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

.btn-danger {
    background: #ea4335;
    color: #fff;
}

.btn-danger:hover { background: #d33426; }

.btn-warning {
    background: #f9ab00;
    color: #fff;
}

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

/* ========== 数据表格 ========== */
.deals-table-wrap {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

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

.deals-table th {
    background: #f8f9fc;
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e8eaed;
    white-space: nowrap;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.deals-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.deals-table tr:hover td {
    background: #f8f9ff;
}

.deals-table .amount {
    font-weight: 600;
    color: #ea4335;
}

.deals-table .amount.paid {
    color: #34a853;
}

.deals-table .actions {
    display: flex;
    gap: 6px;
}

.deals-table .actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    transition: all 0.15s;
}

.deals-table .actions button:hover {
    background: #f0f0f0;
    color: #4285f4;
}

.deals-table .actions button.danger:hover {
    background: #fce8e6;
    color: #ea4335;
}

/* ========== 状态徽标 ========== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-paid { background: #e6f4ea; color: #1e7e34; }
.badge-partial { background: #fef3e0; color: #e67700; }
.badge-refunded { background: #fce8e6; color: #c5221f; }
.badge-pending { background: #e8eaed; color: #5f6368; }

.badge-critical { background: #fce8e6; color: #c5221f; }
.badge-warning { background: #fef3e0; color: #e67700; }
.badge-normal { background: #e6f4ea; color: #1e7e34; }

.badge-clue { background: #e8f0fe; color: #1967d2; }
.badge-old-student { background: #f3e8fd; color: #7627bb; }
.badge-referral { background: #e0f7fa; color: #007c91; }

/* ========== 分页 ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 16px;
}

.pagination button {
    height: 34px;
    min-width: 34px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: all 0.15s;
}

.pagination button:hover:not(:disabled) {
    background: #e8f0fe;
    border-color: #4285f4;
    color: #4285f4;
}

.pagination button.active {
    background: #4285f4;
    color: #fff;
    border-color: #4285f4;
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination .page-info {
    font-size: 13px;
    color: #666;
    margin: 0 4px;
}

/* ========== 弹窗表单 ========== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #4285f4;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-group .help-text {
    font-size: 11px;
    color: #999;
}

/* ========== 分析页面 ========== */
.analytics-page { padding: 20px; }

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

.chart-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.chart-card h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: #1a1a2e;
}

.chart-card canvas {
    max-height: 300px;
}

.charts-full {
    grid-column: 1 / -1;
}

/* ========== 导出页面 ========== */
.export-page {
    padding: 20px;
}

.export-card {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.export-card h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #1a1a2e;
}

.export-card p {
    margin: 0 0 16px 0;
    color: #666;
    font-size: 13px;
}

.export-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ========== 续费预警横幅 ========== */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
}

.alert-banner.critical { background: #fce8e6; color: #c5221f; border: 1px solid #f5c6c2; }
.alert-banner.warning { background: #fef3e0; color: #e67700; border: 1px solid #fce0a8; }

/* ========== 满意度星级 ========== */
.stars {
    display: flex;
    gap: 2px;
}

.stars i {
    color: #f9ab00;
    font-size: 14px;
}

.stars i.empty {
    color: #ddd;
}

/* ========== 空状态 ========== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state h3 {
    font-size: 18px;
    color: #666;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 16px;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-row {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .deals-table {
        font-size: 12px;
    }

    .deals-table th,
    .deals-table td {
        padding: 8px 10px;
    }
}
