/* KPI Cards Styles - Shared across all Index views */

.kpi-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 0.5rem;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15) !important;
}

.kpi-card .avatar-title {
    transition: all 0.3s ease;
}

.kpi-card:hover .avatar-title {
    transform: scale(1.1);
}

/* Fade-in animation */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Animation delays for cascading effect */
.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }
.fade-in-delay-4 { animation-delay: 0.4s; }
.fade-in-delay-5 { animation-delay: 0.5s; }

/* Additional animations for table rows */
.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(var(--highdmin-primary-rgb), 0.05);
}

/* Card header improvements */
.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* Search input styling */
.input-group .form-control:focus {
    border-color: var(--highdmin-primary);
    box-shadow: 0 0 0 0.15rem rgba(var(--highdmin-primary-rgb), 0.25);
}

/* Button soft variants */
.btn-soft-primary {
    color: var(--highdmin-primary);
    background-color: rgba(var(--highdmin-primary-rgb), 0.1);
    border-color: transparent;
}

.btn-soft-primary:hover {
    color: #fff;
    background-color: var(--highdmin-primary);
}

.btn-soft-danger {
    color: var(--highdmin-danger);
    background-color: rgba(var(--highdmin-danger-rgb), 0.1);
    border-color: transparent;
}

.btn-soft-danger:hover {
    color: #fff;
    background-color: var(--highdmin-danger);
}

/* Badge subtle variants */
.badge.bg-primary-subtle {
    background-color: rgba(var(--highdmin-primary-rgb), 0.1);
}

.badge.bg-success-subtle {
    background-color: rgba(var(--highdmin-success-rgb), 0.1);
}

.badge.bg-danger-subtle {
    background-color: rgba(var(--highdmin-danger-rgb), 0.1);
}

.badge.bg-warning-subtle {
    background-color: rgba(var(--highdmin-warning-rgb), 0.1);
}

.badge.bg-info-subtle {
    background-color: rgba(var(--highdmin-info-rgb), 0.1);
}

.badge.bg-secondary-subtle {
    background-color: rgba(var(--highdmin-secondary-rgb), 0.1);
}

/* Tarjetas de indicador en el telefono, como las resuelve la maqueta (erp-gubernamental.iademo.com):
   una por fila y a todo el ancho, el titulo arriba con el icono pequeño a la derecha y la cifra
   grande debajo. En dos columnas de unos 150 px, con el icono a la izquierda, a la cifra le
   quedaban 54 px y "$ 1.500.000.000" asomaba por la derecha (Proyectos por Barrio). */
@media (max-width: 575.98px) {
    .kpi-row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .kpi-card .card-body > .d-flex {
        position: relative;
    }

    .kpi-card .card-body > .d-flex > .flex-shrink-0 {
        position: absolute;
        top: 0;
        right: 0;
        margin: 0 !important;
    }

    .kpi-card .avatar-sm {
        width: 2rem;
        height: 2rem;
    }

    .kpi-card .avatar-title {
        font-size: 1rem !important;
    }

    /* Sitio a la derecha para el icono, y que el texto pueda encogerse. */
    .kpi-card .card-body > .d-flex > .flex-grow-1 {
        min-width: 0;
        padding-right: 2.5rem;
    }
}

/* En tableta, dos por fila. Cuatro en 768 px dejan unos 170 px por tarjeta y, con el icono al lado,
   "Superavit $ 3.000.000.000" asomaba por la derecha (Anteproyecto). */
@media (min-width: 576px) and (max-width: 991.98px) {
    .kpi-row > [class*="col-"] {
        flex: 0 0 50%;
        max-width: 50%;
    }
}
