.family-table-wrapper {
    --fb-primary: #1877F2;
    --fb-background: #F0F2F5;
    --fb-text: #1C1E21;
    --fb-hover: #E4E6EB;
    --fb-active: #D8DADf;
    --fb-success: #42B72A;
    --fb-danger: #FA3C4C;
    --transition: all 0.3s ease;
    
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.family-table-container {
    background: var(--fb-background);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: var(--transition);
}

.family-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px;
    gap: 15px;
}

.family-table-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.family-table-search {
    position: relative;
    display: flex;
    align-items: center;
}

.family-table-search input {
    padding: 8px 30px 8px 10px;
    border: 1px solid var(--fb-hover);
    border-radius: 20px;
    font-size: 14px;
    width: 200px;
    transition: var(--transition);
}

.family-table-search input:focus {
    outline: none;
    border-color: var(--fb-primary);
    box-shadow: 0 0 5px rgba(24, 119, 242, 0.3);
}

.family-table-search button {
    position: absolute;
    right: 5px;
    background: none;
    border: none;
    color: var(--fb-text);
    cursor: pointer;
    padding: 5px;
}

.family-table-refresh-btn {
    background: none;
    border: 1px solid var(--fb-hover);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.family-table-refresh-btn:hover {
    background-color: var(--fb-hover);
}

.family-table-refresh-btn.refreshing i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.family-table-filter {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding: 0 10px;
}

.family-table-radio {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.family-table-radio input {
    margin: 0;
}

.family-table-title {
    color: var(--fb-text);
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    position: relative;
    padding-bottom: 8px;
}

.family-table-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--fb-primary);
    border-radius: 2px;
    transition: var(--transition);
}

.family-table-scroll {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.family-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px;
}

.family-table th,
.family-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--fb-hover);
}

.family-table th {
    background-color: var(--fb-primary);
    color: white;
    font-weight: 600;
    white-space: nowrap;
}

.family-table th:first-child {
    border-top-left-radius: 8px;
}

.family-table th:last-child {
    border-top-right-radius: 8px;
}

.family-table tr:nth-child(even) {
    background-color: #FFFFFF;
}

.family-table tr:hover {
    background-color: var(--fb-hover);
    transition: var(--transition);
}

.family-table-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #E4E6EB;
    border: 2px solid var(--fb-background);
    transition: var(--transition);
}

.family-table tr:hover .family-table-avatar {
    transform: scale(1.05);
    border-color: var(--fb-primary);
}

.family-table-empty {
    text-align: center;
    padding: 40px 20px; /* Tăng padding để có không gian cho icon lớn */
    color: var(--fb-text);
    font-size: 16px;
    font-weight: 500;
    display: flex;
    flex-direction: column; /* Icon trên, text dưới */
    align-items: center; /* Căn giữa ngang */
    justify-content: center; /* Căn giữa dọc trong không gian td */
}

.family-table-empty i {
    font-size: 48px; /* Icon lớn hơn */
    color: var(--fb-danger);
    margin-bottom: 15px; /* Khoảng cách giữa icon và text */
    display: block; /* Đảm bảo icon chiếm dòng riêng */
}

.family-table-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-start;
    align-items: center;
}

