/* ===========================
   SENTRAFLOW MOBILE SPACING FIXES
   Specific fixes for mobile card spacing issues
   =========================== */

/* Fix the main dashboard cards that appear in the mobile screenshot */
@media screen and (max-width: 768px) {
    /* Target all cards on the main dashboard */
    .card {
        margin-bottom: 2rem !important;
    }
    
    .card .card-body {
        padding: 2.5rem 2rem 2.5rem 2rem !important;
        min-height: 200px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        align-items: center !important;
        box-sizing: border-box !important;
    }
    
    /* Ensure bottom spacing for all text elements */
    .card .card-body > *:last-child {
        margin-bottom: 0 !important;
        padding-bottom: 2rem !important;
        margin-top: auto !important;
    }
    
    .card .text-muted {
        margin-top: auto !important;
        padding-top: 1.5rem !important;
        padding-bottom: 2rem !important;
        text-align: center !important;
        line-height: 1.4 !important;
    }
    
    .card small {
        margin-top: auto !important;
        padding-top: 1.5rem !important;
        padding-bottom: 2rem !important;
        text-align: center !important;
        line-height: 1.4 !important;
    }
    
    /* Main metric value styling */
    .card .metric-value,
    .card h3 {
        margin-bottom: 1rem !important;
        flex-shrink: 0 !important;
    }
    
    .card .metric-label,
    .card p {
        margin-bottom: 1rem !important;
        flex-shrink: 0 !important;
    }
}

@media screen and (max-width: 576px) {
    .card .card-body {
        padding: 2.5rem 1.5rem 2.5rem 1.5rem !important;
        min-height: 220px !important;
    }
    
    .card .text-muted {
        padding-bottom: 2.5rem !important;
    }
    
    .card small {
        padding-bottom: 2.5rem !important;
    }
}

@media screen and (max-width: 480px) {
    .card .card-body {
        padding: 2.25rem 1.25rem 2.25rem 1.25rem !important;
        min-height: 200px !important;
    }
    
    .card .text-muted {
        padding-bottom: 2.25rem !important;
    }
    
    .card small {
        padding-bottom: 2.25rem !important;
    }
}

@media screen and (max-width: 414px) {
    .card .card-body {
        padding: 2rem 1rem 2rem 1rem !important;
        min-height: 190px !important;
    }
    
    .card .text-muted {
        padding-bottom: 2rem !important;
    }
    
    .card small {
        padding-bottom: 2rem !important;
    }
}

/* Ensure content never touches bottom edge */
.metric-card .card-body::after {
    content: '';
    height: 1rem;
    flex-shrink: 0;
}

@media screen and (max-width: 576px) {
    .metric-card .card-body::after {
        height: 1.25rem;
    }
}

/* Force bottom spacing for ALL card text elements */
.card small,
.card .text-muted,
.card .metric-description {
    margin-bottom: 0 !important;
    padding-bottom: 2rem !important;
    margin-top: auto !important;
}

@media screen and (max-width: 576px) {
    .card small,
    .card .text-muted,
    .card .metric-description {
        margin-bottom: 0 !important;
        padding-bottom: 2.5rem !important;
        margin-top: auto !important;
    }
}

/* Extra spacing buffer for ALL cards */
.card .card-body::after {
    content: '';
    height: 1.5rem !important;
    flex-shrink: 0 !important;
    width: 100% !important;
}

@media screen and (max-width: 576px) {
    .card .card-body::after {
        height: 2rem !important;
    }
}