/* ==========================================================================
   Credit Intelligence Module Styles
   Scoped with .credit-app to avoid conflicts with existing styles
   ========================================================================== */

/* CSS Isolation - Normalize box-sizing and prevent global style conflicts */
.credit-app,
.credit-app *,
.credit-app *::before,
.credit-app *::after {
    box-sizing: border-box;
}

/* Reset specific inherited properties that commonly cause conflicts */
.credit-app {
    /* Prevent inherited text properties from global styles */
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    word-spacing: normal;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    line-height: 1.5;
}

/* CSS Variables - Scoped to credit-app */
.credit-app {
    --ci-primary: #4f46e5;
    --ci-primary-light: #e0e7ff;
    --ci-bg-body: #f1f5f9;
    --ci-bg-card: #ffffff;
    --ci-border: #e2e8f0;
    --ci-text-main: #0f172a;
    --ci-text-muted: #64748b;
    --ci-danger: #ef4444;
    --ci-danger-bg: #fee2e2;
    --ci-success: #10b981;
    --ci-success-bg: #d1fae5;
    --ci-warning: #f59e0b;
    --ci-warning-bg: #fef3c7;

    font-family: 'Inter', sans-serif;
    background-color: var(--ci-bg-body);
    color: var(--ci-text-main);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
    width: 100%;
}

/* Override Radzen body padding when inside credit-app */
.rz-body:has(.credit-app) {
    padding: 0.5rem;
}

/* Fallback for browsers that don't support :has() */
.credit-app {
    margin: -0.5rem;
    padding: 0.5rem;
}

/* Prevent nested credit-app from causing layout issues */
.credit-app .credit-app {
    margin: 0;
    padding: 0;
    min-height: auto;
    background-color: transparent;
}

/* Ensure proper width inheritance for all elements */
.credit-app .app-container,
.credit-app .dash-grid,
.credit-app .quote-grid,
.credit-app .fin-grid,
.credit-app .hist-grid,
.credit-app .lab-grid,
.credit-app .dash-card,
.credit-app .quote-card,
.credit-app .fin-card,
.credit-app .hist-card,
.credit-app .lab-card,
.credit-app .card,
.credit-app header,
.credit-app .tabs-container,
.credit-app #main-content-area {
    width: auto;
    min-width: 0;
}

/* Universal grid column classes for all grids */
.credit-app .col-3 {
    grid-column: span 3;
}

.credit-app .col-4 {
    grid-column: span 4;
}

.credit-app .col-6 {
    grid-column: span 6;
}

.credit-app .col-8 {
    grid-column: span 8;
}

.credit-app .col-12 {
    grid-column: span 12;
}

.credit-app .app-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 12px;
    width: 100%;
    overflow-x: hidden;
}

.credit-app header {
    background: var(--ci-bg-card);
    padding: 24px 32px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    border: 1px solid var(--ci-border);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.credit-app .brand-section h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.credit-app .status-badge {
    background: var(--ci-warning-bg);
    color: #92400e;
    padding: 8px 16px;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    border: 1px solid #fcd34d;
}

.credit-app .tabs-container {
    border-bottom: 1px solid var(--ci-border);
    margin-bottom: 16px;
    display: flex;
    gap: 4px;
    padding-left: 4px;
    flex-wrap: wrap;
    overflow: hidden;
}

.credit-app .tabs-container .tab-btn {
    background: none;
    border: none;
    padding: 10px 10px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ci-text-muted);
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color 0.2s;
    flex: 0 1 auto;
    text-align: center;
}

.credit-app .tabs-container .tab-btn:hover {
    color: var(--ci-primary);
}

.credit-app .tabs-container .tab-btn.active {
    color: var(--ci-primary);
    font-weight: 600;
}

.credit-app .tabs-container .tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--ci-primary);
}

.credit-app #main-content-area {
    min-height: 400px;
}

.credit-app .fade-in {
    animation: ci-fadeIn 0.3s ease-out;
}

