/* public/assets/css/custom/financial-indicators.css */

/* --- Shared Form Styles --- */
.fiche-financiere-client .form-label,
.fiche-financiere .form-label {
    font-weight: 500;
    color: #4a5568;
    font-size: 0.9rem;
}

.fiche-financiere-client .form-control,
.fiche-financiere .form-control {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 0.6rem 0.8rem;
    font-size: 0.95rem;
}

.fiche-financiere-client .form-control:focus,
.fiche-financiere .form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* --- Financial Table Styles --- */
.custom-financial-table {
    width: 100%;
}

.custom-financial-table td {
    font-size: 0.95rem;
    color: #2d3748;
}

.custom-financial-table .form-control {
    text-align: right;
    padding: 0.4rem 0.6rem;
    background-color: #f8fafc;
}

.custom-financial-table .indicator-row:hover {
    background-color: #fcfdfe;
}

.custom-financial-table .indicator-row td:first-child {
    font-weight: 500;
}

.badge.bg-light {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* --- Mobile Optimization: Table to Cards --- */
@media (max-width: 991px) {

    .custom-financial-table,
    .custom-financial-table thead,
    .custom-financial-table tbody,
    .custom-financial-table tr,
    .custom-financial-table td {
        display: block;
        width: 100%;
    }

    .custom-financial-table thead {
        display: none;
        /* Hide headers */
    }

    .custom-financial-table .desktop-only {
        display: none;
    }

    .custom-financial-table .group-header td {
        padding: 1rem 0 0.25rem 0 !important;
        border: none;
    }

    .custom-financial-table .indicator-row {
        background: #fff;
        border: 1px solid #edf2f7;
        border-radius: 12px;
        padding: 0.75rem;
        margin-bottom: 0.75rem;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    }

    .custom-financial-table .indicator-row td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.35rem 0 !important;
        border-bottom: 1px solid #f1f5f9;
    }

    .custom-financial-table .indicator-row td:last-child {
        border-bottom: none;
    }

    .custom-financial-table .indicator-row td.indicator-label {
        display: block;
        font-size: 0.95rem;
        font-weight: 600;
        color: #6366f1;
        border-bottom: 2px solid #f1f5f9;
        padding-bottom: 0.5rem !important;
        margin-bottom: 0.35rem;
    }

    .custom-financial-table .indicator-row td[data-label]::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        color: #718096;
        text-transform: uppercase;
        margin-right: 0.5rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .custom-financial-table .indicator-row td .form-control,
    .custom-financial-table .indicator-row td .input-group {
        width: 100%;
        max-width: 180px;
        /* User specifically increased this to 180px */
        text-align: right;
        padding: 0.25rem 0.4rem;
        font-size: 0.85rem;
        margin-left: auto;
    }

    /* Force input-group to not wrap on mobile card view */
    .fiche-financiere-client .input-group,
    .fiche-financiere .input-group {
        flex-wrap: nowrap !important;
    }

    .fiche-financiere-client .input-group .form-control,
    .fiche-financiere .input-group .form-control {
        min-width: 0;
    }
}