/* ===========================================
   KELUARGA LIST SPECIFIC STYLES
   Styles khusus untuk keluarga_list.html
   =========================================== */

/* Keluarga wrapper */
.keluarga-list-wrapper .row {
    margin-bottom: 1rem;
}

.keluarga-list-wrapper .card {
    margin-bottom: 1rem;
}

/* Compact column widths for keluarga table */
.keluarga-table th:nth-child(1), /* Checkbox */
.keluarga-table td:nth-child(1) {
    width: 40px !important;
    max-width: 40px !important;
    padding-left: 0.5rem !important;
    padding-right: 0.25rem !important;
}

.keluarga-table th:nth-child(2), /* No */
.keluarga-table td:nth-child(2) {
    width: 45px !important;
    max-width: 45px !important;
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
    text-align: center !important;
}

.keluarga-table th:nth-child(3), /* No KK */
.keluarga-table td:nth-child(3) {
    width: 140px !important;
    max-width: 140px !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    white-space: nowrap !important;
}

.keluarga-table th:nth-child(5), /* Jumlah Anggota */
.keluarga-table td:nth-child(5) {
    width: 130px !important;
    max-width: 130px !important;
    text-align: center !important;
}

.keluarga-table th:nth-child(6), /* Aksi */
.keluarga-table td:nth-child(6) {
    width: 120px !important;
    max-width: 120px !important;
    text-align: center !important;
}

/* ===========================================
   MOBILE RESPONSIVE (max-width: 575.98px)
   =========================================== */