@keyframes ci-fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pills */
.credit-app .pill {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.credit-app .pill-blue {
    background: var(--ci-primary-light);
    color: var(--ci-primary);
}

.credit-app .pill-gray {
    background: #f1f5f9;
    color: #475569;
}

.credit-app .pill-red {
    background: var(--ci-danger-bg);
    color: #991b1b;
}

.credit-app .pill-green {
    background: var(--ci-success-bg);
    color: #065f46;
}

/* Responsive - Tablet */
@media (max-width: 768px) {
    .credit-app .app-container {
        margin: 20px auto;
        padding: 0 12px;
    }

    .credit-app header {
        flex-direction: column;
        padding: 16px 20px;
        gap: 16px;
        text-align: center;
        margin-bottom: 20px;
    }

    .credit-app .brand-section h1 {
        font-size: 1rem;
        justify-content: center;
    }

    .credit-app .status-badge {
        font-size: 0.75rem;
        padding: 6px 12px;
    }

    .credit-app .tabs-container {
        gap: 16px;
        margin-bottom: 20px;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }

    .credit-app .tab-btn {
        font-size: 0.875rem;
        padding: 10px 4px;
    }

    /* Make all column classes full width on tablet */
    .credit-app .col-3,
    .credit-app .col-4,
    .credit-app .col-6,
    .credit-app .col-8,
    .credit-app .col-12 {
        grid-column: span 12;
    }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
    .credit-app .app-container {
        padding: 0 8px;
    }

    .credit-app header {
        padding: 12px 16px;
        border-radius: 12px;
    }

    .credit-app .brand-section h1 {
        font-size: 0.9rem;
        gap: 6px;
    }

    .credit-app .status-badge {
        font-size: 0.7rem;
        padding: 5px 10px;
    }

    .credit-app .tabs-container {
        gap: 12px;
    }

    .credit-app .tab-btn {
        font-size: 0.8rem;
        padding: 8px 4px;
    }
}

/* ==========================================================================
   Dashboard Tab Styles
   ========================================================================== */
.credit-app .dash-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    width: 100%;
}

.credit-app .dash-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.credit-app .kpi-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.credit-app .kpi-val {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
    letter-spacing: -0.02em;
}

.credit-app .kpi-delta {
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.credit-app .delta-up {
    color: #10b981;
}

.credit-app .delta-warn {
    color: #f59e0b;
}

.credit-app .decision-opt {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    background: #fff;
    margin-bottom: 15px;
}

.credit-app .decision-opt:hover {
    border-color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

.credit-app .decision-opt.selected {
    border: 2px solid #4f46e5;
    background: #eff6ff;
}

.credit-app .ai-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: #4f46e5;
    color: white;
    font-size: 0.65rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.credit-app .opt-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
    color: #0f172a;
}

.credit-app .opt-desc {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.4;
}

.credit-app .opt-link {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 10px;
    display: inline-block;
    color: #4f46e5;
}

/* Dashboard Responsive */
@media (max-width: 768px) {
    .credit-app .dash-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .credit-app .col-3,
    .credit-app .col-4,
    .credit-app .col-8 {
        grid-column: span 12;
    }

    .credit-app .dash-card {
        padding: 16px;
    }

    .credit-app .kpi-val {
        font-size: 1.75rem;
    }

    .credit-app .kpi-title {
        font-size: 0.7rem;
    }

    .credit-app .kpi-delta {
        font-size: 0.8rem;
    }

    .credit-app .decision-opt {
        padding: 16px;
        margin-bottom: 12px;
    }

    .credit-app .opt-title {
        font-size: 0.95rem;
    }

    .credit-app .opt-desc {
        font-size: 0.8rem;
    }

    .credit-app .ai-badge {
        font-size: 0.6rem;
        padding: 3px 6px;
        top: -8px;
        right: 12px;
    }
}

/* ==========================================================================
   Flyout Panel Styles
   ========================================================================== */
.credit-app .flyout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.credit-app .flyout-overlay.open {
    opacity: 1;
    visibility: visible;
}

.credit-app .flyout-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 50vw;
    max-width: 100%;
    height: 100%;
    background: white;
    z-index: 1101;
    box-shadow: -10px 0 25px rgba(0, 0, 0, 0.1);
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    visibility: hidden;
}

.credit-app .flyout-panel.open {
    right: 0;
    visibility: visible;
}

.credit-app .flyout-header {
    padding: 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.credit-app .flyout-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 5px 0 0 0;
}

.credit-app .flyout-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.credit-app .flyout-close-btn {
    border: none;
    background: none;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    color: #64748b;
}

.credit-app .flyout-close-btn:hover {
    color: #0f172a;
}

/* Flyout Responsive */
@media (max-width: 768px) {
    .credit-app .flyout-panel {
        width: 100%;
        right: -100%;
    }

    .credit-app .flyout-header {
        padding: 16px;
    }

    .credit-app .flyout-body {
        padding: 16px;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .credit-app .flyout-panel {
        width: 60vw;
    }
}

/* ==========================================================================
   Quote Tab Styles
   ========================================================================== */
.credit-app .quote-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    width: 100%;
}

