/* Credit Risk & Lending Analysis Module - Professional Financial SaaS Version */

/* ===== MAIN WRAPPER ===== */
.credit-risk-lending-wrapper {
    padding: 1.5rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: #FFFFFF;
    border-radius: 6px;
    margin: 1.5rem 0;
    border: 1px solid #e5e7eb;

    max-width: 1200px; /* Maximum width for readability */
    margin: 0 auto; /* Center the content */}

.credit-risk-lending-wrapper .content-section-title {
    color: #1f2937;
    font-size: 1.5rem;
    margin: 0 0 1.5rem 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ===== MODULE ACTIONS ===== */
.credit-risk-lending-wrapper .module-actions-container {
    background: #f9fafb;
    border-radius: 6px;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
}

.credit-risk-lending-wrapper .module-action-btn {
    background: #FFFFFF;
    border: 1px solid #e5e7eb;
    color: #1f2937;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.credit-risk-lending-wrapper .module-action-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* ===== MODULE PLACEHOLDER ===== */
.credit-risk-lending-wrapper .module-placeholder {
    background: #f9fafb;
    color: #6b7280;
    border-radius: 6px;
    margin: 1.25rem 0;
    border: 1px solid #e5e7eb;
    padding: 1.25rem;
}

/* ===== TABS CONTAINER ===== */
.crl-tabs-container {
    background: #FFFFFF;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.crl-tabs-header {
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.crl-tab-button {
    transition: background 0.2s ease;
}

.crl-tab-button:hover {
    background: rgba(59, 130, 246, 0.05) !important;
}

.crl-tabs-content {
    background: #FFFFFF;
}

/* ===== CREDIT SCORE CARD ===== */
.crl-credit-score-card {
    background: #FFFFFF !important;
    transition: box-shadow 0.2s ease;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.crl-credit-score-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

/* ===== METRIC CARDS ===== */
.crl-metric-card {
    background: #FFFFFF !important;
    transition: box-shadow 0.2s ease;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.crl-metric-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

/* ===== TAB CONTENT ===== */
.crl-tab-content > div {
    background: #FFFFFF;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

/* ===== LOAN TERMS INTERFACE ===== */
.loan-general-section,
.loan-covenants-section,
.debt-accounts-section {
    background: #FFFFFF !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px;
}

.loan-terms-interface input {
    transition: all 0.2s ease;
    background: #FFFFFF;
    border: 1px solid #d1d5db;
    border-radius: 4px;
}

.loan-terms-interface input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.debt-rate-input,
.debt-payment-input {
    background: #FFFFFF !important;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
    font-variant-numeric: tabular-nums;
}

.debt-rate-input:focus,
.debt-payment-input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1) !important;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .credit-risk-lending-wrapper {
        padding: 1rem;
        margin: 1rem 0;
        border-radius: 6px;
    }

    .credit-risk-lending-wrapper .content-section-title {
        font-size: 1.25rem;
        margin-bottom: 1.25rem;
    }

    .crl-tabs-header {
        flex-direction: column;
    }

    .crl-tab-button {
        flex: none;
        padding: 0.75rem;
        text-align: left;
    }

    .crl-tabs-content {
        padding: 1rem;
    }

    .crl-credit-score-card {
        padding: 1rem !important;
    }

    .crl-metric-card {
        padding: 1rem !important;
    }

    .loan-general-section,
    .loan-covenants-section,
    .debt-accounts-section {
        padding: 0.75rem !important;
        margin-bottom: 1rem;
    }

    .loan-terms-interface {
        padding: 0.75rem;
        margin: 0.75rem 0;
    }
}

@media (max-width: 480px) {
    .credit-risk-lending-wrapper {
        padding: 0.75rem;
        margin: 0.75rem 0;
    }

    .credit-risk-lending-wrapper .content-section-title {
        font-size: 1.125rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .crl-credit-score-card,
    .crl-metric-card {
        padding: 0.75rem !important;
    }

    .crl-tabs-content {
        padding: 0.75rem;
    }

    /* Stack grid columns on mobile */
    .crl-tab-content div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    .loan-general-section div[style*="grid-template-columns"],
    .loan-covenants-section div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .credit-risk-lending-wrapper {
        background: white;
        border: 1px solid #d1d5db;
        margin: 0;
        padding: 1.25rem;
    }

    .credit-risk-lending-wrapper .content-section-title {
        color: #000;
    }

    .credit-risk-lending-wrapper .module-actions-container {
        display: none;
    }

    .crl-credit-score-card,
    .crl-metric-card,
    .crl-tab-content > div,
    .loan-general-section,
    .loan-covenants-section,
    .debt-accounts-section {
        background: white !important;
        border: 1px solid #d1d5db !important;
        page-break-inside: avoid;
    }

    .crl-tabs-container {
        background: transparent;
        border: none;
    }

    .crl-tabs-header {
        display: none;
    }

    .crl-tab-content {
        display: block !important;
        background: transparent;
        padding: 0;
    }
}

/* ===== ACCESSIBILITY ===== */
.credit-risk-lending-wrapper button:focus,
.loan-terms-interface input:focus,
.debt-rate-input:focus,
.debt-payment-input:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}
