/* ===========================================
   TARGETED FOOTER OVERLAP PREVENTION + LAYOUT FIXES
   GLOBAL CSS FILE - LOADED ON ALL PAGES
   =========================================== */

/* ONLY TARGET FOOTER OVERLAP - NO EXCESSIVE SPACING */
footer,
.footer,
.page-footer {
    margin-top: 1rem !important;
    padding-top: 0.5rem !important;
    position: relative !important;
    z-index: 10 !important;
    clear: both !important;
    display: block !important;
}

/* MINIMAL BODY SPACING - ONLY TO PREVENT OVERLAP */
body {
    padding-bottom: 0.5rem !important;
    min-height: 100vh !important;
}

/* ONLY ADD SPACING TO LAST CARD TO PREVENT FOOTER OVERLAP */
.card:last-child {
    margin-bottom: 1.5rem !important;
}

/* FIX LAYOUT OVERLAPS */
.row {
    margin-left: -15px;
    margin-right: -15px;
}

.col-lg-8, .col-lg-4, .col-md-3, .col-md-4, .col-md-6, .col-md-8 {
    padding-left: 15px;
    padding-right: 15px;
}

/* Ensure proper card spacing */
.card {
    margin-bottom: 1.5rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15) !important;
}

/* Fix table responsive issues */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Ensure proper spacing in card headers */
.card-header {
    padding: 0.75rem 1.25rem;
    margin-bottom: 0;
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
}

/* Fix button spacing in headers */
.d-sm-flex .btn {
    margin-left: 0.5rem;
}

/* Fix table cell spacing */
.table td, .table th {
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}

/* Fix form spacing */
.form-group {
    margin-bottom: 1rem;
}

/* RESPONSIVE FIXES - MINIMAL */
@media (max-width: 768px) {
    footer {
        margin-top: 1.5rem !important;
    }
    
    .card:last-child {
        margin-bottom: 2rem !important;
    }
    
    .col-lg-8, .col-lg-4, .col-md-3, .col-md-4, .col-md-6, .col-md-8 {
        margin-bottom: 1rem;
    }
    
    .d-sm-flex {
        flex-direction: column;
    }
    
    .d-sm-flex .btn {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}