@media (max-width: 575.98px) {
    /* Reduce overall page spacing */
    .keluarga-list-wrapper .container-fluid {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    /* Compact page header */
    .keluarga-list-wrapper .row.mb-4 {
        margin-bottom: 0.5rem !important;
    }
    
    .keluarga-list-wrapper .h3 {
        font-size: 1rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .keluarga-list-wrapper .text-muted.small {
        font-size: 0.7rem !important;
    }
    
    /* Compact header buttons */
    .keluarga-list-wrapper .header-buttons-wrapper {
        gap: 0.25rem !important;
        margin-top: 0.5rem !important;
    }
    
    /* Compact card spacing */
    .keluarga-list-wrapper .card {
        margin-bottom: 0.75rem !important;
    }
    
    /* Compact card header */
    .keluarga-list-wrapper .card-header {
        padding: 0.5rem !important;
    }
    
    .keluarga-list-wrapper .card-header h6 {
        font-size: 0.85rem !important;
        margin: 0 !important;
    }
    
    /* Compact filter card */
    .keluarga-list-wrapper .filter-card .card-body {
        padding: 0.5rem !important;
    }
    
    /* Compact card footer */
    .keluarga-list-wrapper .card-footer {
        padding: 0.5rem !important;
    }
    
    /* Compact bulk actions */
    .keluarga-list-wrapper .card-footer .d-flex {
        margin-bottom: 0.5rem !important;
    }
    
    .keluarga-list-wrapper .card-footer .text-muted {
        font-size: 0.7rem !important;
    }
    
    /* Bulk actions SUPER compact on mobile */
    .keluarga-list-wrapper .bulk-actions-inline {
        gap: 0.25rem;
    }
    
    .keluarga-list-wrapper .bulk-count-badge {
        min-width: 22px;
        height: 22px;
        font-size: 0.65rem;
        padding: 0 0.3rem;
    }
    
    .keluarga-list-wrapper .bulk-btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.7rem;
        gap: 0.25rem;
        border-radius: 0.2rem;
    }
    
    .keluarga-list-wrapper .bulk-btn i {
        font-size: 0.7rem;
    }
    
    .keluarga-list-wrapper .bulk-btn-text {
        display: none;
    }
    
    /* Compact pagination */
    .keluarga-list-wrapper .pagination {
        margin: 0 !important;
    }
    
    .keluarga-list-wrapper .page-link {
        padding: 0.25rem 0.4rem !important;
        font-size: 0.7rem !important;
    }
    
    /* Force horizontal scroll on small screens */
    .keluarga-table {
        min-width: 700px !important;
    }
    
    /* Super compact header and cells */
    .keluarga-table th,
    .keluarga-table td {
        padding: 0.35rem 0.25rem !important;
        font-size: 0.7rem !important;
        vertical-align: middle !important;
    }
    
    .keluarga-table th:nth-child(1),
    .keluarga-table td:nth-child(1) {
        width: 32px !important;
        max-width: 32px !important;
        padding-left: 0.2rem !important;
        padding-right: 0.1rem !important;
    }
    
    .keluarga-table th:nth-child(2),
    .keluarga-table td:nth-child(2) {
        width: 35px !important;
        max-width: 35px !important;
        padding: 0.35rem 0.15rem !important;
        font-size: 0.65rem !important;
    }
    
    .keluarga-table th:nth-child(3),
    .keluarga-table td:nth-child(3) {
        width: 110px !important;
        max-width: 110px !important;
        padding: 0.35rem 0.3rem !important;
        font-size: 0.68rem !important;
    }
    
    .keluarga-table th:nth-child(4),
    .keluarga-table td:nth-child(4) {
        max-width: 150px !important;
        padding: 0.35rem 0.35rem !important;
        font-size: 0.7rem !important;
    }
    
    .keluarga-table th:nth-child(5),
    .keluarga-table td:nth-child(5) {
        width: 85px !important;
        max-width: 85px !important;
        padding: 0.35rem 0.25rem !important;
        font-size: 0.65rem !important;
    }
    
    .keluarga-table th:nth-child(6),
    .keluarga-table td:nth-child(6) {
        width: 90px !important;
        max-width: 90px !important;
        padding: 0.35rem 0.2rem !important;
    }
    
    /* Compact badge on mobile */
    .keluarga-table .badge {
        font-size: 0.6rem !important;
        padding: 0.15rem 0.3rem !important;
    }
    
    /* Compact button group on mobile */
    .keluarga-table .btn-group-sm .btn {
        padding: 0.15rem 0.25rem !important;
        font-size: 0.6rem !important;
    }
    
    /* Compact icons */
    .keluarga-table .fas {
        font-size: 0.7rem !important;
    }
    
    /* Remove extra margin from custom checkbox */
    .keluarga-table .custom-control {
        padding-left: 1rem !important;
        margin-bottom: 0 !important;
    }
    
    .keluarga-table .custom-control-label::before,
    .keluarga-table .custom-control-label::after {
        width: 0.9rem !important;
        height: 0.9rem !important;
        top: 0.05rem !important;
    }
    
    /* Compact thead */
    .keluarga-table thead th {
        padding-top: 0.4rem !important;
        padding-bottom: 0.4rem !important;
    }
    
    /* Hide No KK icon on mobile to save space */
    .keluarga-table td:nth-child(3) .fa-id-card {
        display: none !important;
    }
    
    /* Hide username icon on mobile */
    .keluarga-table td:nth-child(4) .fa-user {
        display: none !important;
    }
}

/* ===========================================
   TABLET (576px - 991.98px)
   =========================================== */
@media (min-width: 576px) and (max-width: 991.98px) {
    .keluarga-table th:nth-child(2),
    .keluarga-table td:nth-child(2) {
        width: 45px !important;
        font-size: 0.75rem !important;
    }
    
    .keluarga-table th:nth-child(3),
    .keluarga-table td:nth-child(3) {
        width: 130px !important;
        font-size: 0.8rem !important;
    }
    
    .keluarga-table th:nth-child(5),
    .keluarga-table td:nth-child(5) {
        width: 120px !important;
    }
}

/* ===========================================
   DESKTOP (min-width: 992px)
   =========================================== */
@media (min-width: 992px) {
    .keluarga-table th:nth-child(3),
    .keluarga-table td:nth-child(3) {
        width: 150px !important;
    }
    
    .keluarga-list-wrapper .bulk-btn-text {
        display: inline;
    }
}

/* ===========================================
   END OF KELUARGA CSS
   =========================================== */

