/* CRM & Quote History Styles */

/* Quote History Page */
.quote-history-page,
.crm-receivables-page {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 28px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-card.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card.danger {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
}

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

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* Quotes Table */
.quotes-table-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.quotes-table {
    width: 100%;
    border-collapse: collapse;
}

.quotes-table thead {
    background: rgba(255, 255, 255, 0.1);
}

.quotes-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.quotes-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.quotes-table tbody tr {
    transition: background 0.2s ease;
}

.quotes-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Status Badges */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-badge.pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.status-badge.sold {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.status-badge.cancelled {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.status-badge.success {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.status-badge.warning {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.status-badge.danger {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

/* Action Buttons */
.actions-cell {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.action-btn.small {
    padding: 6px 12px;
    font-size: 12px;
}

.action-btn.success-btn {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.action-btn.success-btn:hover {
    background: #4caf50;
    color: white;
}

.action-btn.danger-btn {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.action-btn.danger-btn:hover {
    background: #f44336;
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 64px;
    opacity: 0.3;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

/* CRM Receivables */
.receivables-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.customer-receivables-card {
    padding: 25px;
    border-radius: 12px;
}

.customer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.customer-info h3 {
    font-size: 22px;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.customer-details {
    color: var(--text-secondary);
    font-size: 14px;
}

.customer-totals {
    display: flex;
    gap: 30px;
}

.total-item {
    text-align: right;
}

.total-item .label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.total-item .value {
    display: block;
    font-size: 20px;
    font-weight: bold;
    color: var(--text-primary);
}

.total-item.success .value {
    color: #4caf50;
}

.total-item.danger .value {
    color: #f44336;
}

/* Mini Table */
.mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.mini-table th {
    padding: 10px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mini-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.text-success {
    color: #4caf50 !important;
}

.text-danger {
    color: #f44336 !important;
}

.text-muted {
    color: var(--text-secondary) !important;
}

/* Payment Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--card-bg, #0f172a);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-modal-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal-body {
    padding: 25px;
}

.payment-info {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.payment-info p {
    margin: 8px 0;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Proforma PDF → Cari modal (şık kart) */
.orbit-proforma-overlay {
    padding: 16px;
    align-items: center;
    justify-content: center;
    background: rgba(6, 10, 24, 0.78) !important;
    backdrop-filter: blur(10px);
}

.orbit-proforma-modal-card {
    width: 100%;
    max-width: 520px;
    border-radius: 18px;
    border: 1px solid rgba(0, 243, 255, 0.14);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 24px 48px rgba(0, 0, 0, 0.45),
        0 0 80px rgba(0, 243, 255, 0.07);
    background: linear-gradient(165deg, #111827 0%, #0b1220 48%, #0f172a 100%) !important;
    overflow: hidden;
}

#proforma-pdf-modal .modal-header {
    padding: 18px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    align-items: flex-start;
    gap: 12px;
}

#proforma-pdf-modal .modal-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.35;
    flex: 1;
    min-width: 0;
    color: #f1f5f9;
}

#proforma-pdf-modal .modal-header h3 i {
    color: #00f3ff;
    margin-right: 8px;
    vertical-align: -2px;
}

#proforma-pdf-modal .close-modal-btn {
    flex-shrink: 0;
    margin-top: -2px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.orbit-proforma-lead {
    font-size: 13px;
    color: #94a3b8;
    margin: 0 0 14px;
    line-height: 1.5;
}

.proforma-pdf-file-wrap {
    border: 1px dashed rgba(0, 243, 255, 0.28);
    border-radius: 12px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.22);
}

#proforma-pdf-modal .proforma-pdf-file-wrap .fusion-input[type="file"] {
    width: 100%;
    font-size: 13px;
    padding: 10px;
    border-radius: 10px;
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(15, 23, 42, 0.85);
    color: #e2e8f0;
}

.proforma-pdf-preview-box {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.22);
    font-size: 12px;
    color: #cbd5e1;
    line-height: 1.5;
}

.proforma-pdf-preview-box:empty {
    display: none;
}

.proforma-pdf-error-box {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.38);
    color: #fecaca !important;
    font-size: 13px;
    line-height: 1.45;
}

.orbit-proforma-footer {
    padding: 16px 20px 20px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    justify-content: stretch !important;
    gap: 10px !important;
}

.orbit-proforma-footer .fusion-btn {
    flex: 1;
    border-radius: 10px;
    font-weight: 600;
    padding: 12px 16px;
}

.orbit-proforma-btn-secondary {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #e2e8f0 !important;
}

.orbit-proforma-btn-primary {
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.38);
}

.orbit-proforma-btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Notification */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .customer-header {
        flex-direction: column;
        gap: 20px;
    }

    .customer-totals {
        width: 100%;
        justify-content: space-between;
    }

    .quotes-table,
    .mini-table {
        font-size: 12px;
    }

    .quotes-table th,
    .quotes-table td,
    .mini-table th,
    .mini-table td {
        padding: 10px 5px;
    }

    .actions-cell {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }
}