.credit-app .quote-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.credit-app .quote-details-box {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f1f5f9;
}

.credit-app .q-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #e2e8f0;
}

.credit-app .q-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.credit-app .q-label {
    color: #64748b;
    font-size: 0.9rem;
}

.credit-app .q-value {
    font-weight: 600;
    color: #0f172a;
}

.credit-app .q-highlight {
    color: #4f46e5;
    font-weight: 700;
    font-size: 1.1rem;
}

.credit-app .risk-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
    margin-top: 10px;
}

.credit-app .risk-badge {
    background: #fee2e2;
    color: #991b1b;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 8px;
}

.credit-app .risk-desc {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
}

.credit-app .summary-stats {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    justify-content: center;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.credit-app .stat-item {
    text-align: center;
}

.credit-app .stat-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.credit-app .stat-val {
    font-weight: 700;
    font-size: 1.2rem;
    color: #0f172a;
}

.credit-app .stat-total {
    color: #4f46e5;
}

.credit-app .q-pill {
    background: #e0e7ff;
    color: #4f46e5;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Quote Tab Responsive */
@media (max-width: 768px) {
    .credit-app .quote-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .credit-app .quote-card {
        padding: 16px;
    }

    .credit-app .q-row {
        margin-bottom: 10px;
        padding-bottom: 10px;
    }

    .credit-app .summary-stats {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .credit-app .quote-card {
        padding: 12px;
    }

    .credit-app .q-highlight {
        font-size: 1rem;
    }
}

/* ==========================================================================
   Assets Tab Styles
   ========================================================================== */
.credit-app .assets-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.credit-app .assets-table th {
    text-align: left;
    padding: 12px 16px;
    color: #64748b;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.credit-app .assets-table td {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
    color: #0f172a;
    vertical-align: middle;
}

.credit-app .row-interactive {
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.credit-app .row-interactive:hover {
    background-color: #f8fafc;
}

.credit-app .row-interactive:hover td:first-child {
    color: #4f46e5;
    font-weight: 600;
}

.credit-app .equity-val {
    font-weight: 600;
    color: #10b981;
    background: #d1fae5;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.credit-app .card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Assets Tab Responsive */
@media (max-width: 768px) {
    .credit-app .card {
        padding: 16px;
    }

    .credit-app .assets-table {
        font-size: 0.85rem;
    }

    .credit-app .assets-table th,
    .credit-app .assets-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .credit-app .card {
        padding: 12px;
    }

    .credit-app .assets-table {
        font-size: 0.8rem;
    }

    .credit-app .assets-table th,
    .credit-app .assets-table td {
        padding: 8px 6px;
    }

    .credit-app .assets-table th:nth-child(2),
    .credit-app .assets-table td:nth-child(2) {
        display: none;
    }
}

/* ==========================================================================
   Financial Tab Styles
   ========================================================================== */
.credit-app .fin-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    width: 100%;
}

.credit-app .fin-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.credit-app .cf-metric {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #e2e8f0;
}

.credit-app .cf-label {
    font-size: 0.85rem;
    color: #64748b;
}

.credit-app .cf-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #10b981;
}

.credit-app .debt-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.credit-app .debt-table th {
    text-align: left;
    padding: 12px;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.credit-app .debt-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
    color: #0f172a;
}

.credit-app .debt-new-row {
    background: #f8fafc;
}

.credit-app .st-pill {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
}

.credit-app .st-green {
    background: #d1fae5;
    color: #065f46;
}

.credit-app .st-red {
    background: #fee2e2;
    color: #991b1b;
}

.credit-app .st-gray {
    background: #e2e8f0;
    color: #475569;
}

.credit-app .st-sim {
    background: #e0e7ff;
    color: #4f46e5;
}

.credit-app .sim-insight {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 0.85rem;
    color: #166534;
    line-height: 1.5;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

/* Financial Tab Responsive */
@media (max-width: 768px) {
    .credit-app .fin-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .credit-app .fin-card {
        padding: 16px;
    }

    .credit-app .debt-table {
        font-size: 0.85rem;
    }

    .credit-app .debt-table th,
    .credit-app .debt-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .credit-app .fin-card {
        padding: 12px;
    }

    .credit-app .debt-table {
        font-size: 0.8rem;
    }

    .credit-app .debt-table th,
    .credit-app .debt-table td {
        padding: 8px 6px;
    }

    .credit-app .cf-value {
        font-size: 1.25rem;
    }
}

/* ==========================================================================
   History Tab Styles
   ========================================================================== */
.credit-app .hist-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    width: 100%;
}

.credit-app .hist-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    height: 100%;
}

.credit-app .score-display {
    text-align: center;
    padding: 20px;
}

.credit-app .score-val {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 5px;
    color: #f59e0b;
}

.credit-app .score-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.credit-app .hist-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 10px;
}

.credit-app .hist-table th {
    text-align: left;
    padding: 12px 16px;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.credit-app .hist-table td {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
    color: #0f172a;
    vertical-align: middle;
}

.credit-app .hist-table tr:hover {
    background-color: #f8fafc;
    cursor: pointer;
}

.credit-app .status-dot {
    height: 8px;
    width: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.credit-app .st-normal {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-block;
}

.credit-app .st-warn {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-block;
}

.credit-app .st-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-block;
}

.credit-app .progress-bg {
    background: #f1f5f9;
    height: 6px;
    border-radius: 3px;
    width: 100px;
    margin-top: 6px;
    overflow: hidden;
}

.credit-app .progress-fill {
    height: 100%;
    border-radius: 3px;
}

/* History Tab Responsive */
@media (max-width: 768px) {
    .credit-app .hist-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .credit-app .hist-card {
        padding: 16px;
    }

    .credit-app .score-val {
        font-size: 3rem;
    }

    .credit-app .hist-table {
        font-size: 0.85rem;
    }

    .credit-app .hist-table th,
    .credit-app .hist-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .credit-app .hist-card {
        padding: 12px;
    }

    .credit-app .score-val {
        font-size: 2.5rem;
    }

    .credit-app .hist-table {
        font-size: 0.8rem;
    }

    .credit-app .hist-table th,
    .credit-app .hist-table td {
        padding: 8px 6px;
    }
}

/* ==========================================================================
   Laboral Tab Styles
   ========================================================================== */
.credit-app .lab-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
    width: 100%;
}

.credit-app .lab-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.credit-app .co-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
}

