/* Main container */
.custom-profile-editor {
    direction: rtl; /* keep RTL layout for page */
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

/* Sections */
.sections {
    display: grid;
    gap: 28px;
}

/* Tables */
.custom-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 8px 0;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border-radius: 6px;
    overflow: hidden;
    table-layout: auto;
}

.custom-table th,
.custom-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
    vertical-align: middle;
}

.custom-table thead th {
    background: #fafafa;
    font-weight: 600;
    border-bottom: 1px solid #eaeaea;
}

/* cell-rtl used to display Arabic names/emails right-to-left visually */
.cell-rtl {
    direction: rtl;
    text-align: right;
}

/* Phone numbers kept LTR and monospace */
.phone {
    direction: ltr;
    text-align: left;
    font-family: monospace;
    letter-spacing: 0.6px;
}

/* Edit modal */
#custom-edit-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 10000;
    width: 92%;
    max-width: 560px;
}

/* Form styling */
.edit-form .form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    padding: 0 6px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="file"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e6e6e6;
    border-radius: 6px;
}

/* Actions */
.form-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.save-btn, .cancel-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.save-btn {
    background: #0073aa;
    color: #fff;
}

.cancel-btn {
    background: #efefef;
    color: #222;
}

/* Table buttons */
.edit-btn, .delete-btn {
    cursor: pointer;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    min-width: 64px;
}

.edit-btn:hover {
    background-color: #f7f7f7;
}

.delete-btn {
    color: #a00;
    border-color: #f3c6c8;
}

.delete-btn:hover {
    background-color: #fff0f0;
}

/* Total count below table */
.total-count {
    margin-top: 8px;
    font-weight: 600;
    color: #333;
    text-align: right;
}

/* Responsive */
@media (max-width: 900px) {
    .sections {
        grid-template-columns: 1fr;
    }

    .custom-table {
        display: block;
        overflow-x: auto;
    }

    #custom-edit-modal {
        width: 96%;
        padding: 14px;
    }
}