.family-table-btn-approval,
.family-table-btn-edit,
.family-table-btn-view {
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.family-table-btn-approval {
    background-color: #42B72A;
    color: white;
    border: none;
}

.family-table-btn-approval:hover {
    background-color: #3A9E24;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.family-table-btn-approval:disabled {
    background-color: #D8DADf;
    color: #8A8D91;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.family-table-btn-reject {
    background-color: var(--fb-danger); /* Màu đỏ */
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.family-table-btn-reject:hover {
    background-color: #D93644;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.family-table-btn-reject:disabled {
    background-color: #D8DADf;
    color: #8A8D91;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.family-table-btn-reject i {
    font-size: 14px;
    transition: all 0.3s ease;
}

.family-table-btn-reject:hover i {
    transform: scale(1.1);
}

.family-table-btn-edit {
    background-color: #1877F2;
    color: white;
    border: none;
}

.family-table-btn-edit:hover {
    background-color: #166FE5;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.family-table-btn-view {
    background-color: white;
    color: #1877F2;
    border: 1px solid #1877F2;
}

.family-table-btn-view:hover {
    background-color: #F0F2F5;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.family-table-btn-approval i,
.family-table-btn-edit i,
.family-table-btn-view i {
    font-size: 14px;
    transition: all 0.3s ease;
}

.family-table-btn-approval:hover i,
.family-table-btn-edit:hover i,
.family-table-btn-view:hover i {
    transform: scale(1.1);
}

.family-table-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.family-table-pagination button {
    padding: 8px 12px;
    border: 1px solid var(--fb-hover);
    background-color: white;
    color: var(--fb-text);
    cursor: pointer;
    border-radius: 4px;
    font-weight: 500;
    transition: var(--transition);
    min-width: 36px;
}

.family-table-pagination button:hover {
    background-color: var(--fb-hover);
    border-color: var(--fb-active);
}

.family-table-pagination button.active {
    background-color: var(--fb-primary);
    color: white;
    border-color: var(--fb-primary);
    transform: scale(1.05);
}

.family-table-pagination input[type="number"] {
    width: 60px;
    padding: 5px;
    border-radius: 4px;
    border: 1px solid var(--fb-hover);
    font-size: 14px;
}

.family-table-pagination button#goToPageBtn {
    background-color: var(--fb-primary);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.family-table-pagination button#goToPageBtn:hover {
    background-color: #166FE5;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .family-table-container {
        padding: 15px;
    }
    .family-table-title {
        font-size: 22px;
    }
    .family-table-search input {
        width: 180px;
    }
    .family-table-empty {
        font-size: 15px;
        padding: 30px 15px;
    }
    .family-table-empty i {
        font-size: 40px;
        margin-bottom: 12px;
    }
}

@media (max-width: 768px) {
    .family-table-wrapper {
        padding: 8px;
    }
    .family-table-container {
        padding: 10px;
        border-radius: 6px;
    }
    .family-table-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .family-table-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    .family-table-search input {
        width: 100%;
    }
    .family-table-filter {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    .family-table-title {
        font-size: 20px;
        text-align: center;
    }
    .family-table-title::after {
        left: 50%;
        transform: translateX(-50%);
        width: 80px;
    }
    .family-table-add-btn {
        width: 100%;
        padding: 8px;
    }
    .family-table th,
    .family-table td {
        padding: 8px;
        font-size: 13px;
    }
    .family-table-avatar {
        width: 32px;
        height: 32px;
    }
    .family-table-empty {
        font-size: 14px;
        padding: 25px 10px;
    }
    .family-table-empty i {
        font-size: 36px;
        margin-bottom: 10px;
    }
    .family-table-actions {
        flex-direction: column;
        gap: 5px;
    }
    .family-table-btn-approval,
    .family-table-btn-reject,
    .family-table-btn-edit,
    .family-table-btn-view {
        width: 100%;
        padding: 5px 8px;
    }
}

@media (max-width: 480px) {
    .family-table-container {
        padding: 8px;
    }
    .family-table-title {
        font-size: 18px;
    }
    .family-table-add-btn {
        padding: 8px;
        font-size: 13px;
    }
    .family-table-pagination {
        flex-wrap: wrap;
    }
    .family-table-pagination button {
        padding: 6px 10px;
        min-width: 32px;
    }
    .family-table-actions {
        gap: 4px;
    }
    .family-table-btn-approval,
    .family-table-btn-reject,
    .family-table-btn-edit,
    .family-table-btn-view {
        padding: 4px 6px;
        font-size: 12px;
    }
    .family-table-btn-approval i,
    .family-table-btn-reject i,
    .family-table-btn-edit i,
    .family-table-btn-view i {
        font-size: 12px;
    }
}
.edit-member-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    font-family: "Inter", Helvetica, Arial, sans-serif;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 20px;
}

.edit-member-modal-content {
    background: #ffffff;
    color: #1a1a1a;
    margin: auto;
    padding: 24px;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
}

.edit-member-modal-header {
    position: relative;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.edit-member-modal-header h2 {
    text-align: center;
    color: #2563eb;
    font-size: 20px !important;
    font-weight: 700;
    margin: 0;
}

.edit-member-modal-close {
    position: absolute;
    top: -8px;
    right: 0;
    color: #4b5563;
    font-size: 24px;
    font-weight: 500;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    border: none;
    background: none;
}

.edit-member-modal-close:hover {
    background-color: #f3f4f6;
    color: #2563eb;
}

.edit-member-form-member {
    display: grid;
    gap: 16px;
}

/* Two-column layout for name fields */
.edit-member-name-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.edit-member-name-column {
    display: flex;
    flex-direction: column;
}

.edit-member-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.edit-member-form-group label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.edit-member-form-group input[type="text"],
.edit-member-form-group input[type="date"] {
    height: 42px;
    width: 100%;
    padding: 0 12px;
    font-size: 14px;
    color: #1a1a1a;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: #f9fafb;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.edit-member-form-group input[type="text"]:focus,
.edit-member-form-group input[type="date"]:focus {
    border-color: #2563eb;
    background-color: #ffffff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.edit-member-form-group select {
    height: 42px;
    width: 100%;
    padding: 0 12px;
    font-size: 14px;
    color: #1a1a1a;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: #f9fafb;
    transition: all 0.2s ease;
    appearance: none;
    cursor: pointer;
}

.edit-member-form-group select:focus {
    border-color: #2563eb;
    background-color: #ffffff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}



#edit-member-submit-button {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#edit-member-submit-button:hover:not(.edit-member-button-loading) {
    background-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.edit-member-button-loading {
    position: relative;
    opacity: 0.7;
    cursor: not-allowed;
}

.edit-member-button-loading::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .edit-member-modal-content {
        padding: 20px;
        max-width: 90%;
    }

    .edit-member-name-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .edit-member-modal-header h2 {
        font-size: 18px !important;
    }

    #edit-member-submit-button {
        font-size: 13px;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .edit-member-modal-content {
        padding: 16px;
        max-width: 95%;
    }

    .edit-member-form-member {
        gap: 12px;
    }

    .edit-member-form-group input[type="text"],
    .edit-member-form-group input[type="date"],
    .edit-member-form-group select {
        height: 38px;
        font-size: 13px;
    }

    #edit-member-submit-button {
        padding: 8px;
        font-size: 12px;
    }
}