.credit-app .co-role {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 4px;
    display: block;
}

.credit-app .co-name {
    margin: 0;
    font-size: 1.1rem;
    color: #0f172a;
    font-weight: 700;
}

.credit-app .co-meta {
    font-size: 0.85rem;
    color: #64748b;
    margin: 2px 0 0 0;
}

.credit-app .tenure-badge {
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 6px;
    text-align: center;
}

.credit-app .tenure-val {
    display: block;
    font-weight: 700;
    color: #0f172a;
    font-size: 1.1rem;
    line-height: 1;
}

.credit-app .tenure-lbl {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
}

.credit-app .ia-section {
    background: #f8fafc;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.credit-app .ia-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #4f46e5;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.credit-app .ia-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.credit-app .ia-metric label {
    display: block;
    font-size: 0.7rem;
    color: #64748b;
}

.credit-app .ia-metric div {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

.credit-app .news-section {
    margin-top: auto;
    border-top: 1px dashed #cbd5e1;
    padding-top: 15px;
}

.credit-app .news-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.credit-app .news-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.credit-app .news-item:hover {
    opacity: 0.7;
}

.credit-app .news-date {
    font-size: 0.7rem;
    color: #94a3b8;
    min-width: 60px;
}

.credit-app .news-headline {
    font-size: 0.8rem;
    color: #0f172a;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: underline;
    text-decoration-color: #e2e8f0;
}

.credit-app .wf-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 30px;
    align-items: center;
}

.credit-app .wf-chart-box {
    height: 250px;
    position: relative;
    width: 100%;
}

.credit-app .wf-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

.credit-app .wf-row.total {
    border-top: 2px solid #e2e8f0;
    border-bottom: none;
    font-weight: 700;
    margin-top: 10px;
    padding-top: 15px;
    font-size: 1rem;
}

/* Laboral Tab Responsive */
@media (max-width: 768px) {
    .credit-app .lab-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .credit-app .lab-card {
        padding: 16px;
    }

    .credit-app .co-header {
        flex-direction: column;
        gap: 12px;
    }

    .credit-app .tenure-badge {
        align-self: flex-start;
    }

    .credit-app .ia-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .credit-app .wf-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .credit-app .lab-card {
        padding: 12px;
    }

    .credit-app .co-name {
        font-size: 1rem;
    }
}

/* ==========================================================================
   Common Alert Banner Styles
   ========================================================================== */
.credit-app .alert-banner {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

