/* ==========================================================================
   MÓDULO DE PAGOS Y TARJETAS DE RESUMEN (TERRENO FÁCIL)
   ========================================================================== */

/* Colores e Identidad de Marca */
:root {
    --tf-blue: #006DAB;
    --tf-orange: #f37021;
}

/* 1. Header de Resumen y Gradientes */
.bg-tf-gradient {
    background: var(--tf-blue);
}

.btn-mapa-interactive {
    transition: all 0.3s ease;
}

.btn-mapa-interactive:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15) !important;
    background-color: #ffffff !important;
}

/* 2. Tarjetas KPI / Indicadores de Saldos */
.kpi-card-pagado {
    background-color: #f8fff9;
    border-left: 4px solid #198754 !important;
}

.kpi-card-restante {
    background-color: #fff8f5;
    border-left: 4px solid var(--tf-orange) !important;
}

.text-tf-orange {
    color: var(--tf-orange) !important;
}

.icon-kpi {
    width: 38px;
    height: 38px;
}

.datos-bancarios-collapsible {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-10px);
    transition: all 0.4s ease-in-out;
    visibility: hidden;
}

.datos-bancarios-collapsible.show {
    max-height: 600px; /* Altura suficiente para mostrar el contenido completo */
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

@media (min-width: 768px) {
    .icon-kpi {
        width: 48px;
        height: 48px;
    }
}

/* 3. Tablas Responsive Basadas en data-label */
@media (max-width: 768px) {
    .table-responsive-cards thead {
        display: none;
    }

    .table-responsive-cards tr {
        display: block;
        margin-bottom: 1rem;
        background: #fff;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    /* Filas compactas: etiqueta a la izquierda, dato a la derecha, tipografía pequeña uniforme */
    .table-responsive-cards td {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 12px;
        padding: 6px 12px !important;
        font-size: 11px;
        line-height: 1.35;
        text-align: right;
        border-bottom: 1px solid #f0f0f0;
        overflow-wrap: anywhere;
    }

    .table-responsive-cards td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        max-width: 45%;
        text-align: left;
        text-transform: uppercase;
        font-weight: 600;
        color: #212529;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .table-responsive-cards .badge {
        font-size: 10px;
    }

    .table-responsive-cards .btn {
        font-size: 12px;
    }

    .table-responsive-cards td small {
        font-size: 10px !important;
    }

    .table-responsive-cards td:not([data-label]) {
        display: block;
        text-align: center;
    }

    .arrears-table td,
    .arrears-table th {
        font-size: 12px;
    }

    .table-responsive-cards td:last-child {
        border-bottom: 0;
    }

    /* Excepción exclusiva para tablas que contienen botones de acción finales */
    .tabla-con-acciones td:last-child {
        display: block;
        text-align: center !important;
        padding: 12px 15px !important;
        background-color: #f8f9fa;
    }

    .tabla-con-acciones td:last-child::before {
        display: none !important;
    }
}